Revert "Revert "Add Constant Hoisting Pass" (r200034)"

This reverts commit r200058 and adds the using directive for
ARMTargetTransformInfo to silence two g++ overload warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200062 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Juergen Ributzka
2014-01-25 02:02:55 +00:00
parent 1d1670227b
commit 943ce55f39
21 changed files with 723 additions and 41 deletions

View File

@@ -401,18 +401,22 @@ public:
//===--------------------------------------------------------------------===//
// Node creation methods.
//
SDValue getConstant(uint64_t Val, EVT VT, bool isTarget = false);
SDValue getConstant(const APInt &Val, EVT VT, bool isTarget = false);
SDValue getConstant(const ConstantInt &Val, EVT VT, bool isTarget = false);
SDValue getConstant(uint64_t Val, EVT VT, bool isTarget = false,
bool isOpaque = false);
SDValue getConstant(const APInt &Val, EVT VT, bool isTarget = false,
bool isOpaque = false);
SDValue getConstant(const ConstantInt &Val, EVT VT, bool isTarget = false,
bool isOpaque = false);
SDValue getIntPtrConstant(uint64_t Val, bool isTarget = false);
SDValue getTargetConstant(uint64_t Val, EVT VT) {
return getConstant(Val, VT, true);
SDValue getTargetConstant(uint64_t Val, EVT VT, bool isOpaque = false) {
return getConstant(Val, VT, true, isOpaque);
}
SDValue getTargetConstant(const APInt &Val, EVT VT) {
return getConstant(Val, VT, true);
SDValue getTargetConstant(const APInt &Val, EVT VT, bool isOpaque = false) {
return getConstant(Val, VT, true, isOpaque);
}
SDValue getTargetConstant(const ConstantInt &Val, EVT VT) {
return getConstant(Val, VT, true);
SDValue getTargetConstant(const ConstantInt &Val, EVT VT,
bool isOpaque = false) {
return getConstant(Val, VT, true, isOpaque);
}
// The forms below that take a double should only be used for simple
// constants that can be exactly represented in VT. No checks are made.

View File

@@ -1250,9 +1250,10 @@ public:
class ConstantSDNode : public SDNode {
const ConstantInt *Value;
friend class SelectionDAG;
ConstantSDNode(bool isTarget, const ConstantInt *val, EVT VT)
ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val, EVT VT)
: SDNode(isTarget ? ISD::TargetConstant : ISD::Constant,
0, DebugLoc(), getSDVTList(VT)), Value(val) {
SubclassData |= isOpaque;
}
public:
@@ -1265,6 +1266,8 @@ public:
bool isNullValue() const { return Value->isNullValue(); }
bool isAllOnesValue() const { return Value->isAllOnesValue(); }
bool isOpaque() const { return SubclassData & 1; }
static bool classof(const SDNode *N) {
return N->getOpcode() == ISD::Constant ||
N->getOpcode() == ISD::TargetConstant;