[flang-commits] [flang] [llvm] [flang] Check allocation status in inlined ALLOCATE lowering (PR #223287)

via flang-commits flang-commits at lists.llvm.org
Mon Sep 14 22:46:33 PDT 2026


shivaramaarao wrote:

> Makes sense to add this checks in the end, but I think I would favor adding a `fir.assert %i1, "ERROR MESSAGE"` concept with a non speculatable operation with no memory effect so that IR analysis of the code remains as simple as possible. Ideally with a canonicalization to drop the operation when `i1` is false.
> 
> That way, code on the device or in regions that we want to highly optimize can try to hoist these checks as much as possible (as long as reachability can be proved) or drop them under option.
> 
> @vzakhari, what do you think?
@jeanPerier  Since cf.assert does not support the NoMemoryEffect attribute, are you proposing the creation of a new fir.assert dialect that would be used similarly to cf.assert?

https://github.com/llvm/llvm-project/pull/223287


More information about the flang-commits mailing list