From 61c654ce5c86a7a9f8d81057979aa5b0eaab07b9 Mon Sep 17 00:00:00 2001 From: Jyotsna Verma Date: Wed, 28 Nov 2012 20:58:14 +0000 Subject: Define signed const-ext immediate operands and their predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168810 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Hexagon/HexagonISelDAGToDAG.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Target/Hexagon/HexagonISelDAGToDAG.cpp') diff --git a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index 5499134..4ff3135 100644 --- a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -94,6 +94,7 @@ public: SDNode *SelectConstant(SDNode *N); SDNode *SelectConstantFP(SDNode *N); SDNode *SelectAdd(SDNode *N); + bool isConstExtProfitable(SDNode *N) const; // Include the pieces autogenerated from the target description. #include "HexagonGenDAGISel.inc" @@ -1507,3 +1508,13 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode, OutOps.push_back(Op1); return false; } + +bool HexagonDAGToDAGISel::isConstExtProfitable(SDNode *N) const { + unsigned UseCount = 0; + for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) { + UseCount++; + } + + return (UseCount <= 1); + +} -- cgit v1.1