aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-02-05 16:40:06 +0000
committerTim Northover <Tim.Northover@arm.com>2013-02-05 16:40:06 +0000
commita693205ce1d5a57ae4d855d5773f5e1c89eff063 (patch)
tree49af82f9c26938414ffaedee1ca832f0268e05d3
parent2ebc580638548744dfbd7637d56156e2dcf7ea2c (diff)
Fix signed-unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174387 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/AArch64/AArch64ISelLowering.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp
index 2158b05f63..652f129b51 100644
--- a/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -2389,8 +2389,10 @@ static SDValue PerformATOMIC_FENCECombine(SDNode *FenceNode,
if (!AtomicNode)
return SDValue();
- uint64_t FenceOrder = FenceNode->getConstantOperandVal(1);
- uint64_t FenceScope = FenceNode->getConstantOperandVal(2);
+ AtomicOrdering FenceOrder
+ = static_cast<AtomicOrdering>(FenceNode->getConstantOperandVal(1));
+ SynchronizationScope FenceScope
+ = static_cast<SynchronizationScope>(FenceNode->getConstantOperandVal(2));
if (FenceOrder != Acquire || FenceScope != AtomicNode->getSynchScope())
return SDValue();
@@ -2409,7 +2411,7 @@ static SDValue PerformATOMIC_FENCECombine(SDNode *FenceNode,
Chain, // Chain
AtomicOp.getOperand(1), // Pointer
AtomicNode->getMemOperand(), Acquire,
- static_cast<SynchronizationScope>(FenceScope));
+ FenceScope);
if (AtomicNode->getOpcode() == ISD::ATOMIC_LOAD)
DAG.ReplaceAllUsesWith(AtomicNode, Op.getNode());
@@ -2428,10 +2430,10 @@ static SDValue PerformATOMIC_STORECombine(SDNode *N,
if (FenceOp.getOpcode() != ISD::ATOMIC_FENCE)
return SDValue();
- uint64_t FenceOrder
- = cast<ConstantSDNode>(FenceOp.getOperand(1))->getZExtValue();
- uint64_t FenceScope
- = cast<ConstantSDNode>(FenceOp.getOperand(2))->getZExtValue();
+ AtomicOrdering FenceOrder
+ = static_cast<AtomicOrdering>(FenceOp->getConstantOperandVal(1));
+ SynchronizationScope FenceScope
+ = static_cast<SynchronizationScope>(FenceOp->getConstantOperandVal(2));
if (FenceOrder != Release || FenceScope != AtomicNode->getSynchScope())
return SDValue();
@@ -2442,7 +2444,7 @@ static SDValue PerformATOMIC_STORECombine(SDNode *N,
AtomicNode->getOperand(1), // Pointer
AtomicNode->getOperand(2), // Value
AtomicNode->getMemOperand(), Release,
- static_cast<SynchronizationScope>(FenceScope));
+ FenceScope);
}
/// For a true bitfield insert, the bits getting into that contiguous mask