From: Noah Goldstein Date: Tue, 6 Jun 2023 19:07:30 +0000 (-0500) Subject: [InstCombine] Remove deadcode in `(icmp SignTest(shl/shr X))`; NFC X-Git-Tag: upstream/17.0.6~5937 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e387f49d133de0e43c390ea3b7020a7decd2eed3;p=platform%2Fupstream%2Fllvm.git [InstCombine] Remove deadcode in `(icmp SignTest(shl/shr X))`; NFC This is dead as of: D145341 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D152181 --- diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index e80d69c..0865de3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2251,11 +2251,6 @@ Instruction *InstCombinerImpl::foldICmpShlConstant(ICmpInst &Cmp, APInt ShiftedC = (C - 1).ashr(*ShiftAmt) + 1; return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); } - // If this is a signed comparison to 0 and the shift is sign preserving, - // use the shift LHS operand instead; isSignTest may change 'Pred', so only - // do that if we're sure to not continue on in this function. - if (isSignTest(Pred, C)) - return new ICmpInst(Pred, X, Constant::getNullValue(ShType)); } // NUW guarantees that we are only shifting out zero bits from the high bits,