Skip to content

Commit 14901a7

Browse files
committed
Fix format, assert and add codegen test for uncalled local functions
1 parent 04b0856 commit 14901a7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ bool AMDGPUResourceUsageAnalysis::runOnModule(Module &M) {
155155
// machinefunction equivalent. These may not exist as the (codegen) passes
156156
// prior to this one are run in CGSCC order which will bypass any local
157157
// functions that aren't called.
158-
assert((MF || !TPC->requiresCodeGenSCCOrder()) &&
159-
"function must have been generated already");
158+
assert((MF || TPC->requiresCodeGenSCCOrder()) &&
159+
"function must have been generated already");
160160
if (MF) {
161161
Info = analyzeResourceUsage(*MF, TM);
162162
HasIndirectCall |= Info.HasIndirectCall;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: llc -O0 -march=amdgcn < %s | FileCheck %s
2+
3+
; CHECK-NOT: foo
4+
define internal i32 @foo() {
5+
ret i32 0
6+
}
7+
8+
; CHECK-NOT: bar
9+
define private i32 @bar() {
10+
ret i32 0
11+
}

0 commit comments

Comments
 (0)