diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-15 06:39:41 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-15 06:39:41 +0000 |
commit | 1a36b7d836b203ecaa5d91f051e6a6d3aacc6741 (patch) | |
tree | 09d3bd57f500e1bf0b06067b633695fd62d141cb /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | |
parent | 61fa0dcac30a8d8f8a61fa46361fe30ce3cad97f (diff) | |
download | bcm5719-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.cpp | 5 |
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); } |