diff options
author | Joey Gouly <joey.gouly@arm.com> | 2013-05-24 12:29:54 +0000 |
---|---|---|
committer | Joey Gouly <joey.gouly@arm.com> | 2013-05-24 12:29:54 +0000 |
commit | 4a941316cdcfbc3671c806c9c40df1bad09ba6ad (patch) | |
tree | 5ac3f64e9853eaace017dc109c5871e4dd04e54e /test/Transforms | |
parent | 77226a03dca98e6237c1068f2652fe41bea7b687 (diff) | |
download | external_llvm-4a941316cdcfbc3671c806c9c40df1bad09ba6ad.zip external_llvm-4a941316cdcfbc3671c806c9c40df1bad09ba6ad.tar.gz external_llvm-4a941316cdcfbc3671c806c9c40df1bad09ba6ad.tar.bz2 |
scalarizePHI needs to insert the next ExtractElement in the same block
as the BinaryOperator, *not* in the block where the IRBuilder is currently
inserting into. Fixes a bug where scalarizePHI would create instructions
that would not dominate all uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/vec_phi_extract.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_phi_extract.ll b/test/Transforms/InstCombine/vec_phi_extract.ll index 2f10fc2..73ec1f1 100644 --- a/test/Transforms/InstCombine/vec_phi_extract.ll +++ b/test/Transforms/InstCombine/vec_phi_extract.ll @@ -25,3 +25,28 @@ ret: ret void } +define i1 @g(<3 x i32> %input_2) { +; CHECK: extractelement +entry: + br label %for.cond + +for.cond: +; CHECK: phi i32 + %input_2.addr.0 = phi <3 x i32> [ %input_2, %entry ], [ %div45, %for.body ] + %input_1.addr.1 = phi <3 x i32> [ undef, %entry ], [ %dec43, %for.body ] + br i1 undef, label %for.end, label %for.body + +; CHECK extractelement +for.body: + %dec43 = add <3 x i32> %input_1.addr.1, <i32 -1, i32 -1, i32 -1> + %sub44 = sub <3 x i32> zeroinitializer, %dec43 + %div45 = sdiv <3 x i32> %input_2.addr.0, %sub44 + br label %for.cond + +for.end: + %0 = extractelement <3 x i32> %input_2.addr.0, i32 0 + %.89 = select i1 false, i32 0, i32 %0 + %tobool313 = icmp eq i32 %.89, 0 + ret i1 %tobool313 +} + |