[flang-commits] [flang] [flang] allow rebox/embox of OPTIONAL (PR #194319)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Mon Apr 27 05:48:42 PDT 2026
================
@@ -55,6 +57,40 @@ static void populateShift(llvm::SmallVectorImpl<mlir::Value> &vec,
vec.append(shift.getOrigins().begin(), shift.getOrigins().end());
}
+// Helper to emit embox/rebox for OPTIONAL input inside a block
+// guarded by a runtime presence check and to return an absent
+// box when the input is not present.
----------------
tblah wrote:
Wouldn't that representation require us to conditionally limit speculation for any operation which reads from a box (`fir.box_addr`, `fir.box_dims`, etc)? If there was a real box containing a nullptr address then I think we only need to limit speculation on `fir.load` (which presumably is already the case).
https://github.com/llvm/llvm-project/pull/194319
More information about the flang-commits
mailing list