[PATCH] D18625: [Speculation] Add a SpeculativeExecution mode where the pass does nothing unless TTI::hasBranchDivergence() is true.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 15:34:41 PDT 2016


joker.eph added a subscriber: joker.eph.

================
Comment at: lib/Transforms/Scalar/SpeculativeExecution.cpp:272
@@ +271,3 @@
+
+FunctionPass *createSpeculativeExecutionIfHasBranchDivergencePass() {
+  return new SpeculativeExecution(ONLY_IF_DIVERGENT_ARCH);
----------------
jlebar wrote:
> tra wrote:
> > Could we pass an argument to createSpeculativeExecutionPass() instead of encoding it in the name?
> We could, although I wouldn't want it to be a boolean; see my (by now quite old) rant about this: http://jlebar.com/2011/12/16/Boolean_parameters_to_API_functions_considered_harmful..html
> 
> I figured it wasn't worth exposing an enum into the llvm namespace, but if that's preferred, I can do it.
Offtopic: I'm so glad to see your blog post entry. I'd had the same argument on a patch review once on llvm-commits! I'm trying to avoid it as much as possible.


http://reviews.llvm.org/D18625





More information about the llvm-commits mailing list