I looked on code generated for Range Check Elimination and see patters which could be optimized out
1. MaxI compare the same node. It is not optimized because no Ideal optimization done for MaxI, it does not have Ideal() method. Note, MinI has Ideal() method.
479 MaxI === _ 454 454 [[ 442 ]] !orig=[428]
2. When several RCE optimizations done one after an other we can get very complex expressions which use combinations of MaxI and MinI:
MaxI(MinI(X, Y), Y) and MinI(MaxI(X, Y), Y) could be optimized to Y
MaxI(MinI(MaxI(X, Z), Y), Z) could be optimized to MaxI(MinI(X, Y), Z)
1. MaxI compare the same node. It is not optimized because no Ideal optimization done for MaxI, it does not have Ideal() method. Note, MinI has Ideal() method.
479 MaxI === _ 454 454 [[ 442 ]] !orig=[428]
2. When several RCE optimizations done one after an other we can get very complex expressions which use combinations of MaxI and MinI:
MaxI(MinI(X, Y), Y) and MinI(MaxI(X, Y), Y) could be optimized to Y
MaxI(MinI(MaxI(X, Z), Y), Z) could be optimized to MaxI(MinI(X, Y), Z)