This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Remove set_gpr_idx instructions in conditional blocks
ClosedPublic

Authored by foad on Apr 30 2021, 7:09 AM.

Details

Summary

SIPreEmitPeephole did not try to remove redundant s_set_gpr_idx_*
instructions in blocks that end with a conditional branch instruction.
This seems like a simple oversight.

Diff Detail

Event Timeline

foad created this revision.Apr 30 2021, 7:09 AM
foad requested review of this revision.Apr 30 2021, 7:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2021, 7:09 AM
dstuttard added inline comments.Apr 30 2021, 7:22 AM
llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
361

Doesn't the compiler warn about no default / missing enums?

foad added inline comments.Apr 30 2021, 7:29 AM
llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
361

MI.getOpcode() returns unsigned, so it's not an enum, so no.

dstuttard accepted this revision.Apr 30 2021, 8:10 AM

Well, LGTM - but you might want to get approval from the other reviewers.

This revision is now accepted and ready to land.Apr 30 2021, 8:10 AM
rampitec accepted this revision.Apr 30 2021, 11:31 AM

LGTM

llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp
379

Wow, good to know this exists!