1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[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
This commit is contained in:
Amara Emerson 2019-04-12 22:05:46 +00:00
parent 97d807cd08
commit 5ab716d1cf
2 changed files with 8 additions and 1 deletions

View File

@ -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));

View File

@ -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
}