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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 15:14:07 PDT 2016


jlebar added inline comments.

================
Comment at: lib/Transforms/Scalar/SpeculativeExecution.cpp:272
@@ +271,3 @@
+
+FunctionPass *createSpeculativeExecutionIfHasBranchDivergencePass() {
+  return new SpeculativeExecution(ONLY_IF_DIVERGENT_ARCH);
----------------
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.


http://reviews.llvm.org/D18625





More information about the llvm-commits mailing list