[Mesa-dev] [PATCH] R600/SI: Do not fold single instruction with more that 3 kcache read

Tom Stellard tom at stellard.net
Tue Feb 12 08:33:39 PST 2013


On Tue, Feb 12, 2013 at 05:23:43PM +0100, Vincent Lejeune wrote:
> It fixes around 100 tfb piglit tests and 16 glean tests.
> 
> NOTE: This is a candidate for the Mesa stable branch.

Hi Vincent,

Could you add a lit test for this as well?

Thanks,
Tom

> ---
>  lib/Target/R600/AMDILISelDAGToDAG.cpp  | 2 ++
>  lib/Target/R600/R600LowerConstCopy.cpp | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/Target/R600/AMDILISelDAGToDAG.cpp b/lib/Target/R600/AMDILISelDAGToDAG.cpp
> index 2f34fe3..858eb5d 100644
> --- a/lib/Target/R600/AMDILISelDAGToDAG.cpp
> +++ b/lib/Target/R600/AMDILISelDAGToDAG.cpp
> @@ -358,6 +358,8 @@ bool AMDGPUDAGToDAGISel::FoldOperands(unsigned Opcode,
>      SDValue Operand = Ops[OperandIdx[i] - 1];
>      switch (Operand.getOpcode()) {
>      case AMDGPUISD::CONST_ADDRESS: {
> +      if (i == 2)
> +        break;
>        SDValue CstOffset;
>        if (!Operand.getValueType().isVector() &&
>            SelectGlobalValueConstantOffset(Operand.getOperand(0), CstOffset)) {
> diff --git a/lib/Target/R600/R600LowerConstCopy.cpp b/lib/Target/R600/R600LowerConstCopy.cpp
> index 2557e8f..c8c27a8 100644
> --- a/lib/Target/R600/R600LowerConstCopy.cpp
> +++ b/lib/Target/R600/R600LowerConstCopy.cpp
> @@ -180,7 +180,7 @@ bool R600LowerConstCopy::runOnMachineFunction(MachineFunction &MF) {
>              int ConstMovSel =
>                  TII->getOperandIdx(CstMov->getOpcode(), R600Operands::SRC0_SEL);
>              unsigned ConstIndex = CstMov->getOperand(ConstMovSel).getImm();
> -            if (canFoldInBundle(CP, ConstIndex)) {
> +            if (MI->isInsideBundle() && canFoldInBundle(CP, ConstIndex)) {
>                TII->setImmOperand(MI, OpTable[SrcOp][1], ConstIndex);
>                MI->getOperand(SrcIdx).setReg(AMDGPU::ALU_CONST);
>              } else {
> -- 
> 1.8.1.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list