ControlHeightReduction (CHR) clones the code region to reduce the branches in the hot code path. The number of clones is linear to the depth of the region.
Currently it does not have control over the code size increase. We are seeing one ~9000 BB functions get expanded to ~250000 BBs, an 25x increase.
This creates a big compile time issue for the downstream optimizations.
This patch adds a cap for number of clones for one region.
add comment