[all-commits] [llvm/llvm-project] 4e3bec: [SPIRV] Refactor implicit binding legalization (#2...
Helena Kotas via All-commits
all-commits at lists.llvm.org
Fri Sep 11 11:00:08 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4e3bec11527cdbca2e79909f7a5badd12db191a7
https://github.com/llvm/llvm-project/commit/4e3bec11527cdbca2e79909f7a5badd12db191a7
Author: Helena Kotas <hekotas at microsoft.com>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVLegalizeImplicitBinding.cpp
Log Message:
-----------
[SPIRV] Refactor implicit binding legalization (#222848)
This change rewrites the `SPIRVLegalizeImplicitBinding` pass so that
binding collection is driven by intrinsic declarations rather than a
full-module instruction walk.
Previously, the pass used an `InstVisitor` to visit every instruction in
the module and find calls to a small set of intrinsics. The new
implementation iterates over the intrinsic declarations and their users,
making the cost proportional to the number of relevant resource calls
rather than the size of the module.
There is no change to the SPIR-V emitted for existing shaders. Implicit
bindings are still assigned the same numbers.
Other improvements include:
- Order IDs are extracted once into a `SmallVector` instead of being
recomputed on each sort comparisons.
- The separate `verifyUniqueOrderIdPerResource` walk is folded into the
binding assignment loop.
- Make helpers that replace implicit binding calls static.
- Added a `HasImplicitBinding` flag for early exit and accurate
`Changed` reporting, so a module with no implicit bindings (or with a
declaration that has no users) now returns `PreservedAnalyses::all()`
instead of unconditionally invalidating analyses.
Assisted by Claude Opus 5.
This is a second attempt to land this - I accidentally merged the first
one into a stack branch:
https://github.com/llvm/llvm-project/pull/221662
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