[PATCH] Add a speculative execution pass

Bjarke Hammersholt Roune broune at google.com
Thu May 14 17:22:21 PDT 2015


================
Comment at: include/llvm/Transforms/Scalar.h:426
@@ -425,1 +425,3 @@
 //
+// SpeculativeExecution - Speculatively execute instructions.
+//
----------------
hfinkel wrote:
> Please reword like this:
> 
>   // SpeculativeExecution - Aggressively hoist instructions to enable speculatively execution on targets where branches are expensive.
> 
> (the import part here is that the verb is 'hoist', not 'execute').
Done, thank you for the clarification.

================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:236
@@ +235,3 @@
+  if (RunSpeculation)
+    MPM.add(createSpeculativeExecutionPass());
+
----------------
hfinkel wrote:
> How exactly do you intend this to work? There are two or three options:
> 
>  1. Don't put it in the standard pipeline (assuming that GPU-compilers have their own pipelines anyway and will use it in those custom pipelines only).
> 
>  2. Add some TTI hook to control whether or not the pass does anything.
> 
>  3. Add a variable to the pass manager controlling this (so that the frontend must decide).
> 
> I prefer (2), but just leaving it here, as a something intended to be dead (except for use of some command-line flag) is not a reasonable plan. The command-line flags are for debugging and testing, not for production pass-manager control.
> 
I removed the flag and the code it controls, going for option 1 for now. Let me know if anyone interested in this pass needs another option.

http://reviews.llvm.org/D9360

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






More information about the llvm-commits mailing list