[PATCH] D155956: [FunctionAttrs] Consider recursive argmem effects (PR63936)

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 00:31:02 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:192
+        // turns out to access argmem.
+        addArgLocs(RecursiveArgME, Call, ModRefInfo::ModRef, AAR);
         continue;
----------------
goldstein.w.n wrote:
> Why is arg3 `ModRefInfo::ModRef` and not `AAR.getMemoryEffects(Call).getModRef(IRMemLocation::ArgMem)`?
Note: you could change this codes to:
```
        MemoryEffects RecursiveArgME = MemoryEffects::none();
        ModRefInfo ArgMR = ME.getModRef(IRMemLocation::ArgMem);
        addArgLocs(RecursiveArgME, Call, ModRefInfo::ModRef, AAR);
        if (ArgMR != ModRefInfo::NoModRef)
          ME |= RecursiveArgME & MemoryEffects(ArgMR);

```

and get rid of the returning pair logic.
Personally think thats cleaner but not particularly important.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155956/new/

https://reviews.llvm.org/D155956



More information about the llvm-commits mailing list