[clang] [Clang][CodeGen] Use ptrtoaddr for pointer diff (PR #210729)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 28 09:55:00 PDT 2026
nikic wrote:
Thanks. I can repro now.
I believe this is a representative reduction: https://llvm.godbolt.org/z/eTrcEjf91
The relevant fold is: https://github.com/llvm/llvm-project/blob/fa3c2e9f49471a15ff9314503f9922e287a63908/llvm/lib/Analysis/InstructionSimplify.cpp#L5682-L5689
Folding this to ptrtoaddr is incorrect because we lose the provenance escape.
https://github.com/llvm/llvm-project/pull/210729
More information about the cfe-commits
mailing list