[PATCH] D98169: [IR] Permit load/store/alloca for struct with the same scalable vectors.

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 02:47:34 PST 2021


david-arm added inline comments.


================
Comment at: llvm/include/llvm/IR/DataLayout.h:630
 public:
-  uint64_t getSizeInBytes() const { return StructSize; }
+  uint64_t getSizeInBytes() const { return StructSize.getKnownMinValue(); }
 
----------------
This should also return a TypeSize to be consistent with getSizeInBits.


================
Comment at: llvm/include/llvm/Support/TypeSize.h:148
+
+  bool operator<(const StackOffset &RHS) const {
+    return (getFixed() < RHS.getFixed() && getScalable() < RHS.getScalable()) ||
----------------
I'm not sure we want to use operators here - see the TypeSize class for how we did this using isKnownXY functions. There was a long history of discussion about the use of operators, which you can see on some of the earlier patches. The problem with operators is that there are cases where you simply do not know the answer. For example, there is no compile-time answer for Fixed(8) < Scalable(4) since we don't know the value of vscale.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98169



More information about the llvm-commits mailing list