aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-09-02 14:22:54 +0000
committerSanjay Patel <spatel@rotateright.com>2018-09-02 14:22:54 +0000
commitca36eb4e33e487d8ae0e77fd38218a73c8656433 (patch)
tree78e3e00ce7a52cf3d3ef67a5a1a76728de37c15b /llvm/lib/CodeGen/LiveDebugVariables.cpp
parentd7a62444754e095377f84731658b9d8a5ecae471 (diff)
downloadllvm-ca36eb4e33e487d8ae0e77fd38218a73c8656433.zip
llvm-ca36eb4e33e487d8ae0e77fd38218a73c8656433.tar.gz
llvm-ca36eb4e33e487d8ae0e77fd38218a73c8656433.tar.bz2
[Reassociate] swap binop operands to increase factoring potential
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
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions