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)
commitcfbdba2d0b1d4bfe3c3dee815b502740e99a0a39
treec3fab03e8a01d474248dabc4b5016b46163f3631
parentf2bbd9cf54e624c54411440dbedd7a4888aa4cb1
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
llvm-svn: 240824
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.h
llvm/test/CodeGen/AMDGPU/commute-shifts.ll [new file with mode: 0644]