[PATCH] D66399: [ORCv2] - New Speculate Query Implementation

Praveen velliengiri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 18 14:21:04 PDT 2019


pree-jackie created this revision.
pree-jackie added reviewers: lhames, dblaikie.
pree-jackie added a project: Speculative Compilation in ORC.
Herald added subscribers: llvm-commits, mgrang, hiraditya, mgorny.
Herald added a project: LLVM.

This patch introduces, SequenceBBQuery - new heuristic to find likely next callable functions it tries to find the blocks with calls in order of execution sequence of Blocks.

It still uses BlockFrequencyAnalysis to find high frequency blocks. For a handful of hottest blocks (plan to customize), the algorithm traverse and discovered the caller blocks along the way to Entry Basic Block and Exit Basic Block. It uses Block Hint, to stop traversing the already visited blocks in both direction. It implicitly assumes that once the block is visited during discovering entry or exit nodes, revisiting them again does not add much. It also branch probability info (cached result) to traverse only hot edges (planned to customize) from hot blocks. Without BPI, the algorithm mostly return's all the blocks in the CFG with calls.

It also changes the heuristic queries, so they don't maintain states. Hence it is safe to call from multiple threads.

It also implements, new instrumentation to avoid jumping into JIT on every call to the function with the help _orc_speculate.decision.block and _orc_speculate.block.

"Speculator Registration Mechanism is also changed" - kudos to @lhames

Open to review, mostly looking to change implementation of SequeceBBQuery heuristics with good data structure choices.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66399

Files:
  llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp
  llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
  llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
  llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
  llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp
  llvm/lib/ExecutionEngine/Orc/Speculation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66399.215796.patch
Type: text/x-patch
Size: 21371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190818/8575dec8/attachment.bin>


More information about the llvm-commits mailing list