forked from OSchip/llvm-project
ca36eb4e33
If we have a pair of binops feeding another pair of binops, rearrange the operands so the matching pair are together because that allows easy factorization folds to happen in instcombine: ((X << S) & Y) & (Z << S) --> ((X << S) & (Z << S)) & Y (reassociation) --> ((X & Z) << S) & Y (factorize shift from 'and' ops optimization) This is part of solving PR37098: https://bugs.llvm.org/show_bug.cgi?id=37098 Note that there's an instcombine version of this patch attached there, but we're trying to make instcombine have less responsibility to improve compile-time efficiency. For reasons I still don't completely understand, reassociate does this kind of transform sometimes, but misses everything in my motivating cases. This patch on its own is gluing an independent cleanup chunk to the end of the existing RewriteExprTree() loop. We can build on it and do something stronger to better order the full expression tree like D40049. That might be an alternative to the proposal to add a separate reassociation pass like D41574. Differential Revision: https://reviews.llvm.org/D45842 llvm-svn: 341288 |
||
---|---|---|
.. | ||
2002-05-15-AgressiveSubMove.ll | ||
2002-05-15-MissedTree.ll | ||
2002-05-15-SubReassociate.ll | ||
2002-07-09-DominanceProblem.ll | ||
2003-08-12-InfiniteLoop.ll | ||
2005-09-01-ArrayOutOfBounds.ll | ||
2006-04-27-ReassociateVector.ll | ||
2011-01-26-UseAfterFree.ll | ||
2012-05-08-UndefLeak.ll | ||
2012-06-08-InfiniteLoop.ll | ||
absorption.ll | ||
add_across_block_crash.ll | ||
basictest.ll | ||
binop-identity.ll | ||
canonicalize-neg-const.ll | ||
commute.ll | ||
crash.ll | ||
crash2.ll | ||
deadcode.ll | ||
erase_inst_made_change.ll | ||
factorize-again.ll | ||
fast-AgressiveSubMove.ll | ||
fast-ArrayOutOfBounds.ll | ||
fast-MissedTree.ll | ||
fast-ReassociateVector.ll | ||
fast-SubReassociate.ll | ||
fast-basictest.ll | ||
fast-fp-commute.ll | ||
fast-mightymul.ll | ||
fast-multistep.ll | ||
fp-commute.ll | ||
fp-expr.ll | ||
infloop-deadphi.ll | ||
inverses.ll | ||
keep-debug-loc.ll | ||
long-chains.ll | ||
looptest.ll | ||
matching-binops.ll | ||
mightymul.ll | ||
min_int.ll | ||
mixed-fast-nonfast-fp.ll | ||
mulfactor.ll | ||
multistep.ll | ||
negation.ll | ||
negation1.ll | ||
no-op.ll | ||
optional-flags.ll | ||
otherops.ll | ||
pr12245.ll | ||
pr21205.ll | ||
pr28367.ll | ||
propagate-flags.ll | ||
reassoc-intermediate-fnegs.ll | ||
reassociate-deadinst.ll | ||
reassociate_dbgvalue_discard.ll | ||
repeats.ll | ||
secondary.ll | ||
shift-factor.ll | ||
shifttest.ll | ||
subtest.ll | ||
vaarg_movable.ll | ||
wrap-flags.ll | ||
xor_reassoc.ll |