R600: Match 24-bit arithmetic patterns in a Target DAGCombine
authorTom Stellard <thomas.stellard@amd.com>
Mon, 7 Apr 2014 19:45:41 +0000 (19:45 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 7 Apr 2014 19:45:41 +0000 (19:45 +0000)
commit5c9bb7119a54f71b8b04e113c3e357e35bf065d8
tree4b3b90b5e290b08da886c46fb8ec65b020122a07
parentdd2d4303527c4be7d5a050f1cc11831e76114181
R600: Match 24-bit arithmetic patterns in a Target DAGCombine

Moving these patterns from TableGen files to PerformDAGCombine()
should allow us to generate better code by eliminating unnecessary
shifts and extensions earlier.

This also fixes a bug where the MAD pattern was calling
SimplifyDemandedBits with a 24-bit mask on the first operand
even when the full pattern wasn't being matched.  This occasionally
resulted in some instructions being incorrectly deleted from the
program.

v2:
  - Fix bug with 64-bit mul

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205731 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
lib/Target/R600/AMDGPUISelLowering.cpp
lib/Target/R600/AMDGPUISelLowering.h
lib/Target/R600/AMDGPUInstrInfo.td
lib/Target/R600/AMDGPUInstructions.td
lib/Target/R600/AMDGPUSubtarget.h
lib/Target/R600/CaymanInstructions.td
lib/Target/R600/EvergreenInstructions.td
lib/Target/R600/R600ISelLowering.cpp
lib/Target/R600/SIISelLowering.cpp
lib/Target/R600/SIInstructions.td
test/CodeGen/R600/mad_int24.ll
test/CodeGen/R600/mad_uint24.ll
test/CodeGen/R600/mul_int24.ll
test/CodeGen/R600/mul_uint24-i64.ll [new file with mode: 0644]
test/CodeGen/R600/mul_uint24.ll