]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
Splats can contain undef's; make sure to handle them correctly. PR11526.
authorEli Friedman <eli.friedman@gmail.com>
Fri, 9 Dec 2011 23:54:42 +0000 (23:54 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 9 Dec 2011 23:54:42 +0000 (23:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146299 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/vmov.ll

index f09a1c7e4f7de9d82640377692a838a50c383a12..2045073fb6cdd5f87ade943d8cd19c9fe9990f41 100644 (file)
@@ -3984,8 +3984,7 @@ SDValue ARMTargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
 
       // Use vmov.f32 to materialize other v2f32 and v4f32 splats.
       if (VT == MVT::v2f32 || VT == MVT::v4f32) {
-        ConstantFPSDNode *C = cast<ConstantFPSDNode>(Op.getOperand(0));
-        int ImmVal = ARM_AM::getFP32Imm(C->getValueAPF());
+        int ImmVal = ARM_AM::getFP32Imm(SplatBits);
         if (ImmVal != -1) {
           SDValue Val = DAG.getTargetConstant(ImmVal, MVT::i32);
           return DAG.getNode(ARMISD::VMOVFPIMM, dl, VT, Val);
index 0396a41a35e23641d1d342c68167968d27ab3822..be95657915c69a8a9befdb68793d6ddb68135f03 100644 (file)
@@ -371,3 +371,13 @@ entry:
   store <4 x float> <float 3.100000e+01, float 3.100000e+01, float 3.100000e+01, float 3.100000e+01>, <4 x float>* %p, align 4
   ret void
 }
+
+define void @v_mov_v4f32_undef(<4 x float> * nocapture %p) nounwind {
+entry:
+;CHECK: v_mov_v4f32_undef:
+;CHECK: vmov.f32 q{{.*}}, #1.000000e+00
+  %a = load <4 x float> *%p
+  %b = fadd <4 x float> %a, <float undef, float 1.0, float 1.0, float 1.0>
+  store <4 x float> %b, <4 x float> *%p
+  ret void
+}