[clang] [Clang][CodeGen] Use ptrtoaddr for pointer diff (PR #210729)

Devon Loehr via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 05:16:19 PDT 2026


DKLoehr wrote:

I generated the IR files using the following command:

```
./build-stage1/bin/clang++   -fprofile-instr-use=profdata.prof   -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot $(xcrun --show-sdk-path)   -fno-exceptions -fno-rtti   -Ibuild-stage3/include -I../llvm-project/llvm/include   -I../llvm-project/third-party/unittest/googletest/include   -I../llvm-project/third-party/unittest/googlemock/include   -mllvm -opt-bisect-limit=0  -S -emit-llvm ../llvm-project/llvm/unittests/ADT/RangeAdapterTest.cpp -o ir_0.ll
```

Indeed, I only observe the problem when pgo is used. The compiler and pgo data were generated according to https://github.com/llvm/llvm-project/pull/210729#issuecomment-5427641352.

https://github.com/llvm/llvm-project/pull/210729


More information about the cfe-commits mailing list