[PATCH] D63378: [ORC] WIP Speculative compilation
    Lang Hames via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Jun 15 10:24:32 PDT 2019
    
    
  
lhames added inline comments.
================
Comment at: llvm/lib/ExecutionEngine/Orc/Speculation.cpp:90
+            auto RAddr = (*ResSymMap)[Target].getAddress();
+            SpecMap.registerSymbolsWithAddr(std::move(RAddr), likely);
+          } else {
----------------
If I have understood your patch correctly, you could test Dave Blaikie's proof-of-concept speculation idea by issuing a call to:
  SpecMap.speculateFor(RAddr);
You would need to remove the std::move from RAddr on the previous line. JITTargetAddresses are cheap to copy so that's fine to get rid of.
To test that this is really working you could compile a test module:
  void a() {}
  void b() {}
  int main(int argc, char *argv[]) {
    if (argc > 2)
      a();
    else
      b();
    return 0;
  }
If your simple speculator is working you should see modules for both a() and b() pass through your speculation layer when main is called, even though only one will ever be executed.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63378/new/
https://reviews.llvm.org/D63378
    
    
More information about the llvm-commits
mailing list