1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[SCCP] Try to follow the DRY principle, use OpSt.

Thanks to Eli Friedman for pointing out in his post-commit review!

llvm-svn: 275084
This commit is contained in:
Davide Italiano 2016-07-11 18:21:29 +00:00
parent b465fe9970
commit 2f0dd2eaeb

View File

@ -761,9 +761,8 @@ void SCCPSolver::visitCastInst(CastInst &I) {
markOverdefined(&I);
else if (OpSt.isConstant()) {
// Fold the constant as we build.
Constant *C = ConstantFoldCastOperand(
I.getOpcode(), getValueState(I.getOperand(0)).getConstant(),
I.getType(), DL);
Constant *C = ConstantFoldCastOperand(I.getOpcode(), OpSt.getConstant(),
I.getType(), DL);
if (isa<UndefValue>(C))
return;
// Propagate constant value