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@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Christian Konig 2013-03-26 14:04:07 +00:00
parent c53270f885
commit a55e36584a
2 changed files with 8 additions and 14 deletions

View File

@ -305,7 +305,7 @@ class MIMG_Load_Helper <bits<7> op, string asm> : MIMG <
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",

View File

@ -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 opcode, RegisterClass addr_class,
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, MIMG opcode, RegisterClass addr_class,
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, MIMG opcode, RegisterClass addr_class,
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, MIMG opcode,
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 name, MIMG opcode,
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)
>;