[llvm] r275084 - [SCCP] Try to follow the DRY principle, use `OpSt`.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 11 11:21:29 PDT 2016
Author: davide
Date: Mon Jul 11 13:21:29 2016
New Revision: 275084
URL: http://llvm.org/viewvc/llvm-project?rev=275084&view=rev
Log:
[SCCP] Try to follow the DRY principle, use `OpSt`.
Thanks to Eli Friedman for pointing out in his post-commit review!
Modified:
llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=275084&r1=275083&r2=275084&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Mon Jul 11 13:21:29 2016
@@ -761,9 +761,8 @@ void SCCPSolver::visitCastInst(CastInst
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
More information about the llvm-commits
mailing list