summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombine.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-12-22 13:36:08 +0000
committerDuncan Sands <baldrick@free.fr>2010-12-22 13:36:08 +0000
commitfbb9ac3cca0d3576d43211a6b3ec0cd5db6ac84d (patch)
tree75c001dfde6c0570ed787c8def96e4415148955a /llvm/lib/Transforms/InstCombine/InstCombine.h
parentaaedf8be1c51285eab4af5bc68f3ca4b95fb85ed (diff)
downloadbcm5719-llvm-fbb9ac3cca0d3576d43211a6b3ec0cd5db6ac84d.tar.gz
bcm5719-llvm-fbb9ac3cca0d3576d43211a6b3ec0cd5db6ac84d.zip
Add a generic expansion transform: A op (B op' C) -> (A op B) op' (A op C)
if both A op B and A op C simplify. This fires fairly often but doesn't make that much difference. On gcc-as-one-file it removes two "and"s and turns one branch into a select. llvm-svn: 122399
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombine.h')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombine.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombine.h b/llvm/lib/Transforms/InstCombine/InstCombine.h
index f89ea508d50..3a58708166d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombine.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombine.h
@@ -290,11 +290,12 @@ private:
/// operators which are associative or commutative.
bool SimplifyAssociativeOrCommutative(BinaryOperator &I);
- /// SimplifyByFactorizing - This tries to simplify binary operations which
- /// some other binary operation distributes over by factorizing out a common
- /// term (eg "(A*B)+(A*C)" -> "A*(B+C)"). Returns the simplified value, or
- /// null if no simplification was performed.
- Instruction *SimplifyByFactorizing(BinaryOperator &I);
+ /// SimplifyUsingDistributiveLaws - This tries to simplify binary operations
+ /// which some other binary operation distributes over either by factorizing
+ /// out common terms (eg "(A*B)+(A*C)" -> "A*(B+C)") or expanding out if this
+ /// results in simplifications (eg: "A & (B | C) -> (A&B) | (A&C)" if this is
+ /// a win). Returns the simplified value, or null if it didn't simplify.
+ Value *SimplifyUsingDistributiveLaws(BinaryOperator &I);
/// SimplifyDemandedUseBits - Attempts to replace V with a simpler value
/// based on the demanded bits.
OpenPOWER on IntegriCloud