[Mesa-dev] [PATCH 1/2] R600: Consider bitcast when folding const_address node.
Tom Stellard
tom at stellard.net
Mon Jan 21 14:04:48 PST 2013
On Mon, Jan 21, 2013 at 07:15:21PM +0100, Vincent Lejeune wrote:
> ---
> lib/Target/R600/AMDILISelDAGToDAG.cpp | 3 +++
> lib/Target/R600/R600ISelLowering.cpp | 6 ++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/lib/Target/R600/AMDILISelDAGToDAG.cpp b/lib/Target/R600/AMDILISelDAGToDAG.cpp
> index 567b3e2..ece26ef 100644
> --- a/lib/Target/R600/AMDILISelDAGToDAG.cpp
> +++ b/lib/Target/R600/AMDILISelDAGToDAG.cpp
> @@ -318,6 +318,9 @@ bool AMDGPUDAGToDAGISel::FoldOperands(unsigned Opcode,
> }
> }
> break;
> + case ISD::BITCAST:
> + Ops[OperandIdx[i] - 1] = Operand.getOperand(0);
> + return true;
> default:
> break;
> }
> diff --git a/lib/Target/R600/R600ISelLowering.cpp b/lib/Target/R600/R600ISelLowering.cpp
> index 773122b..c78a81d 100644
> --- a/lib/Target/R600/R600ISelLowering.cpp
> +++ b/lib/Target/R600/R600ISelLowering.cpp
> @@ -991,6 +991,12 @@ SDValue R600TargetLowering::PerformDAGCombine(SDNode *N,
> return Arg->getOperand(Element);
> }
> }
> + if (Arg.getOpcode() == ISD::BITCAST && Arg.getOperand(0).getOpcode() == ISD::BUILD_VECTOR) {
> + if (ConstantSDNode *Const = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
> + unsigned Element = Const->getZExtValue();
> + return DAG.getNode(ISD::BITCAST, N->getDebugLoc(), N->getVTList(), Arg->getOperand(0).getOperand(Element));
> + }
Coding style: These lines are more than 80 characters.
> + }
> }
> }
> return SDValue();
> --
> 1.8.1
>
> _______________________________________________
> 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