diff options
author | Sanjay Patel <spatel@rotateright.com> | 2020-05-22 11:37:58 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2020-05-22 11:46:59 -0400 |
commit | 2f7c24fe303f09308f1032515379f0abf20c5f90 (patch) | |
tree | f1090283e492d68c34dbd98f09e60d6f0f4e477c /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | b603794061f651695b155a0456a701d0ad82e8f4 (diff) | |
download | llvm-2f7c24fe303f09308f1032515379f0abf20c5f90.zip llvm-2f7c24fe303f09308f1032515379f0abf20c5f90.tar.gz llvm-2f7c24fe303f09308f1032515379f0abf20c5f90.tar.bz2 |
[InstCombine] (A + B) + B --> A + (B << 1)
This eliminates a use of 'B', so it can enable follow-on transforms
as well as improve analysis/codegen.
The PhaseOrdering test was added for D61726, and that shows
the limits of instcombine vs. real reassociation. We would
need to run some form of CSE to collapse that further.
The intermediate variable naming here is intentional because
there's a test at llvm/test/Bitcode/value-with-long-name.ll
that would break with the usual nameless value. I'm not sure
how to improve that test to be more robust.
The naming may also be helpful to debug regressions if this
change exposes weaknesses in the reassociation pass for example.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
0 files changed, 0 insertions, 0 deletions