[PATCH] D114159: [flang][codegen] Add a conversion for `fir.coordinate_of` - part 1
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 24 11:40:39 PST 2021
awarzynski added inline comments.
================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:2249
+ int64_t getIntValue(mlir::Value val) const {
+ if (val) {
+ if (auto *defop = val.getDefiningOp()) {
----------------
awarzynski wrote:
> rovka wrote:
> > Nit: I think you can flip this function around (i.e. check the preconditions first and have the bulk of the code outside of the ifs).
> > Also, I'm almost afraid to suggest this, but I think the unreachable can be replaced with an assert.
> Thanks for the suggestions! Let me rewrite this. Stay tuned!
Please take a look again.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114159/new/
https://reviews.llvm.org/D114159
More information about the llvm-commits
mailing list