diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-11 19:37:55 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-11 19:37:55 +0000 |
commit | d2f27ead2d71afeee869cad8ae8a1c1dce7229cb (patch) | |
tree | 18e11bf523e403041aeaf6df2b7ff0a83e151121 /test | |
parent | 5a4552ca4256461f402f9d7d2511e77c79316907 (diff) | |
download | external_llvm-d2f27ead2d71afeee869cad8ae8a1c1dce7229cb.zip external_llvm-d2f27ead2d71afeee869cad8ae8a1c1dce7229cb.tar.gz external_llvm-d2f27ead2d71afeee869cad8ae8a1c1dce7229cb.tar.bz2 |
Fix 9173.
Add more folding patterns to constant expressions of vector selects and vector
bitcasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/bitcast-vec-uniform.ll | 14 | ||||
-rw-r--r-- | test/Transforms/InstCombine/fold-vector-select.ll | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/bitcast-vec-uniform.ll b/test/Transforms/InstCombine/bitcast-vec-uniform.ll new file mode 100644 index 0000000..1fba163 --- /dev/null +++ b/test/Transforms/InstCombine/bitcast-vec-uniform.ll @@ -0,0 +1,14 @@ +; RUN: opt < %s -instcombine -S | not grep bitcast + +define <4 x i32> @a(<1 x i64> %y) { + %c = bitcast <2 x i64> <i64 0, i64 0> to <4 x i32> + ret <4 x i32> %c +} + +define <4 x i32> @b(<1 x i64> %y) { + %c = bitcast <2 x i64> <i64 -1, i64 -1> to <4 x i32> + ret <4 x i32> %c +} + + + diff --git a/test/Transforms/InstCombine/fold-vector-select.ll b/test/Transforms/InstCombine/fold-vector-select.ll new file mode 100644 index 0000000..3f22522 --- /dev/null +++ b/test/Transforms/InstCombine/fold-vector-select.ll @@ -0,0 +1,13 @@ +; RUN: opt < %s -instcombine -S | not grep select + +define void @foo(<4 x i32> *%A, <4 x i32> *%B, <4 x i32> *%C, <4 x i32> *%D) { + %r = select <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32> zeroinitializer + %g = select <4 x i1> <i1 false, i1 false, i1 false, i1 false>, <4 x i32> zeroinitializer, <4 x i32> <i32 3, i32 6, i32 9, i32 1> + %b = select <4 x i1> <i1 false, i1 true, i1 false, i1 true>, <4 x i32> zeroinitializer, <4 x i32> <i32 7, i32 1, i32 4, i32 9> + %a = select <4 x i1> zeroinitializer, <4 x i32> zeroinitializer, <4 x i32> <i32 3, i32 2, i32 8, i32 5> + store <4 x i32> %r, <4 x i32>* %A + store <4 x i32> %g, <4 x i32>* %B + store <4 x i32> %b, <4 x i32>* %C + store <4 x i32> %a, <4 x i32>* %D + ret void +} |