rovka added a comment.

> I suspect 'ScalableSize' is the wrong term now; 'TypeSize' may be better. 
> Thoughts?

I agree, TypeSize sounds better. Maybe we can replace the public constructor 
with 2 static methods, TypeSize::Fixed(Size) and TypeSize::Scalable(Size), so 
we don't always have to spell out /* Scalable =*/.



================
Comment at: llvm/include/llvm/IR/DataLayout.h:454
+    auto BaseSize = getTypeSizeInBits(Ty);
+    return { (BaseSize.getKnownMinSize() + 7) / 8, BaseSize.isScalable() };
   }
----------------
We already overload operator /, why not overload + as well so we don't have to 
change the body of this method?


================
Comment at: llvm/include/llvm/IR/DataLayout.h:487
+    auto BaseSize = getTypeStoreSize(Ty);
+    uint64_t MinAlignedSize = alignTo(BaseSize.getKnownMinSize(),
+                                      getABITypeAlignment(Ty));
----------------
Can we add a version of alignTo that works with ScalableSize instead?


================
Comment at: llvm/include/llvm/IR/DataLayout.h:656
+                     
getTypeSizeInBits(VTy->getElementType()).getKnownMinSize();
+    return ScalableSize(MinBits, EltCnt.Scalable);
   }
----------------
Maybe just return VTy->getElementCount() * 
getTypeSizeInBits(VTy->getElementType()).getFixedSize().


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D53137



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to