diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-03-28 01:28:02 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-03-28 01:28:02 +0000 |
commit | d7216a28d6a07a4ea4047a14427c16b96feeb36f (patch) | |
tree | 704b6861c2637504cae526758c12836c01c0e468 /test/Transforms/InstCombine | |
parent | 1fd36e41e408307a4e7362cc9cd83aeb77ee71dd (diff) |
Check if Type is a vector before calling function Type::getVectorNumElements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178208 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/vector-type.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vector-type.ll b/test/Transforms/InstCombine/vector-type.ll new file mode 100644 index 0000000000..28b3441f45 --- /dev/null +++ b/test/Transforms/InstCombine/vector-type.ll @@ -0,0 +1,15 @@ +; The code in InstCombiner::FoldSelectOpOp was calling +; Type::getVectorNumElements without checking first if the type was a vector. + +; RUN: opt < %s -instcombine -S -O3 + +define i32 @vselect1(i32 %a.coerce, i32 %b.coerce, i32 %c.coerce) { +entry: + %0 = bitcast i32 %a.coerce to <2 x i16> + %1 = bitcast i32 %b.coerce to <2 x i16> + %2 = bitcast i32 %c.coerce to <2 x i16> + %cmp = icmp sge <2 x i16> %2, zeroinitializer + %or = select <2 x i1> %cmp, <2 x i16> %0, <2 x i16> %1 + %3 = bitcast <2 x i16> %or to i32 + ret i32 %3 +} |