[polly] [Polly] Reject SCoPs with an escaping scalar defined in an empty-doma… (PR #213656)

Shikhar Jain via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 06:02:25 PDT 2026


ShikharJ-Corp wrote:

**Poison-materialization alternative** 
Thanks to @efriedma-quic for this suggestion. This is currently WIP. I will post this and then add reviewers for correctness comparison between two approaches..

Core idea:
Instead of rejecting the whole SCoP, we let Polly keep optimizing the loop and simply give the escaping scalar a well-defined placeholder on the optimized path where it is never actually produced.

Recall the failure: the escaping value's producing statement has an empty domain, so it is deleted, and the optimized copy never computes the value yet the merge block still forwards it. The reject fix avoids this by declining the loop. The poison approach instead makes the merge block's optimized-side input legitimate by giving the value a normal scalar slot, whose optimized-side contents are poison.

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


More information about the llvm-commits mailing list