summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-15 06:39:41 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-15 06:39:41 +0000
commit1a36b7d836b203ecaa5d91f051e6a6d3aacc6741 (patch)
tree09d3bd57f500e1bf0b06067b633695fd62d141cb /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
parent61fa0dcac30a8d8f8a61fa46361fe30ce3cad97f (diff)
downloadbcm5719-llvm-1a36b7d836b203ecaa5d91f051e6a6d3aacc6741.tar.gz
bcm5719-llvm-1a36b7d836b203ecaa5d91f051e6a6d3aacc6741.zip
[ValueTracking] Replace all uses of ComputeSignBit with computeKnownBits.
This patch finishes off the conversion of ComputeSignBit to computeKnownBits. Differential Revision: https://reviews.llvm.org/D33166 llvm-svn: 303035
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 4939859470f..001a4bcf16f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -1188,9 +1188,8 @@ Instruction *InstCombiner::visitSExt(SExtInst &CI) {
// If we know that the value being extended is positive, we can use a zext
// instead.
- bool KnownZero, KnownOne;
- ComputeSignBit(Src, KnownZero, KnownOne, 0, &CI);
- if (KnownZero) {
+ KnownBits Known = computeKnownBits(Src, 0, &CI);
+ if (Known.isNonNegative()) {
Value *ZExt = Builder->CreateZExt(Src, DestTy);
return replaceInstUsesWith(CI, ZExt);
}
OpenPOWER on IntegriCloud