diff options
| author | Vincent Lejeune <vljn@ovi.com> | 2013-09-12 23:45:00 +0000 |
|---|---|---|
| committer | Vincent Lejeune <vljn@ovi.com> | 2013-09-12 23:45:00 +0000 |
| commit | 0167a313dadfeb3239568dbe39f781e07ea4be9e (patch) | |
| tree | 320cbcada3a229a9bcad270a4f05b9fd8d4aa8f4 /llvm/lib/Target/R600/R600ISelLowering.cpp | |
| parent | 9a248e5c2d9646a615df01a4761ec69b4552b60d (diff) | |
| download | bcm5719-llvm-0167a313dadfeb3239568dbe39f781e07ea4be9e.tar.gz bcm5719-llvm-0167a313dadfeb3239568dbe39f781e07ea4be9e.zip | |
R600: Move clamp handling code to R600IselLowering.cpp
llvm-svn: 190645
Diffstat (limited to 'llvm/lib/Target/R600/R600ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/R600/R600ISelLowering.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/R600ISelLowering.cpp b/llvm/lib/Target/R600/R600ISelLowering.cpp index 5db793737e0..c5e814ff8c6 100644 --- a/llvm/lib/Target/R600/R600ISelLowering.cpp +++ b/llvm/lib/Target/R600/R600ISelLowering.cpp @@ -1822,6 +1822,22 @@ SDNode *R600TargetLowering::PostISelFolding(MachineSDNode *Node, if (FoldOperand(Node, i, Src, FakeOp, FakeOp, FakeOp, FakeOp, DAG)) return DAG.getMachineNode(Opcode, SDLoc(Node), Node->getVTList(), Ops); } + } else if (Opcode == AMDGPU::CLAMP_R600) { + SDValue Src = Node->getOperand(0); + if (!Src.isMachineOpcode() || + !TII->hasInstrModifiers(Src.getMachineOpcode())) + return Node; + int ClampIdx = TII->getOperandIdx(Src.getMachineOpcode(), + AMDGPU::OpName::clamp); + if (ClampIdx < 0) + return Node; + std::vector<SDValue> Ops; + unsigned NumOp = Src.getNumOperands(); + for(unsigned i = 0; i < NumOp; ++i) + Ops.push_back(Src.getOperand(i)); + Ops[ClampIdx - 1] = DAG.getTargetConstant(1, MVT::i32); + return DAG.getMachineNode(Src.getMachineOpcode(), SDLoc(Node), + Node->getVTList(), Ops); } else { if (!TII->hasInstrModifiers(Opcode)) return Node; |

