This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Refactor immediate folding logic
ClosedPublic

Authored by arsenm on Nov 20 2016, 1:39 PM.

Details

Reviewers
tstellarAMD
Summary

Change the logic for when to fold immediates to
consider the destination operand rather than the
source of the materializing mov instruction.

No change yet, but this will allow for correctly handling
i16/f16 operands. Since 32-bit moves are used to materialize
constants for these, the same bitvalue will not be in the
register.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 78668.Nov 20 2016, 1:39 PM
arsenm retitled this revision from to AMDGPU: Refactor immediate folding logic.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.

This will help for short term making 16-bit operands correct, but longer term it might be better to look at use instructions and finding the operand defs. Right now there seem to be some mis-optimizations when multiple operands might be able to be folded into the same instruction, and the wrong operand is selected

tstellarAMD accepted this revision.Nov 29 2016, 11:11 AM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 29 2016, 11:11 AM
arsenm closed this revision.Nov 29 2016, 11:31 AM

r288184