aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
index 161768b8dc22..b4979c953516 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
@@ -1345,7 +1345,8 @@ inline bool HexagonDAGToDAGISel::SelectAnyInt(SDValue &N, SDValue &R) {
EVT T = N.getValueType();
if (!T.isInteger() || T.getSizeInBits() != 32 || !isa<ConstantSDNode>(N))
return false;
- R = N;
+ int32_t V = cast<const ConstantSDNode>(N)->getZExtValue();
+ R = CurDAG->getTargetConstant(V, SDLoc(N), N.getValueType());
return true;
}
@@ -1540,7 +1541,7 @@ bool HexagonDAGToDAGISel::keepsLowBits(const SDValue &Val, unsigned NumBits,
break;
case ISD::AND: {
// Check if this is an AND with NumBits of lower bits set to 1.
- uint64_t Mask = (1 << NumBits) - 1;
+ uint64_t Mask = (1ULL << NumBits) - 1;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Val.getOperand(0))) {
if (C->getZExtValue() == Mask) {
Src = Val.getOperand(1);
@@ -1558,7 +1559,7 @@ bool HexagonDAGToDAGISel::keepsLowBits(const SDValue &Val, unsigned NumBits,
case ISD::OR:
case ISD::XOR: {
// OR/XOR with the lower NumBits bits set to 0.
- uint64_t Mask = (1 << NumBits) - 1;
+ uint64_t Mask = (1ULL << NumBits) - 1;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Val.getOperand(0))) {
if ((C->getZExtValue() & Mask) == 0) {
Src = Val.getOperand(1);
@@ -1580,7 +1581,7 @@ bool HexagonDAGToDAGISel::keepsLowBits(const SDValue &Val, unsigned NumBits,
}
bool HexagonDAGToDAGISel::isAlignedMemNode(const MemSDNode *N) const {
- return N->getAlignment() >= N->getMemoryVT().getStoreSize();
+ return N->getAlign().value() >= N->getMemoryVT().getStoreSize();
}
bool HexagonDAGToDAGISel::isSmallStackStore(const StoreSDNode *N) const {
@@ -1655,7 +1656,7 @@ struct WeightedLeaf {
int Weight;
int InsertionOrder;
- WeightedLeaf() : Value(SDValue()) { }
+ WeightedLeaf() {}
WeightedLeaf(SDValue Value, int Weight, int InsertionOrder) :
Value(Value), Weight(Weight), InsertionOrder(InsertionOrder) {