This PR adds On-Stack Replacement (OSR) for Sulong.
Based on the block based structure of LLVM IR bitcodes, loops are detected and for each loop a new node is created, which conforms to Truffle interface for loop nodes and replaces the basic block which was identified as the header of the loop.
Thus, Graal can replace loops during (interpreted) execution with optimized (compiled) versions, yielding a faster warmup. However, due to additional nodes, peak performance can be negatively affected.
Parameters (with default values) for playing around with OSR:
-Dgraal.TruffleOSR=true ... toggle OSR
-Dgraal.TruffleOSRCompilationThreshold=100000 ... threshold for loop iterations after which a loop is OSR compiled
This PR adds On-Stack Replacement (OSR) for Sulong.
Based on the block based structure of LLVM IR bitcodes, loops are detected and for each loop a new node is created, which conforms to Truffle interface for loop nodes and replaces the basic block which was identified as the header of the loop.
Thus, Graal can replace loops during (interpreted) execution with optimized (compiled) versions, yielding a faster warmup. However, due to additional nodes, peak performance can be negatively affected.
Parameters (with default values) for playing around with OSR: