irinterp: Allow setting all IR flags #48993
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, IR_FLAG_NOTHROW is the only flag that irinterp is allowed to set on statements, under the assumption that in order for a call to be irinterp-eligible, it must have been proven :foldable, thus :effect_free, and thus IR_FLAG_EFFECT_FREE was assumed to have been set. That reasoning was sound at the time this code was written, but have since introduced EFFECT_FREE_IF_INACCESSIBLEMEMONLY, which breaks the reasoning that an :effect_free inference for the whole function implies the flag on every statement. As a result, we were failing to DCE otherwise dead statements if the IR came from irinterp.