[llvm] [FunctionSpecializer] Keep the blocks in dead functions and remove the callsites of dead function properly. (PR #154668)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 09:27:35 PDT 2025
antoniofrighetto wrote:
> What is the LatticeValue of call2 after specialization? Is it undef? I am puzzled why the solver considers unreachable_call non executable in the first place.
Prior to specialization, the lattice value for `call2` is `constantrange<0, 1>`, i.e., the solver determined it always return 0 (in fact, for `%cond = icmp eq i32 %call2, 0` we do get `constantrange<-1, 0>`, namely condition always true), leading to `%unreachable_call` be never executed. I assume non-returning paths do not add further information to the call-site return summary, so a path where we return 0 suffices.
After specialization, the lattice value of `call2` is `unknown` (not immediately clear to me why), thus `%unreachable_call` gets executable again.
https://github.com/llvm/llvm-project/pull/154668
More information about the llvm-commits
mailing list