[llvm] [DirectX] Remove unused heap resources (PR #218093)
Finn Plummer via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 13:48:58 PDT 2026
================
@@ -87,9 +91,9 @@ static bool removeUnusedResources(Function &F) {
for (auto *Instr : DeadInstr) {
if (auto *II = dyn_cast<IntrinsicInst>(Instr)) {
- assert(II->getIntrinsicID() == Intrinsic::dx_resource_handlefrombinding ||
- II->getIntrinsicID() ==
- Intrinsic::dx_resource_handlefromimplicitbinding);
+ assert(isResourceHandleCreation(II->getIntrinsicID()));
+ if (II->getIntrinsicID() == Intrinsic::dx_resource_handlefromheap)
+ continue;
----------------
inbelic wrote:
nit:
```suggestion
continue; // A heap resource does not have an associated global variable to remove
```
or the like
https://github.com/llvm/llvm-project/pull/218093
More information about the llvm-commits
mailing list