Skip to content

Commit 96493c5

Browse files
authored
AMDGPU: Use reportFatalUsageError for regalloc flag error (#145198)
1 parent dec93ae commit 96493c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ static const char RegAllocOptNotSupportedMessage[] =
16361636

16371637
bool GCNPassConfig::addRegAssignAndRewriteFast() {
16381638
if (!usingDefaultRegAlloc())
1639-
report_fatal_error(RegAllocOptNotSupportedMessage);
1639+
reportFatalUsageError(RegAllocOptNotSupportedMessage);
16401640

16411641
addPass(&GCNPreRALongBranchRegID);
16421642

@@ -1662,7 +1662,7 @@ bool GCNPassConfig::addRegAssignAndRewriteFast() {
16621662

16631663
bool GCNPassConfig::addRegAssignAndRewriteOptimized() {
16641664
if (!usingDefaultRegAlloc())
1665-
report_fatal_error(RegAllocOptNotSupportedMessage);
1665+
reportFatalUsageError(RegAllocOptNotSupportedMessage);
16661666

16671667
addPass(&GCNPreRALongBranchRegID);
16681668

llvm/test/CodeGen/AMDGPU/sgpr-regalloc-flags.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
; RUN: llc -verify-machineinstrs=0 -sgpr-regalloc=basic -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=BASIC-DEFAULT %s
1010
; RUN: llc -verify-machineinstrs=0 -sgpr-regalloc=basic -wwm-regalloc=basic -vgpr-regalloc=basic -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=BASIC-BASIC %s
1111

12-
; RUN: not --crash llc -verify-machineinstrs=0 -regalloc=basic -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=REGALLOC %s
13-
; RUN: not --crash llc -verify-machineinstrs=0 -regalloc=fast -O0 -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=REGALLOC %s
12+
; RUN: not llc -verify-machineinstrs=0 -regalloc=basic -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=REGALLOC %s
13+
; RUN: not llc -verify-machineinstrs=0 -regalloc=fast -O0 -mtriple=amdgcn-amd-amdhsa -debug-pass=Structure -o /dev/null %s 2>&1 | FileCheck -check-prefix=REGALLOC %s
1414

1515

1616
; REGALLOC: -regalloc not supported with amdgcn. Use -sgpr-regalloc, -wwm-regalloc, and -vgpr-regalloc

0 commit comments

Comments
 (0)