[llvm] r237724 - [Speculation] NFC: more header comments

Jingyue Wu jingyue at google.com
Tue May 19 13:52:45 PDT 2015


Author: jingyue
Date: Tue May 19 15:52:45 2015
New Revision: 237724

URL: http://llvm.org/viewvc/llvm-project?rev=237724&view=rev
Log:
[Speculation] NFC: more header comments

explaining how it differs from SpeculativeExecuteBB in SimplifyCFG.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp?rev=237724&r1=237723&r2=237724&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp Tue May 19 15:52:45 2015
@@ -41,6 +41,15 @@
 // Later passes sink back much of the speculated code that did not enable
 // further optimization.
 //
+// This pass is more aggressive than the function SpeculativeyExecuteBB in
+// SimplifyCFG. SimplifyCFG will not speculate if no selects are introduced and
+// it will speculate at most one instruction. It also will not speculate if
+// there is a value defined in the if-block that is only used in the then-block.
+// These restrictions make sense since the speculation in SimplifyCFG seems
+// aimed at introducing cheap selects, while this pass is intended to do more
+// aggressive speculation while counting on later passes to either capitalize on
+// that or clean it up.
+//
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/SmallSet.h"





More information about the llvm-commits mailing list