[PATCH] Add a speculative execution pass

Bjarke Hammersholt Roune broune at google.com
Thu Apr 30 14:45:17 PDT 2015


In http://reviews.llvm.org/D9360#163642, @majnemer wrote:

> It seems this pass has a good deal in common with SimplifyCFG.  How is this
>  pass different from bumping up the cost threshold in that pass?


I assume you are referring to the functionality in the function SpeculativelyExecuteBB in SimplifyCFG. As I read what it does, SimplifyCFG will not speculate if no selects are introduced and it will speculate at most one instruction. It also will not speculate if there is a value defined in the if-block that is only used in the then-block. These restrictions make sense since the speculation in SimplifyCFG seems aimed at introducing cheap selects, while this pass is intended to do more aggressive speculation while counting on later passes to either capitalize on that or clean it up.

What this pass does could be merged into SimplifyCFG, though at first look it doesn't appear to me to be an easy fit. We'd also need two different configurations of SimplifyCFG since aggressive speculation at every point where SimplifyCFG runs would probably be too much; I've experimented with adding this pass in multiple places simultaneously and that hasn't yielded good results so far.


http://reviews.llvm.org/D9360

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list