[llvm] r174098 - R600: Consider bitcast when folding const_address node.
Tom Stellard
thomas.stellard at amd.com
Thu Jan 31 14:11:53 PST 2013
Author: tstellar
Date: Thu Jan 31 16:11:53 2013
New Revision: 174098
URL: http://llvm.org/viewvc/llvm-project?rev=174098&view=rev
Log:
R600: Consider bitcast when folding const_address node.
Patch by: Vincent Lejeune
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Modified:
llvm/trunk/lib/Target/R600/AMDILISelDAGToDAG.cpp
llvm/trunk/lib/Target/R600/R600ISelLowering.cpp
Modified: llvm/trunk/lib/Target/R600/AMDILISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDILISelDAGToDAG.cpp?rev=174098&r1=174097&r2=174098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDILISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDILISelDAGToDAG.cpp Thu Jan 31 16:11:53 2013
@@ -318,6 +318,9 @@ bool AMDGPUDAGToDAGISel::FoldOperands(un
}
}
break;
+ case ISD::BITCAST:
+ Ops[OperandIdx[i] - 1] = Operand.getOperand(0);
+ return true;
default:
break;
}
Modified: llvm/trunk/lib/Target/R600/R600ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/R600ISelLowering.cpp?rev=174098&r1=174097&r2=174098&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/R600ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/R600ISelLowering.cpp Thu Jan 31 16:11:53 2013
@@ -991,6 +991,14 @@ SDValue R600TargetLowering::PerformDAGCo
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));
+ }
+ }
}
}
return SDValue();
More information about the llvm-commits
mailing list