<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Jun 6, 2021, at 8:52 AM, Hal Finkel <<a href="mailto:hal.finkel.llvm@gmail.com" class="">hal.finkel.llvm@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class="">I'll take this opportunity to point out that, at least
historically, the reason why a desire to optimize around ptrtoint
keeps resurfacing is because:<br class=""><div class=""><div class=""><p class=""> 1. Common optimizations introduce them into code that did not
otherwise have them (SROA, for example, see convertValue in
SROA.cpp).</p><p class=""> 2. They're generated by some of the ABI code for argument
passing (see clang/lib/CodeGen/TargetInfo.cpp).</p><p class=""> 3. They're present in certain performance-sensitive code idioms
(see, for example, ADT/PointerIntPair.h).<br class="">
</p><p class="">It seems to me that, if there's design work to do in this area,
one should consider addressing these now-long-standing issues
where we introduce ptrtoint by replacing this mechanism with some
other one.</p></div></div></blockquote></div><div>I completely agree. These all have different solutions, I’d prefer to tackle them one by one. </div><div><br class=""></div><div>-Chris</div><div><br class=""></div></body></html>