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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 12:21:55 PDT 2021


craig.topper created this revision.
craig.topper added a reviewer: HsiangKai.
Herald added subscribers: StephenFan, dexonsmith, ecnelises.
craig.topper requested review of this revision.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98736

Files:
  llvm/include/llvm/Support/TypeSize.h
  llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp


Index: llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
===================================================================
--- llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
+++ llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
@@ -170,9 +170,9 @@
   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));
+                                 MachinePointerInfo(PtrInfo.getAddrSpace()));
   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(
Index: llvm/include/llvm/Support/TypeSize.h
===================================================================
--- llvm/include/llvm/Support/TypeSize.h
+++ llvm/include/llvm/Support/TypeSize.h
@@ -447,15 +447,7 @@
   //       bail out early for scalable vectors and use getFixedValue()
   //   }
   operator ScalarTy() const {
-#ifdef STRICT_FIXED_SIZE_VECTORS
     return getFixedValue();
-#else
-    if (isScalable())
-      WithColor::warning() << "Compiler has made implicit assumption that "
-                              "TypeSize is not scalable. This may or may not "
-                              "lead to broken code.\n";
-    return getKnownMinValue();
-#endif
   }
 
   // Additional operators needed to avoid ambiguous parses


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98736.331065.patch
Type: text/x-patch
Size: 1799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210316/c326cb8c/attachment.bin>


More information about the llvm-commits mailing list