1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +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); markOverdefined(&I);
else if (OpSt.isConstant()) { else if (OpSt.isConstant()) {
// Fold the constant as we build. // Fold the constant as we build.
Constant *C = ConstantFoldCastOperand( Constant *C = ConstantFoldCastOperand(I.getOpcode(), OpSt.getConstant(),
I.getOpcode(), getValueState(I.getOperand(0)).getConstant(), I.getType(), DL);
I.getType(), DL);
if (isa<UndefValue>(C)) if (isa<UndefValue>(C))
return; return;
// Propagate constant value // Propagate constant value