[llvm] d093d34 - [IRCE][NFC] Remove unused variable IsSigned
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 22:16:33 PDT 2023
Author: Max Kazantsev
Date: 2023-04-13T12:08:46+07:00
New Revision: d093d34c33d5ba2faa5430d88d1698304e102da7
URL: https://github.com/llvm/llvm-project/commit/d093d34c33d5ba2faa5430d88d1698304e102da7
DIFF: https://github.com/llvm/llvm-project/commit/d093d34c33d5ba2faa5430d88d1698304e102da7.diff
LOG: [IRCE][NFC] Remove unused variable IsSigned
Patch by Aleksandr Popov!
Differential Revision: https://reviews.llvm.org/D148113
Added:
Modified:
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
index 4629a82ba227..0241b4002b60 100644
--- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
@@ -145,8 +145,7 @@ class InductiveRangeCheck {
Use *CheckUse = nullptr;
static bool parseRangeCheckICmp(Loop *L, ICmpInst *ICI, ScalarEvolution &SE,
- Value *&Index, Value *&Length,
- bool &IsSigned);
+ Value *&Index, Value *&Length);
static void
extractRangeChecksFromCond(Loop *L, ScalarEvolution &SE, Use &ConditionUse,
@@ -291,7 +290,7 @@ INITIALIZE_PASS_END(IRCELegacyPass, "irce", "Inductive range check elimination",
bool
InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
ScalarEvolution &SE, Value *&Index,
- Value *&Length, bool &IsSigned) {
+ Value *&Length) {
auto IsLoopInvariant = [&SE, L](Value *V) {
return SE.isLoopInvariant(SE.getSCEV(V), L);
};
@@ -308,7 +307,6 @@ InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
std::swap(LHS, RHS);
[[fallthrough]];
case ICmpInst::ICMP_SGE:
- IsSigned = true;
if (match(RHS, m_ConstantInt<0>())) {
Index = LHS;
return true; // Lower.
@@ -319,7 +317,6 @@ InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
std::swap(LHS, RHS);
[[fallthrough]];
case ICmpInst::ICMP_SGT:
- IsSigned = true;
if (match(RHS, m_ConstantInt<-1>())) {
Index = LHS;
return true; // Lower.
@@ -336,7 +333,6 @@ InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
std::swap(LHS, RHS);
[[fallthrough]];
case ICmpInst::ICMP_UGT:
- IsSigned = false;
if (IsLoopInvariant(LHS)) {
Index = RHS;
Length = LHS;
@@ -370,8 +366,7 @@ void InductiveRangeCheck::extractRangeChecksFromCond(
return;
Value *Length = nullptr, *Index;
- bool IsSigned;
- if (!parseRangeCheckICmp(L, ICI, SE, Index, Length, IsSigned))
+ if (!parseRangeCheckICmp(L, ICI, SE, Index, Length))
return;
const auto *IndexAddRec = dyn_cast<SCEVAddRecExpr>(SE.getSCEV(Index));
More information about the llvm-commits
mailing list