summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-12-08 22:28:53 +0000
committerDavide Italiano <davide@freebsd.org>2016-12-08 22:28:53 +0000
commita47129de893b3452da0006399603a6ef5620b7c1 (patch)
tree3e6bc99c9c8f2ecb2e15c7e3639900582236adaf /lib/Transforms/Scalar/SCCP.cpp
parentb99cfea3784c2c586832346ab5933d0f92fc9535 (diff)
[SCCP] Make sure SCCP and ConstantFolding agree on undef >> a.
Currently SCCP folds the value to -1, while ConstantProp folds to 0. This changes SCCP to do what ConstantFolding does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 32f486744f5..2c1364d77cf 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1396,8 +1396,8 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) {
break;
}
- // undef >>a X -> all ones
- markForcedConstant(&I, Constant::getAllOnesValue(ITy));
+ // undef >>a X -> 0
+ markForcedConstant(&I, Constant::getNullValue(ITy));
return true;
case Instruction::LShr:
case Instruction::Shl: