[llvm] [FunctionSpecializer] Do not mark function dead if any unexecutable call site exists (PR #154668)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 23 13:06:47 PDT 2025


antoniofrighetto wrote:

> > Isn't the discrepancy here stemming from the fact that we are attempting to remove basic blocks of a fully specialized function, where it should be up to FunctionSpecializer's destructor to remove such functions (in which case, unreachable call-sites should be removed as well)?
> 
> Sounds reasonable to me. It's the undefined behaviour that causes inconsistent executability. How about replacing the unreachable call-sites with `poison` and removing them? The return value of the once-proven-inexecutable call is invalid in fact.

Right. That would make sense to me.

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


More information about the llvm-commits mailing list