Le 09/05/2024 à 10:47, HAO CHEN GUI a écrit :
Hi Mikael,
Thanks for your comments.
在 2024/5/9 16:03, Mikael Morin 写道:
I think the canonical API behaviour sets R to varying and returns true instead
of just returning false if nothing is known about the range.
I'm not sure whether it makes any difference; Aldy can probably tell. But if
the type is bool, varying is [0,1] which is better than unknown range.
Should the varying be set by caller when fold_range returns false?
Just like following codes in value-query.cc.
if (!op.fold_range (r, type, r0, r1))
r.set_varying (type);
Err, well, that's a good question.
Looking more closely, there are at least two operators in range-op.cc
that follow this pattern of returning false and letting the caller
handle. And in gimple-range-op.cc many more of them, so your patch is
canonical enough in any case, sorry for the false alarm.
Thanks
Gui Haochen