[llvm] r205423 - ARM64: make sure first argument to INSERT_SUBVECTOR has right type.

Tim Northover tnorthover at apple.com
Wed Apr 2 07:38:59 PDT 2014


Author: tnorthover
Date: Wed Apr  2 09:38:58 2014
New Revision: 205423

URL: http://llvm.org/viewvc/llvm-project?rev=205423&view=rev
Log:
ARM64: make sure first argument to INSERT_SUBVECTOR has right type.

Again, coalescing and other optimisations swiftly made the MachineInstrs
consistent again, but when compiled at -O0 a bad INSERT_SUBREGISTER was
produced.

Modified:
    llvm/trunk/lib/Target/ARM64/ARM64ISelLowering.cpp
    llvm/trunk/test/CodeGen/ARM64/simd-scalar-to-vector.ll

Modified: llvm/trunk/lib/Target/ARM64/ARM64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64ISelLowering.cpp?rev=205423&r1=205422&r2=205423&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64ISelLowering.cpp Wed Apr  2 09:38:58 2014
@@ -5615,7 +5615,7 @@ SDValue ARM64TargetLowering::LowerSCALAR
   }
   MachineSDNode *N =
       DAG.getMachineNode(TargetOpcode::INSERT_SUBREG, SDLoc(Op),
-                         Op.getValueType(), DAG.getUNDEF(Op0.getValueType()),
+                         Op.getValueType(), DAG.getUNDEF(Op.getValueType()),
                          Op0, DAG.getTargetConstant(SubIdx, MVT::i32));
   return SDValue(N, 0);
 }

Modified: llvm/trunk/test/CodeGen/ARM64/simd-scalar-to-vector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/simd-scalar-to-vector.ll?rev=205423&r1=205422&r2=205423&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/simd-scalar-to-vector.ll (original)
+++ llvm/trunk/test/CodeGen/ARM64/simd-scalar-to-vector.ll Wed Apr  2 09:38:58 2014
@@ -1,10 +1,15 @@
 ; RUN: llc < %s -march=arm64 -arm64-neon-syntax=apple | FileCheck %s
+; RUN: llc < %s -march=arm64 -arm64-neon-syntax=apple -O0 | FileCheck %s --check-prefix=CHECK-FAST
 
 define <16 x i8> @foo(<16 x i8> %a) nounwind optsize readnone ssp {
-; CHECK: uaddlv.16b	h0, v0
-; CHECK: rshrn.8b	v0, v0, #4
-; CHECK: dup.16b	v0, v0[0]
+; CHECK: uaddlv.16b h0, v0
+; CHECK: rshrn.8b v0, v0, #4
+; CHECK: dup.16b v0, v0[0]
 ; CHECK: ret
+
+; CHECK-FAST: uaddlv.16b
+; CHECK-FAST: rshrn.8b
+; CHECK-FAST: dup.16b
   %tmp = tail call i32 @llvm.arm64.neon.uaddlv.i32.v16i8(<16 x i8> %a) nounwind
   %tmp1 = trunc i32 %tmp to i16
   %tmp2 = insertelement <8 x i16> undef, i16 %tmp1, i32 0





More information about the llvm-commits mailing list