https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54272
--- Comment #9 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Looking at the example in c#6 on risc-v:
;; basic block 2, loop depth 0
;; pred: ENTRY
if (a_2(D) == 2147483647)
goto <bb 4>; [12.50%]
else
goto <bb 3>; [87.50%]
;; succ: 4
;; 3
;; basic block 3, loop depth 0
;; pred: 2
_3 = a_2(D) + 1;
;; succ: 4
;; basic block 4, loop depth 0
;; pred: 2
;; 3
# _1 = PHI <a_2(D)(2), _3(3)>
return _1;
It seems like we should have done something like
t = (a_2 == 0x7fffffff);
_1 = a_2 + t;
So feels like gimple if-conversion/phiopt, probably implemented with a match.pd
pattern.