[PATCH] D97502: [flang][fir] Upstream utility function valueHasFirAttribute()
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 14:15:17 PST 2021
kiranchandramohan accepted this revision.
kiranchandramohan added a comment.
This revision is now accepted and ready to land.
LGTM. This will be tested in the subsequent usage.
================
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())
----------------
Should function arguments always be block arguments?
================
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
----------------
Nit: AddOfOp -> AddrOfOp
================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1603-1605
+ if (auto globlaOp =
+ module.lookupSymbol<fir::GlobalOp>(addressOfOp.symbol()))
+ return globlaOp->hasAttr(attributeName);
----------------
Nit: globlaOp-> globalOp
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