radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern

In tablegen, if two patterns match, the one that comes first in the file
is given preference.  We want the SMRD IMM pattern to be given
preference, because it encodes the pointer offset in its immediate
field, which saves us an add instruction.
This commit is contained in:
Tom Stellard 2012-07-31 16:42:15 +00:00
parent 877a897adc
commit 056b77ca22
1 changed files with 7 additions and 8 deletions

View File

@ -475,6 +475,13 @@ class MTBUF_Store_Helper <bits<3> op, string asm, RegisterClass regClass> : MTBU
multiclass SMRD_Helper <bits<5> op, string asm, RegisterClass dstClass,
ValueType vt> {
def _IMM : SMRD <
op,
(outs dstClass:$dst),
(ins SMRDmemri:$src0),
asm,
[(set (vt dstClass:$dst), (constant_load ADDR_Offset8:$src0))]
>;
def _SGPR : SMRD <
op,
@ -483,14 +490,6 @@ multiclass SMRD_Helper <bits<5> op, string asm, RegisterClass dstClass,
asm,
[(set (vt dstClass:$dst), (constant_load ADDR_Reg:$src0))]
>;
def _IMM : SMRD <
op,
(outs dstClass:$dst),
(ins SMRDmemri:$src0),
asm,
[(set (vt dstClass:$dst), (constant_load ADDR_Offset8:$src0))]
>;
}
multiclass SMRD_32 <bits<5> op, string asm, RegisterClass dstClass> {