diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-03 09:36:32 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-03 09:36:32 +0000 |
commit | ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b (patch) | |
tree | 9e1519583f2eec1b0ed0929fead97ef37ae28013 /llvm/test/Transforms | |
parent | f82672873a283c108c23d9b777badd41b3dfa272 (diff) | |
download | bcm5719-llvm-ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b.tar.gz bcm5719-llvm-ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b.zip |
[SCEV][LSR] Prevent using undefined value in binops
On some occasions ReuseOrCreateCast may convert previously
expanded value to undefined. That value may be passed by
SCEVExpander as an argument to InsertBinop making IV chain
undefined.
Differential revision: https://reviews.llvm.org/D63928
llvm-svn: 365009
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll b/llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll index 64104e5c299..673b2942bad 100644 --- a/llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll +++ b/llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll @@ -52,7 +52,7 @@ join: ; %c = phi i32* [ %c1, %one ], [ %c2, %two ] ; %a3 = bitcast i32* %a to i8* <--- new ; %c5 = bitcast i32* %c to i8* -; %0 = bitcast i32* undef to i8* <--- old, invalidated +; %0 = bitcast i32* %a to i8* <--- old, invalidated ; ; 3. Finally, when C is expanded again: ; @@ -61,16 +61,20 @@ join: ; %c = phi i32* [ %c1, %one ], [ %c2, %two ] ; %c5 = bitcast i32* %c to i8* <--- new ; %a3 = bitcast i32* %a to i8* -; %0 = bitcast i32* undef to i8* <--- old, invalidated -; %1 = bitcast i32* undef to i8* +; %0 = bitcast i32* %c to i8* <--- old, invalidated +; %1 = bitcast i32* %a to i8* %a = phi i32* [%a1, %one], [%a2, %two] %c = phi i32* [%c1, %one], [%c2, %two] br label %for.body - -; CHECK: [[VALUE:%[0-9a-z]+]] = bitcast i32* undef to i8* -; CHECK-NOT: [[VALUE]] +; CHECK: join +; CHECK: {{%[0-9a-z]+}} = bitcast i32* %c to i8* +; CHECK: {{%[0-9a-z]+}} = bitcast i32* %a to i8* +; CHECK: [[OLD_C:%[0-9a-z]+]] = bitcast i32* %c to i8* +; CHECK: [[OLD_A:%[0-9a-z]+]] = bitcast i32* %a to i8* +; CHECK-NOT: [[OLD_C]] +; CHECK-NOT: [[OLD_A]] for.body: ; preds = %for.body, %entry %ind = phi i64 [ 0, %join ], [ %add, %for.body ] |