Skip to content

Commit d81963f

Browse files
committed
Update interface and remove repetitive operations.
1 parent c6d09f1 commit d81963f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8781,12 +8781,10 @@ static SelectPatternResult matchSelectPattern(CmpInst::Predicate Pred,
87818781
return matchFastFloatClamp(Pred, CmpLHS, CmpRHS, TrueVal, FalseVal, LHS, RHS);
87828782
}
87838783

8784-
static Value *lookThroughCastConst(CmpInst *CmpI, CastInst *Cast1, Constant *C,
8784+
static Value *lookThroughCastConst(CmpInst *CmpI, Type *SrcTy, Constant *C,
87858785
Instruction::CastOps *CastOp) {
8786-
Type *SrcTy = Cast1->getSrcTy();
87878786
const DataLayout &DL = CmpI->getDataLayout();
87888787

8789-
*CastOp = Cast1->getOpcode();
87908788
Constant *CastedTo = nullptr;
87918789
switch (*CastOp) {
87928790
case Instruction::ZExt:
@@ -8895,7 +8893,7 @@ static Value *lookThroughCast(CmpInst *CmpI, Value *V1, Value *V2,
88958893

88968894
auto *C = dyn_cast<Constant>(V2);
88978895
if (C)
8898-
return lookThroughCastConst(CmpI, Cast1, C, CastOp);
8896+
return lookThroughCastConst(CmpI, SrcTy, C, CastOp);
88998897

89008898
Value *CastedTo = nullptr;
89018899
if (*CastOp == Instruction::Trunc) {

0 commit comments

Comments
 (0)