Skip to content

Commit

Permalink
[InstSimplify] Use cast instead of dyn_cast+assert. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Sep 30, 2023
1 parent 94189e1 commit abcaebf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3949,8 +3949,7 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
// Turn icmp (sext X), Cst into a compare of X and Cst if Cst is extended
// too. If not, then try to deduce the result of the comparison.
else if (match(RHS, m_ImmConstant())) {
Constant *C = dyn_cast<Constant>(RHS);
assert(C != nullptr);
Constant *C = cast<Constant>(RHS);

// Compute the constant that would happen if we truncated to SrcTy then
// reextended to DstTy.
Expand Down

0 comments on commit abcaebf

Please sign in to comment.