[llvm] [HLSL][DirectX] handle updatecounter in dxil resource access pass (PR #223591)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 09:03:55 PDT 2026


================
@@ -754,13 +754,16 @@ static void createLoadIntrinsic(IntrinsicInst *II, LoadInst *LI,
   llvm_unreachable("Unhandled case in switch");
 }
 
-static Instruction *getStoreLoadPointerOperand(Instruction *AI) {
+static Instruction *getStoreLoadOperand(Instruction *AI) {
   if (auto *LI = dyn_cast<LoadInst>(AI))
     return dyn_cast<Instruction>(LI->getPointerOperand());
   if (auto *SI = dyn_cast<StoreInst>(AI))
     return dyn_cast<Instruction>(SI->getPointerOperand());
   if (auto *RMWI = dyn_cast<AtomicRMWInst>(AI))
     return dyn_cast<Instruction>(RMWI->getPointerOperand());
+  if (auto *II = dyn_cast<IntrinsicInst>(AI))
+    if (II->getIntrinsicID() == Intrinsic::dx_resource_updatecounter)
+      return dyn_cast<Instruction>(II->getArgOperand(0));
----------------
farzonl wrote:

what type of operand is this?

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


More information about the llvm-commits mailing list