diff options
author | Dan Gohman <gohman@apple.com> | 2012-04-27 17:50:22 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2012-04-27 17:50:22 +0000 |
commit | 03e091f0b5f43beee12170efc00bbab86ffeb0dc (patch) | |
tree | 97aeaf6db27484a1e58a35584582d14a6ac89f71 /test/Transforms | |
parent | 04a09a461beb4ec629fe53e601b7665547ac35c3 (diff) | |
download | llvm-03e091f0b5f43beee12170efc00bbab86ffeb0dc.tar.gz llvm-03e091f0b5f43beee12170efc00bbab86ffeb0dc.tar.bz2 llvm-03e091f0b5f43beee12170efc00bbab86ffeb0dc.tar.xz |
Reapply r155682, making constant folding more consistent, with a fix to work
properly with how the code handles all-undef PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/phi.ll | 10 | ||||
-rw-r--r-- | test/Transforms/SCCP/vector-bitcast.ll | 20 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 219545c2ea..1c307d430f 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -620,3 +620,13 @@ end: ; CHECK-NOT: phi i32 ; CHECK: ret i1 %z } + +; CHECK: @test27( +; CHECK: ret i32 undef +define i32 @test27(i1 %b) { +entry: + br label %done +done: + %y = phi i32 [ undef, %entry ] + ret i32 %y +} diff --git a/test/Transforms/SCCP/vector-bitcast.ll b/test/Transforms/SCCP/vector-bitcast.ll new file mode 100644 index 0000000000..b032085083 --- /dev/null +++ b/test/Transforms/SCCP/vector-bitcast.ll @@ -0,0 +1,20 @@ +; RUN: opt -sccp -S < %s | FileCheck %s + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128" + +; CHECK: store volatile <2 x i64> zeroinitializer, <2 x i64>* %p +; rdar://11324230 + +define void @foo(<2 x i64>* %p) nounwind { +entry: + br label %while.body.i + +while.body.i: ; preds = %while.body.i, %entry + %vWorkExponent.i.033 = phi <4 x i32> [ %sub.i.i, %while.body.i ], [ <i32 939524096, i32 939524096, i32 939524096, i32 939524096>, %entry ] + %sub.i.i = add <4 x i32> %vWorkExponent.i.033, <i32 -8388608, i32 -8388608, i32 -8388608, i32 -8388608> + %0 = bitcast <4 x i32> %sub.i.i to <2 x i64> + %and.i119.i = and <2 x i64> %0, zeroinitializer + store volatile <2 x i64> %and.i119.i, <2 x i64>* %p + br label %while.body.i +} + |