[llvm] r178022 - R600/SI: avoid unecessary subreg extraction in IMAGE_SAMPLE
Christian Konig
christian.koenig at amd.com
Tue Mar 26 07:04:08 PDT 2013
Author: ckoenig
Date: Tue Mar 26 09:04:07 2013
New Revision: 178022
URL: http://llvm.org/viewvc/llvm-project?rev=178022&view=rev
Log:
R600/SI: avoid unecessary subreg extraction in IMAGE_SAMPLE
Just define the address as unknown instead of VReg_32.
Signed-off-by: Christian König <christian.koenig 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=178022&r1=178021&r2=178022&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstrInfo.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstrInfo.td Tue Mar 26 09:04:07 2013
@@ -305,7 +305,7 @@ class MIMG_Load_Helper <bits<7> op, stri
op,
(outs VReg_128:$vdata),
(ins i32imm:$dmask, i1imm:$unorm, i1imm:$glc, i1imm:$da, i1imm:$r128,
- i1imm:$tfe, i1imm:$lwe, i1imm:$slc, VReg_32:$vaddr,
+ i1imm:$tfe, i1imm:$lwe, i1imm:$slc, unknown:$vaddr,
SReg_256:$srsrc, SReg_128:$ssamp),
asm#" $vdata, $dmask, $unorm, $glc, $da, $r128,"
#" $tfe, $lwe, $slc, $vaddr, $srsrc, $ssamp",
Modified: llvm/trunk/lib/Target/R600/SIInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstructions.td?rev=178022&r1=178021&r2=178022&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstructions.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstructions.td Tue Mar 26 09:04:07 2013
@@ -1195,10 +1195,9 @@ def : Pat <
/* int_SI_sample for simple 1D texture lookup */
def : Pat <
- (int_SI_sample imm:$writemask, (v1i32 VReg_32:$addr),
+ (int_SI_sample imm:$writemask, VReg_32:$addr,
SReg_256:$rsrc, SReg_128:$sampler, imm),
- (IMAGE_SAMPLE imm:$writemask, 0, 0, 0, 0, 0, 0, 0,
- (i32 (COPY_TO_REGCLASS VReg_32:$addr, VReg_32)),
+ (IMAGE_SAMPLE imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_32:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
@@ -1206,8 +1205,7 @@ class SamplePattern<Intrinsic name, MIMG
ValueType addr_type> : Pat <
(name imm:$writemask, (addr_type addr_class:$addr),
SReg_256:$rsrc, SReg_128:$sampler, imm),
- (opcode imm:$writemask, 0, 0, 0, 0, 0, 0, 0,
- (EXTRACT_SUBREG addr_class:$addr, sub0),
+ (opcode imm:$writemask, 0, 0, 0, 0, 0, 0, 0, addr_class:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
@@ -1215,8 +1213,7 @@ class SampleRectPattern<Intrinsic name,
ValueType addr_type> : Pat <
(name imm:$writemask, (addr_type addr_class:$addr),
SReg_256:$rsrc, SReg_128:$sampler, TEX_RECT),
- (opcode imm:$writemask, 1, 0, 0, 0, 0, 0, 0,
- (EXTRACT_SUBREG addr_class:$addr, sub0),
+ (opcode imm:$writemask, 1, 0, 0, 0, 0, 0, 0, addr_class:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
@@ -1224,8 +1221,7 @@ class SampleArrayPattern<Intrinsic name,
ValueType addr_type> : Pat <
(name imm:$writemask, (addr_type addr_class:$addr),
SReg_256:$rsrc, SReg_128:$sampler, TEX_ARRAY),
- (opcode imm:$writemask, 0, 0, 1, 0, 0, 0, 0,
- (EXTRACT_SUBREG addr_class:$addr, sub0),
+ (opcode imm:$writemask, 0, 0, 1, 0, 0, 0, 0, addr_class:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
@@ -1233,8 +1229,7 @@ class SampleShadowPattern<Intrinsic name
RegisterClass addr_class, ValueType addr_type> : Pat <
(name imm:$writemask, (addr_type addr_class:$addr),
SReg_256:$rsrc, SReg_128:$sampler, TEX_SHADOW),
- (opcode imm:$writemask, 0, 0, 0, 0, 0, 0, 0,
- (EXTRACT_SUBREG addr_class:$addr, sub0),
+ (opcode imm:$writemask, 0, 0, 0, 0, 0, 0, 0, addr_class:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
@@ -1242,8 +1237,7 @@ class SampleShadowArrayPattern<Intrinsic
RegisterClass addr_class, ValueType addr_type> : Pat <
(name imm:$writemask, (addr_type addr_class:$addr),
SReg_256:$rsrc, SReg_128:$sampler, TEX_SHADOW_ARRAY),
- (opcode imm:$writemask, 0, 0, 1, 0, 0, 0, 0,
- (EXTRACT_SUBREG addr_class:$addr, sub0),
+ (opcode imm:$writemask, 0, 0, 1, 0, 0, 0, 0, addr_class:$addr,
SReg_256:$rsrc, SReg_128:$sampler)
>;
More information about the llvm-commits
mailing list