summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit54c683f9e7bf4a67e31ed7a9ecdbb872082f7f8a (patch)
tree78d1a7ded457c5485d4aca63b15eabaa7028f896 /llvm/lib
parent3c04f8d79019dd78967520c47692ebf6aaa5fe4c (diff)
downloadbcm5719-llvm-54c683f9e7bf4a67e31ed7a9ecdbb872082f7f8a.tar.gz
bcm5719-llvm-54c683f9e7bf4a67e31ed7a9ecdbb872082f7f8a.zip
[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. llvm-svn: 289147
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 32f486744f5..2c1364d77cf 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/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:
OpenPOWER on IntegriCloud