[all-commits] [llvm/llvm-project] ce3641: [Polly] Materialize escaping scalars from empty-do...
Shikhar Jain via All-commits
all-commits at lists.llvm.org
Thu Sep 24 06:58:12 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ce36410607a87ee035224e2a6a819b24aa8f0bab
https://github.com/llvm/llvm-project/commit/ce36410607a87ee035224e2a6a819b24aa8f0bab
Author: Shikhar Jain <shikharj at qti.qualcomm.com>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M polly/lib/Analysis/ScopBuilder.cpp
M polly/lib/Analysis/ScopInfo.cpp
A polly/test/CodeGen/broken-dominance-escaping-scalar.ll
Log Message:
-----------
[Polly] Materialize escaping scalars from empty-domain statements as poison (#220008)
Problem Summary: In a versioned SCoP, Polly may remove a statement with
an empty iteration domain before building its access relations. If that
statement contains an escaping MemoryKind::Value MUST_WRITE access,
removing the
statement also prevents the corresponding ScopArrayInfo from being
registered. During code generation, Polly then fails to materialize the
escaping scalar, leaving a merge PHI that refers to a value defined only
on the original path.
This causes an LLVM verifier failure because the value does not dominate
all uses.
Fix: When removeStmtNotInDomainMap() is about to remove a statement with
a null or empty domain, register the ScopArrayInfo for its qualifying
escaping scalar accesses before allowing the statement to be removed.
The statement is still pruned normally, but code generation can now
materialize the scalar through a .s2a slot and reload it on the
optimized merge edge. Since the defining statement is absent on that
path, the reload is poison. This is sound because
the poison is used only for parameter ranges where the original program
already has undefined behavior
The new .merge PHI provides a dominating definition on the optimized
edge, which resolves the verifier failure while keeping the region
optimized.
Fixes #206551
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list