> yes, that looks not ideal indeed. I wonder if checking for sign_extension is > not too specific and we'd rather want something like > "is the single use of the current SET_DEST inside the BB we transform"? > > That probably has unintended consequences as well, though...
I agree that it’s difficult to predict the side effects of checking only for a single use. On the other hand, in the proposed patch this check is performed only during the first ifcvt pass. We could check for a single use in the first run, and keep the usual behavior for the second one. I’m not entirely sure whether this approach might prevent some other optimizations that run before the second ifcvt pass, but I suspect it could lead to improvements in certain cases. The current version of the patch is quite conservative, but it avoids uncertainty. What do you think would be the best solution? Best, Nikita
