From eb8d39e11315e689c2ce17b6fc8bcc717a544478 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Sun, 22 Sep 2019 14:31:53 +0000 Subject: [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 --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp') 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; -- cgit v1.2.3