summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombine.h
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2013-01-07 18:37:41 +0000
committerQuentin Colombet <qcolombet@apple.com>2013-01-07 18:37:41 +0000
commit3b2db0bcd3977761e852394738b58d0c5941fe4a (patch)
tree8addf7f671460a80c4fcfdccd06e6594cd3a5d0f /llvm/lib/Transforms/InstCombine/InstCombine.h
parent28cacc740d8065423b9a60e6feae998a3ecac9d9 (diff)
downloadbcm5719-llvm-3b2db0bcd3977761e852394738b58d0c5941fe4a.tar.gz
bcm5719-llvm-3b2db0bcd3977761e852394738b58d0c5941fe4a.zip
When code size is the priority (Oz, MinSize attribute), help llvm
turning a code like this: if (foo) free(foo) into that: free(foo) Move a call to free from basic block FB into FB's predecessor, P, when the path from P to FB is taken only if the argument of free is not equal to NULL. Some restrictions apply on P and FB to be sure that this code motion is profitable. Namely: 1. FB must have only one predecessor P. 2. FB must contain only the call to free plus an unconditional branch to S. 3. P's successors are FB and S. Because of 1., we will not increase the code size when moving the call to free from FB to P. Because of 2., FB will be empty after the move. Because of 2. and 3., P's branch instruction becomes useless, so as FB (simplifycfg will do the job). llvm-svn: 171762
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombine.h')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombine.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombine.h b/llvm/lib/Transforms/InstCombine/InstCombine.h
index a207bce0d5d..38c636462cf 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombine.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombine.h
@@ -76,6 +76,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombiner
TargetLibraryInfo *TLI;
bool MadeIRChange;
LibCallSimplifier *Simplifier;
+ bool MinimizeSize;
public:
/// Worklist - All of the instructions that need to be simplified.
InstCombineWorklist Worklist;
@@ -87,6 +88,7 @@ public:
static char ID; // Pass identification, replacement for typeid
InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {
+ MinimizeSize = false;
initializeInstCombinerPass(*PassRegistry::getPassRegistry());
}
OpenPOWER on IntegriCloud