[PATCH] D146872: [1/N][IR] Permit load/store/alloca for struct of the same scalable vector type

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 05:46:22 PDT 2023


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

Generally, please re-review the whole patch and remove special cases that are no longer needed now that isSized() returns the correct value.



================
Comment at: llvm/include/llvm/IR/DataLayout.h:625
 public:
-  uint64_t getSizeInBytes() const { return StructSize; }
+  uint64_t getSizeInBytes() const { return StructSize.getFixedValue(); }
 
----------------
Why not make these methods return TypeSize instead (and drop the separate getMinSize APIs)?


================
Comment at: llvm/include/llvm/IR/DataLayout.h:670
 inline TypeSize DataLayout::getTypeSizeInBits(Type *Ty) const {
-  assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
   switch (Ty->getTypeID()) {
----------------
Assertion can be restored.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:7627
+      !(isa<StructType>(Ty) &&
+        cast<StructType>(Ty)->containsHomogeneousScalableVectorTypes()))
     return error(TyLoc, "Cannot allocate unsized type");
----------------
These changes should no longer be necessary now that isSized() is fixed.


================
Comment at: llvm/lib/IR/Type.cpp:603
+  if (containsHomogeneousScalableVectorTypes()) {
+    dbgs() << "containsHomogeneousScalableVectorTypes = true\n";
+    return true;
----------------
Debugging leftover.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146872/new/

https://reviews.llvm.org/D146872



More information about the llvm-commits mailing list