diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-01 21:38:46 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-01 21:38:46 +0000 |
commit | 83348f80b6ef08aa3dd3d910d6cf6c920622ffbe (patch) | |
tree | 651446bed2b4193446075d2ff458f5fa7e6733c4 /llvm/test | |
parent | 4aef67c99da6ab6f21042d56ff80dc846087bb71 (diff) | |
download | bcm5719-llvm-83348f80b6ef08aa3dd3d910d6cf6c920622ffbe.tar.gz bcm5719-llvm-83348f80b6ef08aa3dd3d910d6cf6c920622ffbe.zip |
Fix an instcombine abort on a scalar-to-vector bitcast. This fixes PR4487.
llvm-svn: 74646
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll b/llvm/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll new file mode 100644 index 00000000000..8695d1edbc1 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0} +; PR4487 + +; Bitcasts between vectors and scalars are valid, despite being ill-advised. + +define i32 @test(i64 %a) { +bb20: + %t1 = bitcast i64 %a to <2 x i32> + %t2 = bitcast i64 %a to <2 x i32> + %t3 = xor <2 x i32> %t1, %t2 + %t4 = extractelement <2 x i32> %t3, i32 0 + ret i32 %t4 +} + |