Skip to content

Conversation

@jketema
Copy link
Contributor

@jketema jketema commented Jul 10, 2025

No description provided.

@github-actions github-actions bot added the C++ label Jul 10, 2025
not isLikelyDynamicallyChecked(e1)
not isLikelyDynamicallyChecked(e1) and
// Avoid cases in unreachable blocks.
any(EnterFunctionInstruction e).getASuccessor+().getAst() = e1
Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine this transitive closure is sufficiently constrained so that this doesn't matter much, but in case DCA comes back with a performance problem it may be worth doing getASuccessor+() on basic blocks instead of individual instructions since that's much much more efficient (simply because there are a lot fewer basic blocks than there are instructions).

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 didn't see any performance problems, but out of curiosity, how would I rewrite the code in that case?

  any(EnterFunctionInstruction e).getBlock().getASuccessor+() =
    any(Instruction i | i.getAst() = e1).getBlock()

Or is there any easier way?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like that, yeah. Probably with * instead of + to handle the case where e1 is in the same block as the entry point of the function.

@jketema jketema marked this pull request as ready for review July 10, 2025 13:13
@jketema jketema requested a review from a team as a code owner July 10, 2025 13:13
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM!

@MathiasVP MathiasVP merged commit 649c883 into github:main Jul 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants