Skip to content

Commit aeea056

Browse files
AMDGPU/GlobalISel: Report RegBankLegalize errors using reportGISelFailure (#169918)
Use standard GlobalISel error reporting with reportGISelFailure and pass returning false instead of llvm_unreachable. Also enables -global-isel-abort=0 or 2 for -global-isel -new-reg-bank-select. Note: new-reg-bank-select with abort 0 or 2 runs LCSSA, while "intended use" without abort or with abort 1 does not run LCSSA.
1 parent ec6091f commit aeea056

File tree

5 files changed

+175
-100
lines changed

5 files changed

+175
-100
lines changed

llvm/lib/Target/AMDGPU/AMDGPURegBankLegalize.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ bool AMDGPURegBankLegalize::runOnMachineFunction(MachineFunction &MF) {
435435
unsigned Opc = MI->getOpcode();
436436
// Insert point for use operands needs some calculation.
437437
if (Opc == AMDGPU::G_PHI) {
438-
RBLHelper.applyMappingPHI(*MI);
438+
if (!RBLHelper.applyMappingPHI(*MI))
439+
return false;
439440
continue;
440441
}
441442

@@ -466,7 +467,8 @@ bool AMDGPURegBankLegalize::runOnMachineFunction(MachineFunction &MF) {
466467
// S1 rules are in RegBankLegalizeRules.
467468
}
468469

469-
RBLHelper.findRuleAndApplyMapping(*MI);
470+
if (!RBLHelper.findRuleAndApplyMapping(*MI))
471+
return false;
470472
}
471473

472474
// Sgpr S1 clean up combines:

0 commit comments

Comments
 (0)