-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[VPlan] Replace ExtractFromEnd with Extract(Last|Penultimate)Element (NFC). #137030
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
Changes from 5 commits
876f977
80d1d0e
65178dd
20740c7
e5ecd86
1a5a728
733f4b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -337,16 +337,18 @@ void UnrollState::unrollBlock(VPBlockBase *VPB) { | |||||||
| continue; | ||||||||
| } | ||||||||
| VPValue *Op0; | ||||||||
| if (match(&R, m_VPInstruction<VPInstruction::ExtractFromEnd>( | ||||||||
| m_VPValue(Op0), m_VPValue(Op1)))) { | ||||||||
| if (match(&R, m_VPInstruction<VPInstruction::ExtractLastElement>( | ||||||||
| m_VPValue(Op0))) || | ||||||||
| match(&R, m_VPInstruction<VPInstruction::ExtractPenultimateElement>( | ||||||||
| m_VPValue(Op0)))) { | ||||||||
| addUniformForAllParts(cast<VPSingleDefRecipe>(&R)); | ||||||||
| if (Plan.hasScalarVFOnly()) { | ||||||||
| // Extracting from end with VF = 1 implies retrieving the scalar part UF | ||||||||
| // - Op1. | ||||||||
| auto *I = cast<VPInstruction>(&R); | ||||||||
| // Extracting from end with VF = 1 implies retrieving retrieving the | ||||||||
|
||||||||
| // Extracting from end with VF = 1 implies retrieving retrieving the | |
| // Extracting from end with VF = 1 implies retrieving the |
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.
Trying to simplify:
| unsigned Offset = | |
| auto *I = dyn_cast<VPInstruction>(&R); // Place above for reuse. Similar to H below. | |
| unsigned Offset = I->getOpcode() == VPInstruction::ExtractLast ? 1 : 2; |
consistent with how VPInstruction::generate() computes Offset?
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.
done, using cast, thanks
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.
Handle simpler vector VF case first?
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.
Can do separately, leaving as-is for now to not pull in unrelated changes.