Skip to content
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

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Fix coverity issues #4967

merged 2 commits into from
Oct 22, 2024

Conversation

anmyachev
Copy link
Contributor

No description provided.

Signed-off-by: Anatoly Myachev <[email protected]>
@anmyachev anmyachev requested a review from ptillet as a code owner October 22, 2024 12:28
@@ -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,
Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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!

@@ -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);
Copy link
Contributor Author

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]>
etiotto pushed a commit to intel/intel-xpu-backend-for-triton that referenced this pull request Oct 22, 2024
In the upstream: triton-lang/triton#4967

---------

Signed-off-by: Anatoly Myachev <[email protected]>
@Jokeren Jokeren enabled auto-merge (squash) October 22, 2024 14:41
@Jokeren Jokeren merged commit ed39cb0 into triton-lang:main Oct 22, 2024
7 checks passed
@anmyachev anmyachev deleted the cov-fixes branch October 22, 2024 14:59
Luosuu pushed a commit to Luosuu/triton that referenced this pull request Nov 13, 2024
guacamoleo pushed a commit to guacamoleo/triton that referenced this pull request Nov 14, 2024
bertmaher pushed a commit to bertmaher/triton that referenced this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants