[PATCH] Add a speculative execution pass

Bjarke Hammersholt Roune broune at google.com
Thu May 7 21:19:49 PDT 2015


================
Comment at: lib/Transforms/Scalar/SpeculativeExecution.cpp:141
@@ +140,3 @@
+  // benchmarking. There is likely room for improvement.
+  switch (Operator::getOpcode(I)) {
+    case Instruction::GetElementPtr:
----------------
jingyue wrote:
> broune wrote:
> > jingyue wrote:
> > > Should we consider `ConstantExpr` free? 
> > Do you mean should we return 0 if all operands to an instruction are ConstantExpr? I'd think most such cases would be folded already, though maybe not for GEP, since I believe that it's required for changing types, so that does seem reasonable to catch.
> I was thinking of the case where `I` is a `ConstantExpr` because `I` is a `User` which can be `Instruction` or `ConstantExpr`. However, I later noticed you only call `ComputeSpeculationCost` with instructions. So we should make this function to more restrictively take only `Instruction`. 
Done.

http://reviews.llvm.org/D9360

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






More information about the llvm-commits mailing list