diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-15 05:28:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-15 05:28:29 +0000 |
commit | 2ba3b621495b89f45521e627554a40a9885899e7 (patch) | |
tree | 753768a5b0ca524696f1759720ac467a36315f90 /lib | |
parent | 3af23f8aba9ac28fe5a8646f57c2c307a35c1e4d (diff) | |
download | external_llvm-2ba3b621495b89f45521e627554a40a9885899e7.zip external_llvm-2ba3b621495b89f45521e627554a40a9885899e7.tar.gz external_llvm-2ba3b621495b89f45521e627554a40a9885899e7.tar.bz2 |
Enable Load PRE. This teaches GVN to push partially redundant loads up the
CFG when there is exactly one predecessor where the load is not available.
This is designed to not increase code size but still eliminate partially
redundant loads. This fires 1765 times on 403.gcc even though it doesn't
do critical edge splitting yet (the most common reason for it to fail).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 3662424..75584de 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -48,7 +48,7 @@ STATISTIC(NumPRELoad, "Number of loads PRE'd"); static cl::opt<bool> EnablePRE("enable-pre", cl::init(true), cl::Hidden); -cl::opt<bool> EnableLoadPRE("enable-load-pre"/*, cl::init(true)*/); +cl::opt<bool> EnableLoadPRE("enable-load-pre", cl::init(true)); //===----------------------------------------------------------------------===// // ValueTable Class @@ -957,6 +957,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI, if (Deps.size() > 100) return false; + // If we had a phi translation failure, we'll have a single entry which is a + // clobber in the current block. Reject this early. + if (Deps.size() == 1 && Deps[0].second.isClobber()) + return false; + // Filter out useless results (non-locals, etc). Keep track of the blocks // where we have a value available in repl, also keep track of whether we see // dependencies that produce an unknown value for the load (such as a call |