Fix a segfault in LowerHLFIROrderedAssignments when compiling a WHERE statement whose mask contains an array constructor with an implied-do loop (e.g. WHERE([(f(J), J=1,N)]) ...). The hlfir.exactly_once op inside the hlfir.elemental has live-in values that are block arguments from the enclosing elemental, which canonicalizeExactlyOnceInsideWhere cannot pull into the exactly_once region. The fix has two parts: 1. In canonicalizeExactlyOnceInsideWhere, skip exactly_once ops nested inside hlfir.elemental and skip block argument live-ins, since these cannot be relocated. 2. In both overloads of inlineElementalOp, handle hlfir.exactly_once by inlining its body and cleanup operations instead of cloning the op verbatim (which left an illegal op after lowering). Co-Authored-By: Claude Opus 4 <noreply@anthropic.com> Co-Authored-By: @jeanPerier --------- Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> Co-authored-by: Jean Perier <jperier@nvidia.com>
38 KiB
38 KiB