[PATCH] D114460: [fir] Add fir reduction builder
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 25 02:16:44 PST 2021
kiranchandramohan added inline comments.
================
Comment at: flang/include/flang/Optimizer/Builder/Runtime/Reduction.h:21
+
+/// Generate call to all runtime routine.
+/// This calls the descriptor based runtime call implementation of the all
----------------
awarzynski wrote:
> rovka wrote:
> > clementval wrote:
> > > awarzynski wrote:
> > > > rovka wrote:
> > > > > Should we use backticks or something around function names? It reads really strange otherwise.
> > > > > Also, isn't this actually AllDim?
> > > > > Should we use backticks or something around function names?
> > > > +1
> > > >
> > > > Also, what is the difference between `genAllDescriptor` and `genAll`? Why do we need both?
> > > The comments are pretty clear on the differences.
> > But to clarify: the runtime sometimes has different entry points for the same intrinsic, for special cases. In this case, IIUC, there's All and AllDim, both of which implement the ALL intrinsic. If you look in the standard, you'll see there's 2 variants: ALL(MASK) or ALL(MASK, DIM).
> > (...) to clarify (...)
>
> Many thanks @rovka !
>
> > If you look in the standard (...)
> Ah, I see! In fact, I think that it would make a lot of sense to refer to the standard here and to use the notation from there as well (like in Diana's comment).
>
> > The comments are pretty clear on the differences.
>
> I disagree. There is `genAllDescriptor` and `genAll`, but there's no reference to any "descriptor" in the comments, arguments or the implementation. Also, both methods seem to "Generate call to all runtime routine", but one returns an `mlir::Value`, whereas the other is `void`. If both basically generate a call, then why are the interfaces completely different? I appreciate the this implementation may depend on the APIs in the runtime, but it still does not explain what this "descriptor" in `genAllDescriptor` is and what are the return values are.
For the descriptor version, the result is in an array for which a descriptor is needed. It is probably created by the runtime.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114460/new/
https://reviews.llvm.org/D114460
More information about the llvm-commits
mailing list