aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-02-09 15:19:18 -0800
committerCraig Topper <craig.topper@sifive.com>2023-02-09 15:19:28 -0800
commit68c906811bcb1edfc1a4c73e0fcadb51f7f3e8e3 (patch)
tree9e31ff2c663e60292284cad577065f5569fe5d41 /llvm/lib/Analysis/ValueTracking.cpp
parent5d8da5a208e6501baff7a8fd8de76ea143e49646 (diff)
downloadllvm-68c906811bcb1edfc1a4c73e0fcadb51f7f3e8e3.zip
llvm-68c906811bcb1edfc1a4c73e0fcadb51f7f3e8e3.tar.gz
llvm-68c906811bcb1edfc1a4c73e0fcadb51f7f3e8e3.tar.bz2
[ValueTracking] Replace an always false condition with an assert. NFC
The one caller of this function already checked that V isn't a Constant. Alternatively, we could remove the check from the caller if reviewers prefer. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D143677
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c86a70c..05b802c 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2302,8 +2302,7 @@ static bool isGEPKnownNonNull(const GEPOperator *GEP, unsigned Depth,
static bool isKnownNonNullFromDominatingCondition(const Value *V,
const Instruction *CtxI,
const DominatorTree *DT) {
- if (isa<Constant>(V))
- return false;
+ assert(!isa<Constant>(V) && "Called for constant?");
if (!CtxI || !DT)
return false;