[llvm] r175356 - R600/SI: Add pattern to simplify i64 loading

Christian Konig christian.koenig at amd.com
Sat Feb 16 03:28:36 PST 2013


Author: ckoenig
Date: Sat Feb 16 05:28:36 2013
New Revision: 175356

URL: http://llvm.org/viewvc/llvm-project?rev=175356&view=rev
Log:
R600/SI: Add pattern to simplify i64 loading

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

Modified:
    llvm/trunk/lib/Target/R600/SIInstrInfo.td
    llvm/trunk/lib/Target/R600/SIInstructions.td

Modified: llvm/trunk/lib/Target/R600/SIInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstrInfo.td?rev=175356&r1=175355&r2=175356&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.td Sat Feb 16 05:28:36 2013
@@ -40,6 +40,10 @@ def IMM12bit : ImmLeaf <
   [{return isUInt<12>(Imm);}]
 >;
 
+class InlineImm <ValueType vt> : ImmLeaf <vt, [{
+  return -16 <= Imm && Imm <= 64;
+}]>;
+
 class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
     AMDGPUInst<outs, ins, asm, pattern> {
 

Modified: llvm/trunk/lib/Target/R600/SIInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstructions.td?rev=175356&r1=175355&r2=175356&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstructions.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstructions.td Sat Feb 16 05:28:36 2013
@@ -1292,6 +1292,11 @@ def : Pat <
   (S_MOV_B32 fpimm:$imm)
 >;
 
+def : Pat <
+  (i64 InlineImm<i64>:$imm),
+  (S_MOV_B64 InlineImm<i64>:$imm)
+>;
+
 // i64 immediates aren't supported in hardware, split it into two 32bit values
 def : Pat <
   (i64 imm:$imm),





More information about the llvm-commits mailing list