[flang-commits] [flang] [flang] Implement conditional expressions parser/semantics (F2023) (PR #186489)
via flang-commits
flang-commits at lists.llvm.org
Tue Mar 31 03:25:57 PDT 2026
================
@@ -1193,6 +1210,12 @@ class IsContiguousHelper
Result operator()(const NullPointer &) const { return true; }
+ template <typename T> Result operator()(const ConditionalExpr<T> &x) {
+ // Contiguity is not a meaningful characteristic of a conditional
+ // expression
+ return true;
----------------
jeanPerier wrote:
> Hmm, so (cond ? a(1:10:2) : a(2:10:2)) must always create a contiguous temp. Let's make sure that it does, when we get to lowering.
It is not because IS_CONTIGUOUS returns true for expressions that we have to materialize them in memory. in `x = y(1:10:2) +1`, `IS_CONTIGUOUS(y(1:10:2) +1)` is true and yet we may never create a contiguous temp for `y(1:10:2)+1`.
https://github.com/llvm/llvm-project/pull/186489
More information about the flang-commits
mailing list