-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[VPlan] Use VPIRMetadata for VPInterleaveRecipe. #153084
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 all commits
f1e79c2
030511c
493fa1d
24e818e
7d047b6
7e6564f
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 |
|---|---|---|
|
|
@@ -1560,6 +1560,19 @@ void VPIRMetadata::applyMetadata(Instruction &I) const { | |
| I.setMetadata(Kind, Node); | ||
| } | ||
|
|
||
| void VPIRMetadata::intersect(const VPIRMetadata &Other) { | ||
| SmallVector<std::pair<unsigned, MDNode *>> MetadataIntersection; | ||
| for (const auto &[KindA, MDA] : Metadata) { | ||
| for (const auto &[KindB, MDB] : Other.Metadata) { | ||
|
||
| if (KindA == KindB && MDA == MDB) { | ||
| MetadataIntersection.emplace_back(KindA, MDA); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| Metadata = std::move(MetadataIntersection); | ||
| } | ||
|
|
||
| void VPWidenCallRecipe::execute(VPTransformState &State) { | ||
| assert(State.VF.isVector() && "not widening"); | ||
| assert(Variant != nullptr && "Can't create vector function."); | ||
|
|
@@ -3575,6 +3588,8 @@ void VPInterleaveRecipe::execute(VPTransformState &State) { | |
| } else | ||
| NewLoad = State.Builder.CreateAlignedLoad(VecTy, ResAddr, | ||
| Group->getAlign(), "wide.vec"); | ||
| applyMetadata(*NewLoad); | ||
| // TODO: Also manage existing metadata using VPIRMetadata. | ||
| Group->addMetadata(NewLoad); | ||
|
|
||
| ArrayRef<VPValue *> VPDefs = definedValues(); | ||
|
|
@@ -3677,6 +3692,8 @@ void VPInterleaveRecipe::execute(VPTransformState &State) { | |
| NewStoreInstr = | ||
| State.Builder.CreateAlignedStore(IVec, ResAddr, Group->getAlign()); | ||
|
|
||
| applyMetadata(*NewStoreInstr); | ||
| // TODO: Also manage existing metadata using VPIRMetadata. | ||
| Group->addMetadata(NewStoreInstr); | ||
| } | ||
|
|
||
|
|
||
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.
If we're passing
this(even if to pass its inherited metadata), suffice to pass only it, as in copy constructor?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.
We could, but that would mean adding another constructor that is only used by clone?
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.
Ok, then perhaps a trivial
getMetadata()would help this look better than passingthisto essentially a copy constructor along with a bunch of other redundant parameters.