-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix coverity issues #4967
Fix coverity issues #4967
Conversation
Signed-off-by: Anatoly Myachev <[email protected]>
@@ -128,8 +128,8 @@ static void AddPartialReduce(SmallVector<SmallVector<Value>> &srcValues, | |||
ConversionPatternRewriter &rewriter, | |||
const TargetInfoBase &targetInfo, | |||
ScanLoweringHelper &helper, | |||
SmallVector<Value> smemBases, | |||
SmallVector<Type> smemTypes, Value warpId, | |||
const SmallVector<Value> &smemBases, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverity suggests to use std::move(smemBases)
when calling this function, but it looks like smemBases
(as well as smemTypes
) doesn't change inside the function, so I decided to change the signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make them ArrayRef
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for the review @Jokeren!
lib/Analysis/AxisInfo.cpp
Outdated
@@ -895,7 +895,7 @@ class ShLIOpAxisInfoVisitor final : public BinaryOpVisitorImpl<arith::ShLIOp> { | |||
lhsDivisibility = 1; | |||
} | |||
auto numBits = log2Int(lhsDivisibility); | |||
return multiplyDivisor(lhsDivisibility, 1 << shift); | |||
return multiplyDivisor(lhsDivisibility, static_cast<int64_t>(1) << shift); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The context expects an expression of type int64_t
for the second argument, so I use static_cast
to avoid using 32-bit arithmetic.
Signed-off-by: Anatoly Myachev <[email protected]>
In the upstream: triton-lang/triton#4967 --------- Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
No description provided.