[flang-commits] [PATCH] D153858: [flang] do not merge block after lowering

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jun 27 05:00:40 PDT 2023


jeanPerier created this revision.
jeanPerier added reviewers: tblah, vzakhari, clementval, vdonaldson.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, bzcheeseman, mehdi_amini, rriddle, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a subscriber: stephenneuendorffer.

Lowering relies on dead code generation / unreachable block deletion
to delete some code that is potentially invalid.

However, calling mlir::simplifyRegion also merges block, which may
promote SSA values to block arguments. Not all FIR types are intended
to be block arguments.
The added test shows an example where block merging led to
fir.shape<> being block arguments (and a failure later in codegen).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153858

Files:
  flang/lib/Lower/Bridge.cpp
  flang/test/Lower/HLFIR/no-block-merging.f90
  flang/test/Lower/block.f90
  flang/test/Lower/entry-statement.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153858.534915.patch
Type: text/x-patch
Size: 7744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230627/534a71c8/attachment-0001.bin>


More information about the flang-commits mailing list