aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorVincent Lejeune <vljn@ovi.com>2013-09-12 23:45:00 +0000
committerVincent Lejeune <vljn@ovi.com>2013-09-12 23:45:00 +0000
commit5251d180f4af15414a9c7ae5723dd48bc938576b (patch)
treeabb3c1a366fcfaa32658ef9bffcfc2a7b5b0b3ae /lib/Target/R600/AMDGPUISelDAGToDAG.cpp
parentf57d692c11f0ff6e9c45d2c48c5f362f4c575cf7 (diff)
downloadexternal_llvm-5251d180f4af15414a9c7ae5723dd48bc938576b.zip
external_llvm-5251d180f4af15414a9c7ae5723dd48bc938576b.tar.gz
external_llvm-5251d180f4af15414a9c7ae5723dd48bc938576b.tar.bz2
R600: Move clamp handling code to R600IselLowering.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/AMDGPUISelDAGToDAG.cpp')
-rw-r--r--lib/Target/R600/AMDGPUISelDAGToDAG.cpp34
1 files changed, 1 insertions, 33 deletions
diff --git a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
index 95037ba..a008c96 100644
--- a/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
+++ b/lib/Target/R600/AMDGPUISelDAGToDAG.cpp
@@ -309,39 +309,7 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
SDLoc(N), N->getValueType(0), Ops);
}
}
- SDNode *Result = SelectCode(N);
-
- // Fold operands of selected node
-
- const AMDGPUSubtarget &ST = TM.getSubtarget<AMDGPUSubtarget>();
- if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
- const R600InstrInfo *TII =
- static_cast<const R600InstrInfo*>(TM.getInstrInfo());
- if (Result && Result->isMachineOpcode() &&
- !(TII->get(Result->getMachineOpcode()).TSFlags & R600_InstFlag::VECTOR)
- && TII->hasInstrModifiers(Result->getMachineOpcode())) {
- // If node has a single use which is CLAMP_R600, folds it
- if (Result->hasOneUse() && Result->isMachineOpcode()) {
- SDNode *PotentialClamp = *Result->use_begin();
- if (PotentialClamp->isMachineOpcode() &&
- PotentialClamp->getMachineOpcode() == AMDGPU::CLAMP_R600) {
- unsigned ClampIdx =
- TII->getOperandIdx(Result->getMachineOpcode(), AMDGPU::OpName::clamp);
- std::vector<SDValue> Ops;
- unsigned NumOp = Result->getNumOperands();
- for (unsigned i = 0; i < NumOp; ++i) {
- Ops.push_back(Result->getOperand(i));
- }
- Ops[ClampIdx - 1] = CurDAG->getTargetConstant(1, MVT::i32);
- Result = CurDAG->SelectNodeTo(PotentialClamp,
- Result->getMachineOpcode(), PotentialClamp->getVTList(),
- Ops.data(), NumOp);
- }
- }
- }
- }
-
- return Result;
+ return SelectCode(N);
}