Skip to content

C++: Support overriding existing simple range analysis bounds#4273

Merged
jbj merged 3 commits intogithub:mainfrom
lcartey:cpp/custom-range-analysis-override
Sep 22, 2020
Merged

C++: Support overriding existing simple range analysis bounds#4273
jbj merged 3 commits intogithub:mainfrom
lcartey:cpp/custom-range-analysis-override

Conversation

@lcartey
Copy link
Contributor

@lcartey lcartey commented Sep 15, 2020

Currently, if you provide a custom SimpleRangeAnalysisExpr for an expression which is already supported by the range analysis library, you get both the custom and in-built ranges. This means that it is impossible to restrict the range with a customization. This PR therefore changes the library to exclude any expression identified by a SimpleRangeAnalysisExpr from the default range analysis calculation.

/cc @jbj

The current support only allows the user to supply bounds for previously
unsupported expressions or for variable accesses. This commit allows
SimpleRangeAnalysisExprs to override built-in range definitions.
@lcartey lcartey requested a review from a team as a code owner September 15, 2020 14:48
@github-actions github-actions bot added the C++ label Sep 15, 2020
@jbj jbj self-assigned this Sep 17, 2020
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

LGTM. I tested performance locally, and this PR makes no difference at all when the SimpleRangeAnalysisExpr is empty -- the QL compiles to the exact same RA code.

I've pushed an autoformat fix.

@jbj jbj merged commit 269b710 into github:main Sep 22, 2020
@lcartey lcartey deleted the cpp/custom-range-analysis-override branch September 22, 2020 19:14
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.

2 participants

Comments