From: Jingyue Wu Date: Tue, 19 May 2015 20:52:45 +0000 (+0000) Subject: [Speculation] NFC: more header comments X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31d2ee7360cc28c2ca6c9ebb69deb4a21035ab05;p=llvm [Speculation] NFC: more header comments 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 --- diff --git a/lib/Transforms/Scalar/SpeculativeExecution.cpp b/lib/Transforms/Scalar/SpeculativeExecution.cpp index d32e1094442..ff3f00a2e2f 100644 --- a/lib/Transforms/Scalar/SpeculativeExecution.cpp +++ b/lib/Transforms/Scalar/SpeculativeExecution.cpp @@ -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"