JDK-8147394 : CastIINode::Ideal() should be more generic
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2016-01-14
  • Updated: 2017-04-07
  • Resolved: 2017-04-07
Related Reports
Relates :  
Relates :  
Description
JDK-8145322 introduced CastIINode::Ideal() doing the following optimization:
  // (CastII (AddI x const)) -> (AddI (CastII x) const)

JDK-6675699 modified ConvI2LNode::Ideal() to also match:
 // ConvI2L(CastII(AddI(x, y))) to AddL(ConvI2L(CastII(x)), ConvI2L(CastII(y)))

By making CastIINode::Ideal() more generic, the ConvI2L changes can be removed. Investigation also showed that the CastII optimization helps to clean up the graph and merge branches during loop optimizations. This could be improved by making it more generic.