-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[VPlan] Make VPReductionRecipe a VPRecipeWithIRFlags. NFC #130881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ElvisWang123
merged 13 commits into
llvm:main
from
ElvisWang123:change-VPReductionRecipe-inherit-from-VPRecipeWithIRFlags
Mar 18, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9a0e4d7
[VPlan] Passing non-null instruction when creating VPReductionRecipe …
ElvisWang123 087a533
[VPlan] Change parent of VPReductionRecipe to VPRecipeWithIRFlags. NFC
ElvisWang123 6be4c38
!fixup, formating.
ElvisWang123 d60f933
!fixup, independent from #130880.
ElvisWang123 07b5790
!fixup, Address comments.
ElvisWang123 48454c6
!fixup, Update comments.
ElvisWang123 36b40fc
!fixup, Add description of the assertion.
ElvisWang123 0473b05
!fixup, Set FMF for VPReductionRecipe in ctor directly.
ElvisWang123 942a14d
!fixup, Remove unneeded checks and check undelryingInstr is FPMO or not.
ElvisWang123 abd65e9
!fixup, Remove FMF from recipes after add checks of underlying instru…
ElvisWang123 e7d6f55
Merge branch 'main' into change-VPReductionRecipe-inherit-from-VPReci…
ElvisWang123 6c6ccb2
!fixup, Only set FMF for FMOperators and update after merge main.
ElvisWang123 ad67b8d
Merge branch 'main' into change-VPReductionRecipe-inherit-from-VPReci…
ElvisWang123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not major but if we add back the isa check then we remove the diff for the integer reduction test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it back the prevent integer reduction test changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we end up with integer reductions with FMFs set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand an integer RecurrenceDescriptor has all fast math flags set:
llvm-project/llvm/lib/Analysis/IVDescriptors.cpp
Lines 286 to 288 in 6eb32a2
So currently today an integer VPReductionRecipe will use a builder with all fast math flags set:
IRBuilderBase::FastMathFlagGuard FMFGuard(State.Builder); State.Builder.setFastMathFlags(RdxDesc.getFastMathFlags());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but we shouldn't further propagate incorrect flags to VPReductionRecipe. We should probably check if it is a FP reduction on construction, and if it isn't set empty (fast-math) flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I think @ElvisWang123 had already done something similar in a previous version of this PR like
in the constructor. Should that be done as a part of this PR or in a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be done straight away, I added a suggested edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed checks, thanks!