diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-09-16 12:54:34 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-09-16 12:54:34 +0000 |
| commit | c5cd80815666f535ffc37cd582e7576a29ba6816 (patch) | |
| tree | e9dd00ad01a2fee1bef0c8592e1a76b89ccaa16b /llvm/lib/Transforms | |
| parent | 72b9c4f3bcea2a87580551afa96ad9f68c7cae38 (diff) | |
| download | bcm5719-llvm-c5cd80815666f535ffc37cd582e7576a29ba6816.tar.gz bcm5719-llvm-c5cd80815666f535ffc37cd582e7576a29ba6816.zip | |
[InstCombine] remove unneeded one-use checks for icmp fold
This fold and several others were added in:
rL125734 <https://reviews.llvm.org/rL125734>
...with no explanation for the one-use checks other than the code
comments about register pressure.
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 is a related patch in this series.
llvm-svn: 371981
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index a7732c475b4..5c443faf2f2 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -3849,10 +3849,7 @@ Instruction *InstCombiner::foldICmpBinOp(ICmpInst &I) { return new ICmpInst(Pred, A, C); // icmp (A-B), (A-D) -> icmp D, B for equalities or if there is no overflow. - // TODO: The one-use checks should not be necessary. - if (A && C && A == C && NoOp0WrapProblem && NoOp1WrapProblem && - // Try not to increase register pressure. - BO0->hasOneUse() && BO1->hasOneUse()) + if (A && C && A == C && NoOp0WrapProblem && NoOp1WrapProblem) return new ICmpInst(Pred, D, B); // icmp (0-X) < cst --> x > -cst |

