AMDGPU: really don't commute REV opcodes if the target variant doesn't exist
authorMarek Olsak <marek.olsak@amd.com>
Fri, 26 Jun 2015 20:29:10 +0000 (20:29 +0000)
committerMarek Olsak <marek.olsak@amd.com>
Fri, 26 Jun 2015 20:29:10 +0000 (20:29 +0000)
commite874345be4f5f26e063f0085c1fdde1f75009f53
tree54c23de7250b450938284fa2d9398bd4ab687235
parent78c5b7fe3c4439367159ca0ad6045103ffe15a05
AMDGPU: really don't commute REV opcodes if the target variant doesn't exist

If pseudoToMCOpcode failed, we would return the original opcode, so operands
would be swapped, but the instruction would remain the same.
It resulted in LSHLREV a, b ---> LSHLREV b, a.

This fixes Glamor text rendering and
piglit/arb_sample_shading-builtin-gl-sample-mask on VI.

This is a candidate for stable branches.

v2: the test was simplified by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240824 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.h
test/CodeGen/AMDGPU/commute-shifts.ll [new file with mode: 0644]