Merged
Conversation
a2ed2d4 to
70ec51d
Compare
ChrisDodd
previously approved these changes
Mar 23, 2026
Contributor
|
Actaully, looking at this a bit more, while this fixes this case, I'm not sure this is the correct fix overall -- it is fixing the inlining of the duplicated method call by inlining it twice, but the duplication of the method call might be problematic if the method itself contains side effects. |
Not sure it is the right fix -- still reviewing
Contributor
|
See the comment I added to #5549 |
597eb8e to
153bfb9
Compare
ChrisDodd
reviewed
Mar 24, 2026
2ad4a98 to
862f715
Compare
ChrisDodd
approved these changes
Mar 26, 2026
Contributor
Author
|
Thanks @ChrisDodd |
Contributor
|
@MathewZach123 You should be able to remove this line if you rebase: https://github.com/p4lang/p4c/blob/main/backends/p4tools/modules/smith/scripts/compilation-test.sh#L15 |
added 3 commits
March 25, 2026 20:22
Signed-off-by: Mathew Suresh Zachariah <mazachar@pensando.io>
Signed-off-by: Mathew Suresh Zachariah <mazachar@pensando.io>
Signed-off-by: Mathew Suresh Zachariah <mazachar@pensando.io>
862f715 to
ebe84e9
Compare
Signed-off-by: Mathew Suresh Zachariah <mazachar@pensando.io>
ebe84e9 to
56c9d84
Compare
kfcripps
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes #5549 caused due to DAG-cached stale references in FunctionsInliner by modifying DoRemoveActionParameters to handle inout parameters separately. A new ExtractArrayIndices Transform extracts side-effecting array indices into temporary variables before generating copy-in/copy-out, so the function call is evaluated once.
Updated IR for Test 1 (testdata/p4_16_samples/inline-function-to-array-index.p4)
Updated IR for Test 2 (testdata/p4_16_samples/inline-function-to-array-index-chained.p4)