[PATCH] D110585: [Analysis][SimplifyLibCalls] Refactor code related to size_t in lib func signatures. NFCI

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 02:00:04 PDT 2022


bjope added inline comments.


================
Comment at: llvm/lib/Analysis/TargetLibraryInfo.cpp:1805
+  const DataLayout &DL = M.getDataLayout();
+  return DL.getPointerSizeInBits(AddressSpace);
+}
----------------
arichardson wrote:
> I think this should be the index size. If that doesn't work for you, you could special-case it based on your target triple?
My goal here is still just to do an NFC refactoring, to have this logic in one place.

Downstream I'll add a check and an early out based on the target triple, but I'm not that interested in taking the risk of changing the behavior for other targets by using getIndexSize here. But if someone else wants to do that, at least the introduction of this helper has simplified the task as there hopefully only is one place to update.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110585



More information about the llvm-commits mailing list