[InstCombine] remove unneeded one-use checks for icmp fold
authorSanjay Patel <spatel@rotateright.com>
Mon, 16 Sep 2019 16:15:25 +0000 (16:15 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 16 Sep 2019 16:15:25 +0000 (16:15 +0000)
commit3961a143e13a9cd7fdfec74a9f26e86117618708
tree90078434a6591896a5a0ab29503ba1df01f5b2bf
parent4d9d0f9cf532ec40f07178693f1c37049c18bc79
[InstCombine] remove unneeded one-use checks for icmp fold

Related folds were added in:
rL125734
...the code comment about register pressure is discussed in
more detail in:
https://bugs.llvm.org/show_bug.cgi?id=2698

But 10 years later, perf testing bzip2 with this change now
shows a slight (0.2% average) improvement on Haswell although
that's probably within test noise.

Given that this is IR canonicalization, we shouldn't be worried
about register pressure though; the backend should be able to
adjust for that as needed.

This is part of solving PR43310 the theoretically right way:
https://bugs.llvm.org/show_bug.cgi?id=43310
...ie, if we don't cripple basic transforms, then we won't
need to add special-case code to detect larger patterns.

rL371940 and rL371981 are related patches in this series.

llvm-svn: 372007
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-add.ll