summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-28 00:32:02 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-28 00:32:02 +0000
commitfe267759929db1b54f1221ad7167c9d857d1136c (patch)
tree6e54dcd26651ceff968d92cfa88a9bc6488e4c02 /llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
parent242fde1b36fe3d431a157b3a559af13a29f97d00 (diff)
downloadbcm5719-llvm-fe267759929db1b54f1221ad7167c9d857d1136c.tar.gz
bcm5719-llvm-fe267759929db1b54f1221ad7167c9d857d1136c.zip
AMDGPU: Remove analyzeImmediate
This no longer uses the more complicated classification of constants. llvm-svn: 276945
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
index 23c9352ce27..fb09007de90 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
@@ -67,7 +67,7 @@ public:
void PostprocessISelDAG() override;
private:
- bool isInlineImmediate(SDNode *N) const;
+ bool isInlineImmediate(const SDNode *N) const;
bool FoldOperand(SDValue &Src, SDValue &Sel, SDValue &Neg, SDValue &Abs,
const R600InstrInfo *TII);
bool FoldOperands(unsigned, const R600InstrInfo *, std::vector<SDValue> &);
@@ -175,10 +175,17 @@ bool AMDGPUDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
AMDGPUDAGToDAGISel::~AMDGPUDAGToDAGISel() {
}
-bool AMDGPUDAGToDAGISel::isInlineImmediate(SDNode *N) const {
- const SITargetLowering *TL
- = static_cast<const SITargetLowering *>(getTargetLowering());
- return TL->analyzeImmediate(N) == 0;
+bool AMDGPUDAGToDAGISel::isInlineImmediate(const SDNode *N) const {
+ const SIInstrInfo *TII
+ = static_cast<const SISubtarget *>(Subtarget)->getInstrInfo();
+
+ if (const ConstantSDNode *C = dyn_cast<ConstantSDNode>(N))
+ return TII->isInlineConstant(C->getAPIntValue());
+
+ if (const ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(N))
+ return TII->isInlineConstant(C->getValueAPF().bitcastToAPInt());
+
+ return false;
}
/// \brief Determine the register class for \p OpNo
OpenPOWER on IntegriCloud