This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] SIFoldOperands: clean up tryConstantFoldOp
ClosedPublic

Authored by foad on Apr 7 2021, 5:57 AM.

Details

Summary

First clean up the strange API of tryConstantFoldOp where it took an
immediate operand value, but no indication of which operand it was the
value for.

Second clean up the loop that calls tryConstantFoldOp so that it does
not have to restart from the beginning every time it folds an
instruction.

This is NFCI but there are some minor changes caused by the order in
which things are folded.

Diff Detail

Event Timeline

foad created this revision.Apr 7 2021, 5:57 AM
foad requested review of this revision.Apr 7 2021, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2021, 5:57 AM
arsenm accepted this revision.Apr 7 2021, 5:58 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
1212

The '\n' is redundant since MI print includes it already

This revision is now accepted and ready to land.Apr 7 2021, 5:58 AM
foad updated this revision to Diff 335793.Apr 7 2021, 6:16 AM

The '\n' is redundant since MI print includes it already

Fixed upstream and rebased.

This revision was landed with ongoing or failed builds.May 6 2021, 2:29 AM
This revision was automatically updated to reflect the committed changes.