Skip to content

[Bolt][PVS] Fix passing incorrect argument as default to isStoreUsed #118040

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexErofeev
Copy link
Contributor

@AlexErofeev AlexErofeev commented Nov 29, 2024

Fixes first issue out of listed in #116944
Given number of times this method is called, maybe it would make sense to force specifying this parameters explicitly?

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the BOLT label Nov 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 29, 2024

@llvm/pr-subscribers-bolt

Author: None (AlexErofeev)

Changes

Fixes first issue out listed in #116944
Given number of times this method is called, maybe it would make sense to force specifying this parameters explicitly?


Full diff: https://github.com/llvm/llvm-project/pull/118040.diff

1 Files Affected:

  • (modified) bolt/lib/Passes/ShrinkWrapping.cpp (+2-2)
diff --git a/bolt/lib/Passes/ShrinkWrapping.cpp b/bolt/lib/Passes/ShrinkWrapping.cpp
index 176321c58dc903..bc4e7e6e386a0e 100644
--- a/bolt/lib/Passes/ShrinkWrapping.cpp
+++ b/bolt/lib/Passes/ShrinkWrapping.cpp
@@ -78,8 +78,8 @@ void CalleeSavedAnalysis::analyzeSaves() {
         // probably dealing with a parameter passed in a stack -- do not mess
         // with it
         if (SRU.isStoreUsed(*FIE,
-                            Prev ? SRU.expr_begin(*Prev) : SRU.expr_begin(BB)),
-            /*IncludeLocalAccesses=*/false) {
+                            Prev ? SRU.expr_begin(*Prev) : SRU.expr_begin(BB),
+            /*IncludeLocalAccesses=*/false)) {
           BlacklistedRegs.set(FIE->RegOrImm);
           CalleeSaved.reset(FIE->RegOrImm);
           Prev = &Inst;

@aaupov
Copy link
Contributor

aaupov commented Nov 29, 2024

Duplicate of #117156

If you feel like it, please look into the test failure

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff d648eed5899c4be10f1f7866eebef2bc171e673f 12051664b649a8c83703a617c3f6408b128f538e --extensions cpp -- bolt/lib/Passes/ShrinkWrapping.cpp
View the diff from clang-format here.
diff --git a/bolt/lib/Passes/ShrinkWrapping.cpp b/bolt/lib/Passes/ShrinkWrapping.cpp
index bc4e7e6e38..8fcd8d5c68 100644
--- a/bolt/lib/Passes/ShrinkWrapping.cpp
+++ b/bolt/lib/Passes/ShrinkWrapping.cpp
@@ -79,7 +79,7 @@ void CalleeSavedAnalysis::analyzeSaves() {
         // with it
         if (SRU.isStoreUsed(*FIE,
                             Prev ? SRU.expr_begin(*Prev) : SRU.expr_begin(BB),
-            /*IncludeLocalAccesses=*/false)) {
+                            /*IncludeLocalAccesses=*/false)) {
           BlacklistedRegs.set(FIE->RegOrImm);
           CalleeSaved.reset(FIE->RegOrImm);
           Prev = &Inst;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants