[PATCH] Add a speculative execution pass
Jingyue Wu
jingyue at google.com
Thu May 7 10:37:35 PDT 2015
LGTM with a minor
================
Comment at: lib/Transforms/Scalar/SpeculativeExecution.cpp:141
@@ +140,3 @@
+ // benchmarking. There is likely room for improvement.
+ switch (Operator::getOpcode(I)) {
+ case Instruction::GetElementPtr:
----------------
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`.
http://reviews.llvm.org/D9360
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list