summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/ConstantRange.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-11-08 10:32:56 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2019-11-08 10:32:56 +0300
commit72a21ad6c9cdbb41c8f17de2318fa469c013caef (patch)
treeb200aed558a1ceac763050f12faf985f857476bc /llvm/lib/IR/ConstantRange.cpp
parente0ea842baec00b6bf6dc0069f1c1961da5889927 (diff)
downloadbcm5719-llvm-72a21ad6c9cdbb41c8f17de2318fa469c013caef.tar.gz
bcm5719-llvm-72a21ad6c9cdbb41c8f17de2318fa469c013caef.zip
[CR] ConstantRange::sshl_sat(): check sigdness of the min/max, not ranges
This was pointed out in review, but forgot to stage this change into the commit itself..
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r--llvm/lib/IR/ConstantRange.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp
index 63a6494fc17..e9bdf419352 100644
--- a/llvm/lib/IR/ConstantRange.cpp
+++ b/llvm/lib/IR/ConstantRange.cpp
@@ -1348,8 +1348,8 @@ ConstantRange ConstantRange::sshl_sat(const ConstantRange &Other) const {
APInt Min = getSignedMin(), Max = getSignedMax();
APInt ShAmtMin = Other.getUnsignedMin(), ShAmtMax = Other.getUnsignedMax();
- APInt NewL = Min.sshl_sat(isAllNonNegative() ? ShAmtMin : ShAmtMax);
- APInt NewU = Max.sshl_sat(isAllNegative() ? ShAmtMin : ShAmtMax) + 1;
+ APInt NewL = Min.sshl_sat(Min.isNonNegative() ? ShAmtMin : ShAmtMax);
+ APInt NewU = Max.sshl_sat(Max.isNegative() ? ShAmtMin : ShAmtMax) + 1;
return getNonEmpty(std::move(NewL), std::move(NewU));
}
OpenPOWER on IntegriCloud