aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-09-29 10:35:51 +0200
committerNikita Popov <npopov@redhat.com>2023-09-29 10:38:12 +0200
commit15b687131f52ad3cc4fcb93abe73b77e680b79bf (patch)
treec91bd502abbd496084102d9cc470e2b92ee86cc1 /llvm/lib/Analysis/ScalarEvolution.cpp
parent02eb38119eda7c060a6b96a1169fd2b98992b617 (diff)
downloadllvm-15b687131f52ad3cc4fcb93abe73b77e680b79bf.zip
llvm-15b687131f52ad3cc4fcb93abe73b77e680b79bf.tar.gz
llvm-15b687131f52ad3cc4fcb93abe73b77e680b79bf.tar.bz2
[SCEV] Remove unnecessary cast code (NFC)
The types should always match here. Possibly this is a leftover from pre-opaque-pointers times.
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 5a994ae..7c234fa 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -9941,10 +9941,7 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) {
Constant *C = BuildConstantFromSCEV(OpV);
if (!C)
return V;
- if (C->getType() != Op->getType())
- C = ConstantExpr::getCast(
- CastInst::getCastOpcode(C, false, Op->getType(), false), C,
- Op->getType());
+ assert(C->getType() == Op->getType() && "Type mismatch");
Operands.push_back(C);
}