[all-commits] [llvm/llvm-project] 1d4453: [flang][HLFIR] fix FORALL issue 120190 (#120236)

jeanPerier via All-commits all-commits at lists.llvm.org
Wed Dec 18 01:26:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d4453a6711394b368995c0f761015c1f6d27250
      https://github.com/llvm/llvm-project/commit/1d4453a6711394b368995c0f761015c1f6d27250
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-12-18 (Wed, 18 Dec 2024)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
    A flang/test/HLFIR/order_assignments/forall-issue120190.fir

  Log Message:
  -----------
  [flang][HLFIR] fix FORALL issue 120190 (#120236)

Fix #120190.

The hlfir.forall lowering code was not properly checking for forall
index reference in mask value computation before trying to hoist it: it
was only looking at the ops directly nested in the hlfir.forall_mask
region, but not the operation indirectly nested. This caused triggered
bogus hoisting in #120190 leading to undefined behavior (reference to
uinitialized data). The added regression test would die at compile time
with a dominance error.

Fix this by doing a deep walk of the region operation instead. Also
clean-up the region cloning to use without_terminator.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list