[InstCombine] remove unneeded one-use checks for icmp fold
commitac10676315e368fff69a9c0c6292bdd856a7eb35
authorSanjay Patel <spatel@rotateright.com>
Mon, 16 Sep 2019 16:15:25 +0000 (16 16:15 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 16 Sep 2019 16:15:25 +0000 (16 16:15 +0000)
tree1be0732a9b94602b0dc73c7cf948bc0fe661afb9
parent1526a5235bb4997ea3b270f2ff35a434fcf61fc4
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372007 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/icmp-add.ll