[PATCH] D114141: Allow DataLayout to support arbitrary pointer sizes

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 10:19:25 PST 2021


jrtc27 added inline comments.


================
Comment at: llvm/lib/IR/DataLayout.cpp:321
       unsigned PointerMemSize;
-      if (Error Err = getIntInBytes(Tok, PointerMemSize))
+      if (Error Err = getInt<unsigned>(Tok, PointerMemSize))
         return Err;
----------------
These shouldn't need an explicit template parameter, it's inferable from PointerMemSize's type?


================
Comment at: llvm/lib/IR/DataLayout.cpp:714
+    MaxIndexSize = std::max(MaxIndexSize,
+    (P.TypeBitWidth+7)/8);
 
----------------
divideCeil from MathExtras?


================
Comment at: llvm/lib/Target/M68k/M68kISelLowering.cpp:173
   }
-  return MVT::getIntegerVT(8 * DL.getPointerSize(0));
+  return MVT::getIntegerVT(DL.getPointerSizeInBits(0));
 }
----------------
These aren't really necessary. I'd suggest separating out the "add more flexibility to DataLayout" changes from the "simplify users of existing interfaces by using new ones" changes so it's clear there isn't actually an API break here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114141



More information about the llvm-commits mailing list