Expand ZERO_EXTEND operations for NEON vector types.
authorBob Wilson <bob.wilson@apple.com>
Wed, 18 Aug 2010 01:45:52 +0000 (01:45 +0000)
committerBob Wilson <bob.wilson@apple.com>
Wed, 18 Aug 2010 01:45:52 +0000 (01:45 +0000)
Testcase from Nick Lewycky.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111341 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/neon-ops.ll [new file with mode: 0644]

index c2bd471faa11b048e83243c504b826c01b27f3cc..9e9198b726850571ec4947aa660c7abd2584f626 100644 (file)
@@ -125,6 +125,7 @@ void ARMTargetLowering::addTypeForNEON(EVT VT, EVT PromotedLdStVT,
   setOperationAction(ISD::EXTRACT_SUBVECTOR, VT.getSimpleVT(), Expand);
   setOperationAction(ISD::SELECT, VT.getSimpleVT(), Expand);
   setOperationAction(ISD::SELECT_CC, VT.getSimpleVT(), Expand);
+  setOperationAction(ISD::ZERO_EXTEND, VT.getSimpleVT(), Expand);
   if (VT.isInteger()) {
     setOperationAction(ISD::SHL, VT.getSimpleVT(), Custom);
     setOperationAction(ISD::SRA, VT.getSimpleVT(), Custom);
diff --git a/test/CodeGen/ARM/neon-ops.ll b/test/CodeGen/ARM/neon-ops.ll
new file mode 100644 (file)
index 0000000..d7e893f
--- /dev/null
@@ -0,0 +1,7 @@
+; RUN: llc -march=arm -mattr=+neon -O2 -o /dev/null
+
+; This used to crash.
+define <4 x i32> @test1(<4 x i16> %a) {
+  %A = zext <4 x i16> %a to <4 x i32>
+  ret <4 x i32> %A
+}