summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/bc-extract.ll
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2010-11-19 19:08:12 +0000
committerMon P Wang <wangmp@apple.com>2010-11-19 19:08:12 +0000
commitcab98e3168558a40675a06bc830eb87b8e40070e (patch)
treeb0a9820c8c15ed1ac1de6cdf0fb524e3b8a28aa7 /test/CodeGen/X86/bc-extract.ll
parent805f105da0e15c3c63c5d5e9df0140d3421b4a55 (diff)
downloadllvm-cab98e3168558a40675a06bc830eb87b8e40070e.tar.gz
llvm-cab98e3168558a40675a06bc830eb87b8e40070e.tar.bz2
llvm-cab98e3168558a40675a06bc830eb87b8e40070e.tar.xz
Make isScalarToVector to return false if the node is a scalar. This will prevent
DAGCombine from making an illegal transformation of bitcast of a scalar to a vector into a scalar_to_vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/bc-extract.ll')
-rw-r--r--test/CodeGen/X86/bc-extract.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/X86/bc-extract.ll b/test/CodeGen/X86/bc-extract.ll
new file mode 100644
index 0000000000..6e8063ad7c
--- /dev/null
+++ b/test/CodeGen/X86/bc-extract.ll
@@ -0,0 +1,27 @@
+; RUN: llc < %s -march=x86-64 -mattr=+sse42 -disable-mmx | FileCheck %s
+
+
+define float @extractFloat1() nounwind {
+entry:
+ ; CHECK: 1065353216
+ %tmp0 = bitcast <1 x double> <double 0x000000003F800000> to <2 x float>
+ %tmp1 = extractelement <2 x float> %tmp0, i32 0
+ ret float %tmp1
+}
+
+define float @extractFloat2() nounwind {
+entry:
+ ; CHECK: pxor %xmm0, %xmm0
+ %tmp4 = bitcast <1 x double> <double 0x000000003F800000> to <2 x float>
+ %tmp5 = extractelement <2 x float> %tmp4, i32 1
+ ret float %tmp5
+}
+
+define i32 @extractInt2() nounwind {
+entry:
+ ; CHECK: xorl %eax, %eax
+ %tmp4 = bitcast <1 x i64> <i64 256> to <2 x i32>
+ %tmp5 = extractelement <2 x i32> %tmp4, i32 1
+ ret i32 %tmp5
+}
+