AMDGPU: Simplify VOP3 operand legalization.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 21:51:02 +0000 (21:51 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 21:51:02 +0000 (21:51 +0000)
commit110f55db52504a8efacfe05ee3111b53e65ce252
treea9fce95f7eea401b0cc6c57ae300ede2107a77e3
parent19b672882f5c1c8efe59ffe68235f59caa27c7e6
AMDGPU: Simplify VOP3 operand legalization.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250951 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.h