Skip to content

Commit f5a812f

Browse files
committed
fix from comment
1 parent 673a41d commit f5a812f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7808,12 +7808,9 @@ VPRecipeBase *VPRecipeBuilder::tryToWidenMemory(Instruction *I,
78087808

78097809
auto *Store = cast<StoreInst>(I);
78107810
VPValue *StoredVal = Operands[0];
7811-
if (Reverse) {
7812-
auto *ReverseR = new VPInstruction(VPInstruction::Reverse, {StoredVal},
7813-
Store->getDebugLoc());
7814-
Builder.insert(ReverseR);
7815-
StoredVal = ReverseR;
7816-
}
7811+
if (Reverse)
7812+
StoredVal = Builder.createNaryOp(VPInstruction::Reverse, StoredVal,
7813+
Store->getDebugLoc());
78177814
return new VPWidenStoreRecipe(*Store, Ptr, StoredVal, Mask, Consecutive,
78187815
Reverse, VPIRMetadata(*Store, LVer),
78197816
Store->getDebugLoc());

0 commit comments

Comments
 (0)