1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[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..
This commit is contained in:
Roman Lebedev 2019-11-08 10:32:56 +03:00
parent 86394fcb63
commit 6703253d58

View File

@ -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));
}