Skip to content

Commit edea974

Browse files
committed
[ValueTracking] Avoid FP cast constant expressions
Use the constant folding API instead.
1 parent 046c57e commit edea974

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7880,22 +7880,22 @@ static Value *lookThroughCast(CmpInst *CmpI, Value *V1, Value *V2,
78807880
}
78817881
break;
78827882
case Instruction::FPTrunc:
7883-
CastedTo = ConstantExpr::getFPExtend(C, SrcTy, true);
7883+
CastedTo = ConstantFoldCastOperand(Instruction::FPExt, C, SrcTy, DL);
78847884
break;
78857885
case Instruction::FPExt:
7886-
CastedTo = ConstantExpr::getFPTrunc(C, SrcTy, true);
7886+
CastedTo = ConstantFoldCastOperand(Instruction::FPTrunc, C, SrcTy, DL);
78877887
break;
78887888
case Instruction::FPToUI:
7889-
CastedTo = ConstantExpr::getUIToFP(C, SrcTy, true);
7889+
CastedTo = ConstantFoldCastOperand(Instruction::UIToFP, C, SrcTy, DL);
78907890
break;
78917891
case Instruction::FPToSI:
7892-
CastedTo = ConstantExpr::getSIToFP(C, SrcTy, true);
7892+
CastedTo = ConstantFoldCastOperand(Instruction::SIToFP, C, SrcTy, DL);
78937893
break;
78947894
case Instruction::UIToFP:
7895-
CastedTo = ConstantExpr::getFPToUI(C, SrcTy, true);
7895+
CastedTo = ConstantFoldCastOperand(Instruction::FPToUI, C, SrcTy, DL);
78967896
break;
78977897
case Instruction::SIToFP:
7898-
CastedTo = ConstantExpr::getFPToSI(C, SrcTy, true);
7898+
CastedTo = ConstantFoldCastOperand(Instruction::FPToSI, C, SrcTy, DL);
78997899
break;
79007900
default:
79017901
break;

0 commit comments

Comments
 (0)