Skip to content

Commit bdb5e4e

Browse files
committed
[GlobalISel] Fix a crash when handling an invalid MVT during call lowering.
This crash was introduced in r358032 as we try to construct an EVT from an MVT in order to find the register type for the calling conv. Fall back instead of trying to do this with an invalid MVT coming from i256. llvm-svn: 358314
1 parent f9f073a commit bdb5e4e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bool CallLowering::handleAssignments(MachineIRBuilder &MIRBuilder,
125125
MVT CurVT = MVT::getVT(Args[i].Ty);
126126
if (Handler.assignArg(i, CurVT, CurVT, CCValAssign::Full, Args[i], CCInfo)) {
127127
// Try to use the register type if we couldn't assign the VT.
128-
if (!Handler.isArgumentHandler())
128+
if (!Handler.isArgumentHandler() || !CurVT.isValid())
129129
return false;
130130
CurVT = TLI->getRegisterTypeForCallingConv(
131131
F.getContext(), F.getCallingConv(), EVT(CurVT));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; RUN: llc -mtriple=aarch64-linux-gnu -O0 -verify-machineinstrs -o - %s | FileCheck %s
2+
3+
define i1 @test_crash_i256(i256 %int) {
4+
; CHECK-LABEL: test_crash_i256
5+
; CHECK: ret
6+
ret i1 true
7+
}

0 commit comments

Comments
 (0)