This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix deleting of move-immediate instructions after folding
ClosedPublic

Authored by foad on Mar 2 2022, 7:23 AM.

Details

Summary

SIInstrInfo::FoldImmediate tried to delete move-immediate instructions
after folding them into their only use. This did not work because it was
checking hasOneNonDBGUse after doing the fold, at which point there
should be no uses. This seems to have no effect on codegen, it just
means less stuff for DCE to clean up later.

Diff Detail

Event Timeline

foad created this revision.Mar 2 2022, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 7:23 AM
foad requested review of this revision.Mar 2 2022, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 7:23 AM
arsenm accepted this revision.Mar 2 2022, 7:47 AM

Can we maybe drop one of the extra runs of machine dce?

This revision is now accepted and ready to land.Mar 2 2022, 7:47 AM
foad added a comment.Mar 2 2022, 8:00 AM

Can we maybe drop one of the extra runs of machine dce?

Machine DCE is run right after Peephole Optimizer, but that's done in generic code (TargetPassConfig::addMachineSSAOptimization). I don't see how this would affect any of the other runs of Machine DCE, that are added by the AMDGPU backend.

This revision was landed with ongoing or failed builds.Mar 2 2022, 8:11 AM
This revision was automatically updated to reflect the committed changes.