summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-09-16 16:15:25 +0000
committerSanjay Patel <spatel@rotateright.com>2019-09-16 16:15:25 +0000
commit3961a143e13a9cd7fdfec74a9f26e86117618708 (patch)
tree90078434a6591896a5a0ab29503ba1df01f5b2bf /llvm/lib/Transforms
parent4d9d0f9cf532ec40f07178693f1c37049c18bc79 (diff)
downloadbcm5719-llvm-3961a143e13a9cd7fdfec74a9f26e86117618708.tar.gz
bcm5719-llvm-3961a143e13a9cd7fdfec74a9f26e86117618708.zip
[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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 5c443faf2f2..e569ae866b5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3697,11 +3697,8 @@ Instruction *InstCombiner::foldICmpBinOp(ICmpInst &I) {
C == Op0 ? D : C);
// icmp (A+B), (A+D) -> icmp B, D for equalities or if there is no overflow.
- // TODO: The one-use checks should not be necessary.
if (A && C && (A == C || A == D || B == C || B == D) && NoOp0WrapProblem &&
- NoOp1WrapProblem &&
- // Try not to increase register pressure.
- BO0->hasOneUse() && BO1->hasOneUse()) {
+ NoOp1WrapProblem) {
// Determine Y and Z in the form icmp (X+Y), (X+Z).
Value *Y, *Z;
if (A == C) {
OpenPOWER on IntegriCloud