summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CallLowering.cpp2
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-i256-crash.ll7
2 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 47fdeedaeb4..b6b1bef2600 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -125,7 +125,7 @@ bool CallLowering::handleAssignments(MachineIRBuilder &MIRBuilder,
MVT CurVT = MVT::getVT(Args[i].Ty);
if (Handler.assignArg(i, CurVT, CurVT, CCValAssign::Full, Args[i], CCInfo)) {
// Try to use the register type if we couldn't assign the VT.
- if (!Handler.isArgumentHandler())
+ if (!Handler.isArgumentHandler() || !CurVT.isValid())
return false;
CurVT = TLI->getRegisterTypeForCallingConv(
F.getContext(), F.getCallingConv(), EVT(CurVT));
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-i256-crash.ll b/llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-i256-crash.ll
new file mode 100644
index 00000000000..2ebd7a78e51
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/call-lowering-i256-crash.ll
@@ -0,0 +1,7 @@
+; RUN: llc -mtriple=aarch64-linux-gnu -O0 -verify-machineinstrs -o - %s | FileCheck %s
+
+define i1 @test_crash_i256(i256 %int) {
+; CHECK-LABEL: test_crash_i256
+; CHECK: ret
+ ret i1 true
+}
OpenPOWER on IntegriCloud