AMDGPU: Fix incorrect commute with sub when folding immediates
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 3 May 2019 13:42:56 +0000 (13:42 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 3 May 2019 13:42:56 +0000 (13:42 +0000)
commit2c8936fd264239db1438358fc01c83412aa161ed
tree73b1456d7a147dae1b8fa36c20f8dbc2484c4e72
parent2636460f0e1cb582f3793775efbffdc02bf55d23
AMDGPU: Fix incorrect commute with sub when folding immediates

When a fold of an immediate into a sub/subrev required shrinking the
instruction, the wrong VOP2 opcode was used. This was using the VOP2
equivalent of the original instruction, not the commuted instruction
with the inverted opcode.

llvm-svn: 359883
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/test/CodeGen/AMDGPU/fold-immediate-operand-shrink.mir