Skip to content

Commit ca56966

Browse files
committed
[VPlan] Properly retain flags when cloning VPReplicateRecipe.
This makes sure the correct flags are used for the clone (i.e. the ones present on the recipe), instead of the ones on the original IR instruction. At the moment, this should not change anything, as flags of replicate recipe should not be dropped before they are cloned at the moment. But that will change in a follow-up patch.
1 parent f82e080 commit ca56966

File tree

1 file changed

+5
-2
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+5
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,8 +2085,11 @@ class VPReplicateRecipe : public VPRecipeWithIRFlags {
20852085
~VPReplicateRecipe() override = default;
20862086

20872087
VPRecipeBase *clone() override {
2088-
return new VPReplicateRecipe(getUnderlyingInstr(), operands(), IsUniform,
2089-
isPredicated() ? getMask() : nullptr);
2088+
auto *Copy =
2089+
new VPReplicateRecipe(getUnderlyingInstr(), operands(), IsUniform,
2090+
isPredicated() ? getMask() : nullptr);
2091+
Copy->transferFlags(*this);
2092+
return Copy;
20902093
}
20912094

20922095
VP_CLASSOF_IMPL(VPDef::VPReplicateSC)

0 commit comments

Comments
 (0)