Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU] Early bail in getFunctionCodeSize for meta inst. NFC. #127129

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/lib/Target/AMDGPU/SIProgramInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ uint64_t SIProgramInfo::getFunctionCodeSize(const MachineFunction &MF) {
for (const MachineInstr &MI : MBB) {
// TODO: CodeSize should account for multiple functions.

// TODO: Should we count size of debug info?
if (MI.isDebugInstr())
if (MI.isMetaInstruction())
continue;

CodeSize += TII->getInstSizeInBytes(MI);
Expand Down
13 changes: 13 additions & 0 deletions llvm/test/CodeGen/AMDGPU/code-size-estimate.mir
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ body: |
$vgpr16 = V_MOV_B32_indirect_read undef $vgpr1, implicit $exec, implicit $m0, implicit $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13_vgpr14_vgpr15
V_MOV_B32_indirect_write undef $vgpr0, undef $vgpr3, implicit $exec, implicit $m0, implicit-def $vgpr0_vgpr1_vgpr2_vgpr3, implicit killed $vgpr0_vgpr1_vgpr2_vgpr3(tied-def 4)
...

# CHECK: meta: ; @meta
# CHECK: ; wave barrier
# CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
# CHECK: ; codeLenInByte = 4
---
name: meta
tracksRegLiveness: true
body: |
bb.0:

WAVE_BARRIER
...