You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In if_(cond, true_branch, false_branch), both branches true_branch and false_branch will be evaluated eagerly (by construction). This can create out-of-bounds accesses. Therefore we have to pass the branches as lamdas. We need to check that lowering respects that and that type inference works for functions in true_branch and false_branch.
The text was updated successfully, but these errors were encountered:
for semantics of itir it doesn't matter what the evaluation order is, but in practice it matters for embedded execution and C++ execution
for embedded execution we can work around by returning whatever (in out of bounds, e.g. NaN) but that might be very slow
we could put unevaluated lambdas in an if_ to make them lazy, but
for C++ we cannot do that because the lambda's in the 2 branches have different type
therefore it seems the only option is to make if_ special in that only the 2nd or 3rd argument must be evaluated.
Other perspective on that problem
We can choose to leave evaluation order open, but then passes that change behavior under a certain evaluation order are not generally applicable. -> 2 choices: leave open and clearly state in each pass under which evaluation order they can be used (which means for which backend) or we fix evaluation order and all backends have to implement the same.
In
if_(cond, true_branch, false_branch)
, both branchestrue_branch
andfalse_branch
will be evaluated eagerly (by construction). This can create out-of-bounds accesses. Therefore we have to pass the branches as lamdas. We need to check that lowering respects that and that type inference works for functions intrue_branch
andfalse_branch
.The text was updated successfully, but these errors were encountered: