summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-30 20:53:04 +0000
committerOwen Anderson <resistor@mac.com>2010-09-30 20:53:04 +0000
commit722cc1f41413530e15a46eb940ce68330647ff27 (patch)
tree93e4fedd8a2c8354f16daddd4e6d6640e708e4f1 /lib/Transforms
parent7eb589d3f9294dbfe4d5205045bd8119a9666532 (diff)
downloadllvm-722cc1f41413530e15a46eb940ce68330647ff27.tar.gz
llvm-722cc1f41413530e15a46eb940ce68330647ff27.tar.bz2
llvm-722cc1f41413530e15a46eb940ce68330647ff27.tar.xz
We do want to allow LoadPRE to perform LICM-like transformations: we already consider PHI nodes to be negligible for
code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always a good thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index de99c3f8b6..f1272d4956 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1545,19 +1545,6 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
assert(TmpBB);
LoadBB = TmpBB;
- // If we have a repl set with LI itself in it, this means we have a loop where
- // at least one of the values is LI. Since this means that we won't be able
- // to eliminate LI even if we insert uses in the other predecessors, we will
- // end up increasing code size. Reject this by scanning for LI.
- for (unsigned i = 0, e = ValuesPerBlock.size(); i != e; ++i) {
- if (ValuesPerBlock[i].isSimpleValue() &&
- ValuesPerBlock[i].getSimpleValue() == LI) {
- // Skip cases where LI is the only definition, even for EnableFullLoadPRE.
- if (!EnableFullLoadPRE || e == 1)
- return false;
- }
- }
-
// FIXME: It is extremely unclear what this loop is doing, other than
// artificially restricting loadpre.
if (isSinglePred) {