[GISel]: Remove an incorrect assert in CallLowering
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Fri, 28 Sep 2018 15:08:49 +0000 (15:08 +0000)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Fri, 28 Sep 2018 15:08:49 +0000 (15:08 +0000)
https://reviews.llvm.org/D51147

Asserting if any extend of vectors should be up to the target's
legalizer/target specific code not in CallLowering.

reviewed by : dsanders.

llvm-svn: 343325

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/test/CodeGen/X86/GlobalISel/calllowering-nocrashret.ll [new file with mode: 0644]

index 07de31b..da972ea 100644 (file)
@@ -164,7 +164,6 @@ unsigned CallLowering::ValueHandler::extendRegister(unsigned ValReg,
     // nop in big-endian situations.
     return ValReg;
   case CCValAssign::AExt: {
-    assert(!VA.getLocVT().isVector() && "unexpected vector extend");
     auto MIB = MIRBuilder.buildAnyExt(LocTy, ValReg);
     return MIB->getOperand(0).getReg();
   }
diff --git a/llvm/test/CodeGen/X86/GlobalISel/calllowering-nocrashret.ll b/llvm/test/CodeGen/X86/GlobalISel/calllowering-nocrashret.ll
new file mode 100644 (file)
index 0000000..5e93115
--- /dev/null
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+; RUN: llc -mtriple=x86_64-linux-gnu -o - -global-isel %s -stop-after=irtranslator | FileCheck %s
+
+define <4 x i1> @foo() {
+  ; CHECK-LABEL: name: foo
+  ; CHECK: bb.1.entry:
+  ; CHECK:   [[DEF:%[0-9]+]]:_(<4 x s1>) = G_IMPLICIT_DEF
+  ; CHECK:   [[ANYEXT:%[0-9]+]]:_(<4 x s32>) = G_ANYEXT [[DEF]](<4 x s1>)
+  ; CHECK:   $xmm0 = COPY [[ANYEXT]](<4 x s32>)
+  ; CHECK:   RET 0, implicit $xmm0
+entry:
+  ret <4 x i1> undef ;
+}