================
@@ -182,43 +139,121 @@ uint32_t
SPIRVLegalizeImplicitBindingImpl::getAndReserveFirstUnusedBinding(
return NewBinding;
}
-void SPIRVLegalizeImplicitBindingImpl::replaceImplicitBindingCalls(Module &M) {
- uint32_t lastOrderId = -1;
- uint32_t lastBindingNumber = -1;
+// Replace the implicit binding call with a new call using explicit binding.
+static void replaceWithHandleFromBinding(Module &M, CallInst *CI,
+ uint32_t DescSet, uint32_t Binding,
+ Value *IndexOp, Value *RangeOp,
+ Value *Name) {
+ IRBuilder<> Builder(CI);
----------------
Icohedron wrote:
[SUGGESTION] Start this function with an assert on `CI` just like
`replaceWithCounterHandleFromBinding` does?
```suggestion
assert(CI->getIntrinsicID() ==
Intrinsic::spv_resource_handlefrombinding &&
"unexpected implicit binding intrinsic");
IRBuilder<> Builder(CI);
```
https://github.com/llvm/llvm-project/pull/221662
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits