]> granicus.if.org Git - llvm/commitdiff
[Speculation] NFC: more header comments
authorJingyue Wu <jingyue@google.com>
Tue, 19 May 2015 20:52:45 +0000 (20:52 +0000)
committerJingyue Wu <jingyue@google.com>
Tue, 19 May 2015 20:52:45 +0000 (20:52 +0000)
explaining how it differs from SpeculativeExecuteBB in SimplifyCFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237724 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SpeculativeExecution.cpp

index d32e109444284ab4ef41a7f10e5be9731d086005..ff3f00a2e2f85daba2f20d2b2cc5f5630ddb8bfc 100644 (file)
 // 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"