[PATCH] D76283: [IRBuilder] Use preferred target type for len argument of memory intrinsic functions

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 15:56:57 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/include/llvm/IR/IRBuilder.h:438-446
+  ConstantInt *getIntPtrSize(Value *Ptr, uint64_t Size) {
+    assert(BB && "Must have a basic block to retrieve the module!");
+
+    Module *M = BB->getParent()->getParent();
+    auto *PtrType = Ptr->getType();
+    unsigned PtrSize = M->getDataLayout().getPointerSizeInBits(
+        PtrType->getPointerAddressSpace());
----------------
This change on its own might be ok but in the context of what you are trying to solve it is not


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76283



More information about the cfe-commits mailing list