diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-09-22 14:31:53 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-09-22 14:31:53 +0000 |
commit | eb8d39e11315e689c2ce17b6fc8bcc717a544478 (patch) | |
tree | 26c84649f8f5dedd0dadb8fe3066a0fb49604b55 /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | |
parent | d2a524288d11b760138199d8a63175c49ab8376a (diff) | |
download | bcm5719-llvm-eb8d39e11315e689c2ce17b6fc8bcc717a544478.tar.gz bcm5719-llvm-eb8d39e11315e689c2ce17b6fc8bcc717a544478.zip |
[InstCombine] allow icmp+binop folds before min/max bailout (PR43310)
This has the potential to uncover missed analysis/folds as shown in the
min/max code comment/test, but fewer restrictions on icmp folds should
be better in general to solve cases like:
https://bugs.llvm.org/show_bug.cgi?id=43310
llvm-svn: 372510
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index e569ae866b5..5bafab49032 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -5394,6 +5394,9 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (Instruction *Res = foldICmpWithDominatingICmp(I)) return Res; + if (Instruction *Res = foldICmpBinOp(I)) + return Res; + if (Instruction *Res = foldICmpUsingKnownBits(I)) return Res; @@ -5471,9 +5474,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (Instruction *R = foldICmpWithCastOp(I)) return R; - if (Instruction *Res = foldICmpBinOp(I)) - return Res; - if (Instruction *Res = foldICmpWithMinMax(I)) return Res; |