[flang-commits] [PATCH] D153858: [flang] do not merge block after lowering
Kiran Chandramohan via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Jun 28 00:38:57 PDT 2023
kiranchandramohan added a comment.
In D153858#4452968 <https://reviews.llvm.org/D153858#4452968>, @jeanPerier wrote:
> In D153858#4452828 <https://reviews.llvm.org/D153858#4452828>, @vdonaldson wrote:
>
>> Does block coalescing still happen later in the compilation pipeline? That's a nice optimization that we don't want to completely lose.
>
> It will still happen in LLVM after MLIR depending on what optimization levels are set.
>
> If we want it at the MLIR level, we will need to add options to the MLIR one so that it has some sort of idea of the cost of merging blocks (creating block arguments implies forcing the codegen of the related type to some runtime representation. Depending on the SSA type this may or may not be cheap. So the MLIR pass should be provided some kind of interface to decide whether or not block merging is profitable).
> Or we will need to share the some logic with MLIR but do our own pass.
>
> So far I am assuming that LLVM is able to do a good job for simple small blocks/extra jumps and that we do not really need to do this at the MLIR level.
Canonicalization can also merge blocks. Would we run into the same issue (with block arguments) there?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153858/new/
https://reviews.llvm.org/D153858
More information about the flang-commits
mailing list