Skip to content

Commit 42b6c8e

Browse files
committed
[ValueTracking] Convert isKnownNegative() to use SimplifyQuery (NFC)
It looks like this function is actually unused.
1 parent d6e8f3b commit 42b6c8e

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,8 @@ bool isKnownPositive(const Value *V, const SimplifyQuery &SQ,
148148

149149
/// Returns true if the given value is known be negative (i.e. non-positive
150150
/// and non-zero).
151-
bool isKnownNegative(const Value *V, const DataLayout &DL, unsigned Depth = 0,
152-
AssumptionCache *AC = nullptr,
153-
const Instruction *CxtI = nullptr,
154-
const DominatorTree *DT = nullptr,
155-
bool UseInstrInfo = true);
151+
bool isKnownNegative(const Value *V, const SimplifyQuery &DL,
152+
unsigned Depth = 0);
156153

157154
/// Return true if the given values are known to be non-equal when defined.
158155
/// Supports scalar integer types only.

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,9 @@ bool llvm::isKnownPositive(const Value *V, const SimplifyQuery &SQ,
291291
return isKnownNonNegative(V, SQ, Depth) && ::isKnownNonZero(V, Depth, SQ);
292292
}
293293

294-
bool llvm::isKnownNegative(const Value *V, const DataLayout &DL, unsigned Depth,
295-
AssumptionCache *AC, const Instruction *CxtI,
296-
const DominatorTree *DT, bool UseInstrInfo) {
297-
KnownBits Known = computeKnownBits(V, DL, Depth, AC, CxtI, DT, UseInstrInfo);
298-
return Known.isNegative();
294+
bool llvm::isKnownNegative(const Value *V, const SimplifyQuery &SQ,
295+
unsigned Depth) {
296+
return computeKnownBits(V, Depth, SQ).isNegative();
299297
}
300298

301299
static bool isKnownNonEqual(const Value *V1, const Value *V2, unsigned Depth,

0 commit comments

Comments
 (0)