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

[MC/DC] Refactor: Isolate the final result out of TestVector #82282

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

chapuni
Copy link
Contributor

@chapuni chapuni commented Feb 19, 2024

To reduce conditional judges in the loop in findIndependencePairs(), I have tried a couple of tweaks.

  • Isolate the final result in TestVectors

using TestVectors = llvm::SmallVector<std::pair<TestVector, CondState>>;
The final result was just piggybacked on TestVector, so it has been isolated.

  • Filter out and sort ExecVectors by the final result

It will cost more in constructing ExecVectors, but it can reduce at least one conditional judgement in the loop.

@chapuni chapuni requested a review from ornata February 22, 2024 02:06
@chapuni chapuni marked this pull request as ready for review February 22, 2024 02:06
@chapuni chapuni changed the title Isolate the final result out of TestVectors [MC/DCIsolate the final result out of TestVectors Feb 22, 2024
@chapuni chapuni changed the title [MC/DCIsolate the final result out of TestVectors [MC/DC] Refactor: Isolate the final result out of TestVectors Feb 22, 2024
@chapuni
Copy link
Contributor Author

chapuni commented Feb 22, 2024

I supposed this is the draft for opinion at first time, but I think it better to land in advance of #82174 , to clarify its effect (bitcount expected equal to 1).

@@ -258,6 +258,12 @@ class MCDCRecordProcessor {
/// ExecutedTestVectorBitmap.
MCDCRecord::TestVectors ExecVectors;

/// Temporary use
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expand on this comment a little?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified for ExecVectorsByCond[0] as the storage of the final ExecVectors.

@chapuni chapuni changed the title [MC/DC] Refactor: Isolate the final result out of TestVectors [MC/DC] Refactor: Isolate the final result out of TestVector Feb 27, 2024
@chapuni chapuni merged commit 0ed61db into llvm:main Feb 27, 2024
3 of 4 checks passed
@chapuni chapuni deleted the mcdc/refactor/tvpair branch February 27, 2024 06:33
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.

None yet

2 participants