From e387f49d133de0e43c390ea3b7020a7decd2eed3 Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Tue, 6 Jun 2023 14:07:30 -0500 Subject: [PATCH] [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 --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 5 ----- 1 file changed, 5 deletions(-) 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, -- 2.7.4