[flang] Deallocate WHERE masks after all assignments
authorJean Perier <jperier@nvidia.com>
Tue, 20 Sep 2022 08:39:39 +0000 (10:39 +0200)
committerJean Perier <jperier@nvidia.com>
Tue, 20 Sep 2022 08:40:30 +0000 (10:40 +0200)
commite6238ab52590a4f31bc8c6e806c7947e9ef04b57
tree78cd4e0e01374cd1505940547927144ebf21606d
parent3b2011fd4f393c46ed1110840e0c00f52a582241
[flang] Deallocate WHERE masks after all assignments

Allocatable assignments were triggering lowering to clean-up
any WHERE mask temporaries, even if some assignments where left
in the WHERE construct.

This is because allocatable assignments lowering was being passed the
wrong statement context. Fix this by selecting the where/forall statement
context instead of a local one when there is one.

Differential Revision: https://reviews.llvm.org/D134197
flang/lib/Lower/Bridge.cpp
flang/test/Lower/where-allocatable-assignments.f90 [new file with mode: 0644]