[llvm] [IPSCCP] Don't replace with constant if Value is noalias ptr or derivatives (PR #154522)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 12:20:24 PDT 2025


choikwa wrote:

I've tried to run llvm-reduce on CK module in the past, but even after running for 1.5day, it would fail and the reduced llir was still close to original size. I've cooked up a simpler example that demonstrates aforementioned behavior in the testcase commit.

The Diff:
<img width="1808" height="863" alt="{5A2295E7-0EB9-47D2-B279-407CB09903B6}" src="https://github.com/user-attachments/assets/dbdb6f38-670c-46d7-b310-fd4bffae3501" />

log dump: 
[opt.log](https://github.com/user-attachments/files/21943744/opt.log)

The problem starts with IPSCCP replacing %p in the callee body with \@arr, ignoring the fact that %p is noalias ptr argument :
  Constant: @arr = global [100 x i32] zeroinitializer, align 16 = ptr %p


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


More information about the llvm-commits mailing list