[PATCH] D135158: [DataLayout] Introduce DataLayout::getPointerIntegralSize(AS)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 12:54:28 PDT 2022


nikic added a comment.

Is this needed for anything but the one usage in D99660 <https://reviews.llvm.org/D99660>? We could just stop using ptrtoint there and just explicitly check for the nullptr and inttoptr cases, which is all this handles in practice. This overly general constant expression based code has already caused enough complications in the past, so I'm happy to drop it.

I don't think producing a ptr2int out of thin air (without a known result type) is common, and should probably be avoided in general. The main case where we currently introduce ptr2int is when type punning through memory, and in that case the load/store type determines the used type.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135158



More information about the llvm-commits mailing list