[flang-commits] [flang] [flang][HLFIR] Relax InlineElementals to support more than two users (PR #186916)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Fri May 8 09:22:37 PDT 2026
================
@@ -64,23 +302,27 @@ getTwoUses(hlfir::ElementalOp elemental) {
if (apply.getResult().getType() != yield.getElementValue().getType())
return std::nullopt;
- return std::pair{apply, destroy};
+ // Only return the destroy op if there's exactly one apply and no other users.
+ bool safeToDelete = (applyCount == 1 && !hasOtherUsers);
----------------
tblah wrote:
We don't update hasOtherUses for all operation kinds.
https://github.com/llvm/llvm-project/pull/186916
More information about the flang-commits
mailing list