[PATCH] D121460: [FunctionAttrs] Replace MemoryAccessKind with FMRB.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 08:56:56 PST 2022


nikic added inline comments.


================
Comment at: llvm/include/llvm/Transforms/IPO/FunctionAttrs.h:23
 #include "llvm/IR/PassManager.h"
+#include <cstdint>
 
----------------
Why?


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:133-140
     if (AliasAnalysis::onlyReadsMemory(MRB))
-      return MAK_ReadOnly;
+      return FMRB_OnlyReadsMemory;
 
     if (AliasAnalysis::onlyWritesMemory(MRB))
-      return MAK_WriteOnly;
+      return FMRB_OnlyWritesMemory;
 
     // Conservatively assume it reads and writes to memory.
----------------
I think you can just `return MRB` in this whole branch.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:196
 
+        AccessesNonArgs |= IsNonArgumentObject(Loc.Ptr);
+
----------------
This is presumably not supposed to be part of //this// patch, as it's not used?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121460



More information about the llvm-commits mailing list