[PATCH] D97502: [flang][fir] Upstream utility function valueHasFirAttribute()

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 18:14:56 PST 2021


schweitz added inline comments.


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1581
+  // If this is a function argument, look in the argument attributes.
+  if (auto blockArg = value.dyn_cast<mlir::BlockArgument>()) {
+    if (blockArg.getOwner() && blockArg.getOwner()->isEntryBlock())
----------------
kiranchandramohan wrote:
> Should function arguments always be block arguments?
There is always an association, I believe.


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1595
+      return definingOp->hasAttr(attributeName);
+    // If this is an imported global, look at AddOfOp and GlobalOp attributes.
+    // Both operations are looked at because use/host associated variable (the
----------------
kiranchandramohan wrote:
> Nit: AddOfOp -> AddrOfOp
+1


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1603-1605
+        if (auto globlaOp =
+                module.lookupSymbol<fir::GlobalOp>(addressOfOp.symbol()))
+          return globlaOp->hasAttr(attributeName);
----------------
kiranchandramohan wrote:
> Nit: globlaOp-> globalOp
+1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97502



More information about the llvm-commits mailing list