[PATCH] D113756: [fir] Add fir.embox conversion
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 15 08:04:29 PST 2021
awarzynski added inline comments.
================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:1058-1059
+ // Order to find the Op in whose entry block the alloca should be inserted.
+ // The parent Op if it is an LLVM Function Op.
+ // The ancestor LLVM Function Op.
+ auto func = mlir::isa<mlir::LLVM::LLVMFuncOp>(op)
----------------
clementval wrote:
> awarzynski wrote:
> > This isn't correct, is it?
> Why?
```
auto func = mlir::isa<mlir::LLVM::LLVMFuncOp>(op)
? mlir::cast<mlir::LLVM::LLVMFuncOp>(op)
: op->getParentOfType<mlir::LLVM::LLVMFuncOp>();
```
To me this means:
* If this is a `LLVMFuncOp`, use it as the block for the newly inserted alloca.
* Otherwise, use the block corresponding to the parent `LLVMFuncOp`
The comment above this statement suggests otherwise. Or is it just me?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113756/new/
https://reviews.llvm.org/D113756
More information about the llvm-commits
mailing list