diff options
| author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-05-18 18:38:34 +0000 |
|---|---|---|
| committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-05-18 18:38:34 +0000 |
| commit | 693a1ca6284f5145d261b390156507f12046d4c6 (patch) | |
| tree | a0d4f06c01db7877cb21973820e6bc7dd3c2eda3 /llvm/test/Transforms/LoopVectorize | |
| parent | 836a4f36435a4984f733eca96bef187bb6ee992e (diff) | |
| download | bcm5719-llvm-693a1ca6284f5145d261b390156507f12046d4c6.tar.gz bcm5719-llvm-693a1ca6284f5145d261b390156507f12046d4c6.zip | |
LoopVectorize: Handle single edge PHIs
We might encouter single edge PHIs - handle them with an identity select.
Fixes PR15990.
llvm-svn: 182199
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/if-conv-crash.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/if-conv-crash.ll b/llvm/test/Transforms/LoopVectorize/if-conv-crash.ll index 3283456aa3c..f8f2cf1fff4 100644 --- a/llvm/test/Transforms/LoopVectorize/if-conv-crash.ll +++ b/llvm/test/Transforms/LoopVectorize/if-conv-crash.ll @@ -37,3 +37,25 @@ if.end21: ; preds = %lor.lhs.false if.end25: ; preds = %entry ret void } + +; PR15990 +; We can have basic blocks with single entry PHI nodes. +define void @single_entry_phi(i32* %a, i32 *%b) { +entry: + br label %for.cond1.preheader + +for.cond1.preheader: + %inc10 = phi i32 [ 0, %entry ], [ %inc, %for.end ] + br label %for.end + +for.end: + %malicious.phi = phi i32 [ 0, %for.cond1.preheader ] + %inc = add nsw i32 %inc10, 1 + %tobool = icmp eq i32 %inc, 0 + br i1 %tobool, label %for.cond.for.end5, label %for.cond1.preheader + +for.cond.for.end5: + %and.lcssa = phi i32 [ %malicious.phi, %for.end ] + store i32 %and.lcssa, i32* %a, align 4 + ret void +} |

