diff options
Diffstat (limited to 'llvm/test/Transforms/LoopVersioning')
| -rw-r--r-- | llvm/test/Transforms/LoopVersioning/incorrect-phi.ll | 18 | ||||
| -rw-r--r-- | llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll | 10 |
2 files changed, 11 insertions, 17 deletions
diff --git a/llvm/test/Transforms/LoopVersioning/incorrect-phi.ll b/llvm/test/Transforms/LoopVersioning/incorrect-phi.ll index b6896c467812..de7b3c1dc581 100644 --- a/llvm/test/Transforms/LoopVersioning/incorrect-phi.ll +++ b/llvm/test/Transforms/LoopVersioning/incorrect-phi.ll @@ -1,4 +1,4 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 --check-globals none ; RUN: opt -passes=loop-versioning -S < %s | FileCheck %s ; Make sure all PHIs are properly updated in the exit block. Based on @@ -9,10 +9,6 @@ define void @phi_with_poison() { ; CHECK-LABEL: define void @phi_with_poison() { ; CHECK-NEXT: [[BB6_LVER_CHECK:.*:]] -; CHECK-NEXT: [[MUL:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 10, i64 0) -; CHECK-NEXT: [[MUL_RESULT:%.*]] = extractvalue { i64, i1 } [[MUL]], 0 -; CHECK-NEXT: [[MUL_OVERFLOW:%.*]] = extractvalue { i64, i1 } [[MUL]], 1 -; CHECK-NEXT: [[TMP0:%.*]] = sub i64 0, [[MUL_RESULT]] ; CHECK-NEXT: br i1 poison, label %[[BB6_PH_LVER_ORIG:.*]], label %[[BB6_PH:.*]] ; CHECK: [[BB6_PH_LVER_ORIG]]: ; CHECK-NEXT: br label %[[BB6_LVER_ORIG:.*]] @@ -32,8 +28,8 @@ define void @phi_with_poison() { ; CHECK-NEXT: [[_TMP123:%.*]] = getelementptr [2 x [3 x [5 x i16]]], ptr @x, i16 0, i64 poison ; CHECK-NEXT: [[_TMP126:%.*]] = getelementptr [3 x [5 x i16]], ptr [[_TMP123]], i16 0, i64 [[_TMP1423]] ; CHECK-NEXT: [[_TMP129:%.*]] = getelementptr [5 x i16], ptr [[_TMP126]], i16 0, i64 poison -; CHECK-NEXT: [[_TMP130:%.*]] = load i16, ptr [[_TMP129]], align 2 -; CHECK-NEXT: store i16 poison, ptr @x, align 2 +; CHECK-NEXT: [[_TMP130:%.*]] = load i16, ptr [[_TMP129]], align 2, !alias.scope [[META0:![0-9]+]] +; CHECK-NEXT: store i16 poison, ptr @x, align 2, !alias.scope [[META3:![0-9]+]] ; CHECK-NEXT: [[_TMP142]] = add i64 [[_TMP1423]], 1 ; CHECK-NEXT: br i1 false, label %[[BB6]], label %[[LOOP_EXIT_LOOPEXIT1:.*]] ; CHECK: [[LOOP_EXIT_LOOPEXIT]]: @@ -77,10 +73,6 @@ define void @phi_with_non_loop_defined_value() { ; CHECK-LABEL: define void @phi_with_non_loop_defined_value() { ; CHECK-NEXT: [[BB6_LVER_CHECK:.*:]] ; CHECK-NEXT: [[T:%.*]] = add i16 1, 1 -; CHECK-NEXT: [[MUL:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 10, i64 0) -; CHECK-NEXT: [[MUL_RESULT:%.*]] = extractvalue { i64, i1 } [[MUL]], 0 -; CHECK-NEXT: [[MUL_OVERFLOW:%.*]] = extractvalue { i64, i1 } [[MUL]], 1 -; CHECK-NEXT: [[TMP0:%.*]] = sub i64 0, [[MUL_RESULT]] ; CHECK-NEXT: br i1 poison, label %[[BB6_PH_LVER_ORIG:.*]], label %[[BB6_PH:.*]] ; CHECK: [[BB6_PH_LVER_ORIG]]: ; CHECK-NEXT: br label %[[BB6_LVER_ORIG:.*]] @@ -100,8 +92,8 @@ define void @phi_with_non_loop_defined_value() { ; CHECK-NEXT: [[_TMP123:%.*]] = getelementptr [2 x [3 x [5 x i16]]], ptr @x, i16 0, i64 poison ; CHECK-NEXT: [[_TMP126:%.*]] = getelementptr [3 x [5 x i16]], ptr [[_TMP123]], i16 0, i64 [[_TMP1423]] ; CHECK-NEXT: [[_TMP129:%.*]] = getelementptr [5 x i16], ptr [[_TMP126]], i16 0, i64 poison -; CHECK-NEXT: [[_TMP130:%.*]] = load i16, ptr [[_TMP129]], align 2 -; CHECK-NEXT: store i16 poison, ptr @x, align 2 +; CHECK-NEXT: [[_TMP130:%.*]] = load i16, ptr [[_TMP129]], align 2, !alias.scope [[META5:![0-9]+]] +; CHECK-NEXT: store i16 poison, ptr @x, align 2, !alias.scope [[META8:![0-9]+]] ; CHECK-NEXT: [[_TMP142]] = add i64 [[_TMP1423]], 1 ; CHECK-NEXT: br i1 false, label %[[BB6]], label %[[LOOP_EXIT_LOOPEXIT1:.*]] ; CHECK: [[LOOP_EXIT_LOOPEXIT]]: diff --git a/llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll b/llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll index 6e5eeaf9f121..d851a936969d 100644 --- a/llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll +++ b/llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll @@ -29,15 +29,18 @@ define void @f1(ptr noalias %a, ; LV-LABEL: @f1( ; LV-NEXT: for.body.lver.check: ; LV-NEXT: [[TMP0:%.*]] = add i64 [[N:%.*]], -1 +; LV-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP0]] to i32 +; LV-NEXT: [[MUL2:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 2, i32 [[TMP5]]) +; LV-NEXT: [[MUL_OVERFLOW1:%.*]] = extractvalue { i32, i1 } [[MUL2]], 1 ; LV-NEXT: [[TMP1:%.*]] = icmp ugt i64 [[TMP0]], 4294967295 +; LV-NEXT: [[TMP8:%.*]] = or i1 [[MUL_OVERFLOW1]], [[TMP1]] ; LV-NEXT: [[MUL1:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 4, i64 [[TMP0]]) ; LV-NEXT: [[MUL_RESULT:%.*]] = extractvalue { i64, i1 } [[MUL1]], 0 ; LV-NEXT: [[MUL_OVERFLOW:%.*]] = extractvalue { i64, i1 } [[MUL1]], 1 -; LV-NEXT: [[TMP2:%.*]] = sub i64 0, [[MUL_RESULT]] ; LV-NEXT: [[TMP3:%.*]] = getelementptr i8, ptr [[A:%.*]], i64 [[MUL_RESULT]] ; LV-NEXT: [[TMP4:%.*]] = icmp ult ptr [[TMP3]], [[A]] ; LV-NEXT: [[TMP6:%.*]] = or i1 [[TMP4]], [[MUL_OVERFLOW]] -; LV-NEXT: [[TMP7:%.*]] = or i1 [[TMP1]], [[TMP6]] +; LV-NEXT: [[TMP7:%.*]] = or i1 [[TMP8]], [[TMP6]] ; LV-NEXT: br i1 [[TMP7]], label [[FOR_BODY_PH_LVER_ORIG:%.*]], label [[FOR_BODY_PH:%.*]] ; LV: for.body.ph.lver.orig: ; LV-NEXT: br label [[FOR_BODY_LVER_ORIG:%.*]] @@ -75,7 +78,7 @@ define void @f1(ptr noalias %a, ; LV-NEXT: br i1 [[EXITCOND]], label [[FOR_END_LOOPEXIT2:%.*]], label [[FOR_BODY]] ; LV: for.end.loopexit: ; LV-NEXT: br label [[FOR_END:%.*]] -; LV: for.end.loopexit2: +; LV: for.end.loopexit5: ; LV-NEXT: br label [[FOR_END]] ; LV: for.end: ; LV-NEXT: ret void @@ -259,7 +262,6 @@ define void @f3(ptr noalias %a, ; LV-NEXT: [[MUL2:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 4, i64 [[TMP0]]) ; LV-NEXT: [[MUL_RESULT3:%.*]] = extractvalue { i64, i1 } [[MUL2]], 0 ; LV-NEXT: [[MUL_OVERFLOW4:%.*]] = extractvalue { i64, i1 } [[MUL2]], 1 -; LV-NEXT: [[TMP6:%.*]] = sub i64 0, [[MUL_RESULT3]] ; LV-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[A:%.*]], i64 [[MUL_RESULT3]] ; LV-NEXT: [[TMP8:%.*]] = icmp ult ptr [[TMP7]], [[A]] ; LV-NEXT: [[TMP9:%.*]] = or i1 [[TMP8]], [[MUL_OVERFLOW4]] |
