[llvm] 305a0ba - [SelectionDAG] Don't pass a scalable vector to MachinePointerInfo::getWithOffset in a unit test.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 15:19:28 PDT 2021


Author: Craig Topper
Date: 2021-03-18T15:19:22-07:00
New Revision: 305a0bad1d5509d2f79123a73d06fff848b9bf88

URL: https://github.com/llvm/llvm-project/commit/305a0bad1d5509d2f79123a73d06fff848b9bf88
DIFF: https://github.com/llvm/llvm-project/commit/305a0bad1d5509d2f79123a73d06fff848b9bf88.diff

LOG: [SelectionDAG] Don't pass a scalable vector to MachinePointerInfo::getWithOffset in a unit test.

Suppresses an implicit TypeSize to uint64_t conversion warning.

We might be able to just not offset it since we're writing to a
Fixed stack object, but I wasn't sure so I just did what
DAGTypeLegalizer::IncrementPointer does.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D98736

Added: 
    

Modified: 
    llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp b/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
index c00b6c518e70..626176d4ba9a 100644
--- a/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
+++ b/llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
@@ -165,14 +165,12 @@ TEST_F(SelectionDAGAddressAnalysisTest, unknownSizeFrameObjects) {
   int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
   MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(*MF, FI);
   SDValue Value = DAG->getConstant(0, Loc, SubVecVT);
-  TypeSize Offset0 = TypeSize::Fixed(0);
   TypeSize Offset1 = SubVecVT.getStoreSize();
-  SDValue Index0 = DAG->getMemBasePlusOffset(FIPtr, Offset0, Loc);
   SDValue Index1 = DAG->getMemBasePlusOffset(FIPtr, Offset1, Loc);
-  SDValue Store0 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index0,
-                                 PtrInfo.getWithOffset(Offset0));
+  SDValue Store0 =
+      DAG->getStore(DAG->getEntryNode(), Loc, Value, FIPtr, PtrInfo);
   SDValue Store1 = DAG->getStore(DAG->getEntryNode(), Loc, Value, Index1,
-                                 PtrInfo.getWithOffset(Offset1));
+                                 MachinePointerInfo(PtrInfo.getAddrSpace()));
   Optional<int64_t> NumBytes0 = MemoryLocation::getSizeOrUnknown(
       cast<StoreSDNode>(Store0)->getMemoryVT().getStoreSize());
   Optional<int64_t> NumBytes1 = MemoryLocation::getSizeOrUnknown(


        


More information about the llvm-commits mailing list