================
@@ -1432,6 +1442,26 @@ static bool runImpl(Module &M, AnalysisGetter &AG, 
TargetMachine &TM,
       } else if (auto *CmpX = dyn_cast<AtomicCmpXchgInst>(&I)) {
         A.getOrCreateAAFor<AAAddressSpace>(
             IRPosition::value(*CmpX->getPointerOperand()));
+      } else if (auto *II = dyn_cast<IntrinsicInst>(&I)) {
+        if (II->getIntrinsicID() == Intrinsic::amdgcn_make_buffer_rsrc) {
+          IRPosition IRP = IRPosition::value(*II);
+
+          Attributor::AlignmentCallbackTy ACB =
+              [](const IRPosition &IRP, const AbstractAttribute *AA,
+                 SmallVectorImpl<AA::ValueAndContext> &Values) {
+                Instruction *I = IRP.getCtxI();
+                if (!I)
+                  return;
+                if (auto *II = dyn_cast<IntrinsicInst>(I))
+                  if (II->getIntrinsicID() ==
+                      Intrinsic::amdgcn_make_buffer_rsrc)
+                    Values.push_back(
+                        AA::ValueAndContext{*I->getOperand(0), nullptr});
----------------
shiltian wrote:

```suggestion
                if (auto *II = dyn_cast<IntrinsicInst>(I)) {
                  if (II->getIntrinsicID() ==
                      Intrinsic::amdgcn_make_buffer_rsrc)
                    Values.push_back(
                        AA::ValueAndContext{*I->getOperand(0), nullptr});
                }
```

https://github.com/llvm/llvm-project/pull/145278
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to