This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Simplify VOP3 operand legalization.
ClosedPublic

Authored by arsenm on Sep 22 2015, 4:20 PM.

Details

Reviewers
tstellarAMD
Summary

This was checking for a variety of situations that should
never happen. This saves a tiny bit of compile time.

We should not be selecting instructions with invalid operands in the
first place. Most of the time for registers copys are inserted
to the correct operand register class.

For VOP3, since all operand types are supported and literal
constants never are, we just need to verify the constant bus
requirements (all immediates should be legal inline ones).

The only possibly tricky case to maybe worry about is if when
legalizing operands in moveToVALU with s_add_i32 and similar
instructions. If the original s_add_i32 had a literal constant
and we need to replace it with v_add_i32_e64 we would have an
unsupported literal operand. However, I don't think we should worry
about that because SIFoldOperands should handle folding literal
constant operands into the SALU instructions based on the uses.
At SIFoldOperands time, the legality and profitability of
operand types is a bit different.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 35436.Sep 22 2015, 4:20 PM
arsenm retitled this revision from to AMDGPU: Simplify VOP3 operand legalization..
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Oct 20 2015, 1:41 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 20 2015, 1:41 PM
This comment was removed by tstellarAMD.
arsenm closed this revision.Oct 21 2015, 2:53 PM

r250951