OSDN Git Service

Fix signedness of constant. NFC.
authorNirav Dave <niravd@google.com>
Fri, 26 May 2017 12:53:10 +0000 (12:53 +0000)
committerNirav Dave <niravd@google.com>
Fri, 26 May 2017 12:53:10 +0000 (12:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303980 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64ISelLowering.cpp

index 8fbdfcc..62f4c95 100644 (file)
@@ -9222,14 +9222,14 @@ static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St,
   // instructions (stp).
   SDLoc DL(&St);
   SDValue BasePtr = St.getBasePtr();
-  int64_t BaseOffset = 0;
+  uint64_t BaseOffset = 0;
 
   const MachinePointerInfo &PtrInfo = St.getPointerInfo();
   SDValue NewST1 =
       DAG.getStore(St.getChain(), DL, SplatVal, BasePtr, PtrInfo,
                    OrigAlignment, St.getMemOperand()->getFlags());
 
-  // As this in ISel, we will not merge this add which may degrate results.
+  // As this in ISel, we will not merge this add which may degrade results.
   if (BasePtr->getOpcode() == ISD::ADD &&
       isa<ConstantSDNode>(BasePtr->getOperand(1))) {
     BaseOffset = cast<ConstantSDNode>(BasePtr->getOperand(1))->getSExtValue();
@@ -9239,9 +9239,9 @@ static SDValue splitStoreSplat(SelectionDAG &DAG, StoreSDNode &St,
   unsigned Offset = EltOffset;
   while (--NumVecElts) {
     unsigned Alignment = MinAlign(OrigAlignment, Offset);
-    SDValue OffsetPtr = DAG.getNode(
-        ISD::ADD, DL, MVT::i64, BasePtr,
-        DAG.getConstant(BaseOffset + ((int64_t)Offset), DL, MVT::i64));
+    SDValue OffsetPtr =
+        DAG.getNode(ISD::ADD, DL, MVT::i64, BasePtr,
+                    DAG.getConstant(BaseOffset + Offset, DL, MVT::i64));
     NewST1 = DAG.getStore(NewST1.getValue(0), DL, SplatVal, OffsetPtr,
                           PtrInfo.getWithOffset(Offset), Alignment,
                           St.getMemOperand()->getFlags());