diff options
| author | Michael Kuperstein <mkuper@google.com> | 2016-07-12 21:24:06 +0000 | 
|---|---|---|
| committer | Michael Kuperstein <mkuper@google.com> | 2016-07-12 21:24:06 +0000 | 
| commit | a99c46cc73a70b57972c07562072ec5aeb6d8f4c (patch) | |
| tree | f5baa8c5bc71fac921cf6f07da339caa399cea56 /llvm/test | |
| parent | 1e44b5d3abc7b8180d2479c39faadf507693401d (diff) | |
| download | bcm5719-llvm-a99c46cc73a70b57972c07562072ec5aeb6d8f4c.tar.gz bcm5719-llvm-a99c46cc73a70b57972c07562072ec5aeb6d8f4c.zip  | |
[LV] Remove wrong assumption about LCSSA
The LCSSA pass itself will not generate several redundant PHI nodes in a single
exit block. However, such redundant PHI nodes don't violate LCSSA form, and may
be introduced by passes that preserve LCSSA, and/or preserved by the LCSSA pass
itself. So, assuming a single PHI node per exit block is not safe.
llvm-svn: 275217
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/iv_outside_user.ll | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll index 4e345f3517b..d536d1023f4 100644 --- a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll +++ b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll @@ -108,3 +108,28 @@ for.body:  for.end:    ret i32* %inc.lag1  } + +; CHECK-LABEL: @multiphi +; CHECK-LABEL: scalar.ph: +; CHECK: %bc.resume.val = phi i32 [ %n.vec, %middle.block ], [ 0, %entry ] +; CHECK-LABEL: for.end: +; CHECK: %phi = phi i32 [ {{.*}}, %for.body ], [ %n.vec, %middle.block ] +; CHECK: %phi2 = phi i32 [ {{.*}}, %for.body ], [ %n.vec, %middle.block ] +; CHECK: store i32 %phi2, i32* %p +; CHECK: ret i32 %phi +define i32 @multiphi(i32 %k, i32* %p)  { +entry: +  br label %for.body + +for.body: +  %inc.phi = phi i32 [ 0, %entry ], [ %inc, %for.body ] +  %inc = add nsw i32 %inc.phi, 1 +  %cmp = icmp eq i32 %inc, %k +  br i1 %cmp, label %for.end, label %for.body + +for.end: +  %phi = phi i32 [ %inc, %for.body ] +  %phi2 = phi i32 [ %inc, %for.body ] +  store i32 %phi2, i32* %p +  ret i32 %phi +}  | 

