Skip to content

Remove constant folding in Painless user tree#52783

Merged
jdconrad merged 5 commits intoelastic:masterfrom
jdconrad:trees10
Feb 26, 2020
Merged

Remove constant folding in Painless user tree#52783
jdconrad merged 5 commits intoelastic:masterfrom
jdconrad:trees10

Conversation

@jdconrad
Copy link
Copy Markdown
Contributor

This change removes constant folding from the Painless user tree. This accomplishes two goals. The first is to remove all optimizations from the user tree which will at a later time become optimization phases for the ir tree. The second is to make the user tree immutable, and this is a step toward that since we will no longer remove/modify/replace nodes in the user tree during the process of constant folding.

One important note is that the conditional promotion code has changed, since the promoteConditional method considered constants (similarly to the JVM spec) that are now removed, but this code path was unreachable to begin with so the constants were never actually used to determine the appropriate promotion.

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0 labels Feb 25, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@jdconrad
Copy link
Copy Markdown
Contributor Author

Relates to #49869

Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

@jdconrad jdconrad merged commit f6d89ae into elastic:master Feb 26, 2020
@jdconrad
Copy link
Copy Markdown
Contributor Author

@rjernst @stu-elastic Thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants