Skip to content

Commit 4e96020

Browse files
author
git apple-llvm automerger
committed
Merge commit 'e5abd963c758' from llvm.org/main into next
2 parents 2e8b1bd + e5abd96 commit 4e96020

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -358,23 +358,14 @@ void VPTransformState::addNewMetadata(Instruction *To,
358358
LVer->annotateInstWithNoAlias(To, Orig);
359359
}
360360

361-
void VPTransformState::addMetadata(Instruction *To, Instruction *From) {
361+
void VPTransformState::addMetadata(Value *To, Instruction *From) {
362362
// No source instruction to transfer metadata from?
363363
if (!From)
364364
return;
365365

366-
propagateMetadata(To, From);
367-
addNewMetadata(To, From);
368-
}
369-
370-
void VPTransformState::addMetadata(ArrayRef<Value *> To, Instruction *From) {
371-
// No source instruction to transfer metadata from?
372-
if (!From)
373-
return;
374-
375-
for (Value *V : To) {
376-
if (Instruction *I = dyn_cast<Instruction>(V))
377-
addMetadata(I, From);
366+
if (Instruction *ToI = dyn_cast<Instruction>(To)) {
367+
propagateMetadata(ToI, From);
368+
addNewMetadata(ToI, From);
378369
}
379370
}
380371

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,7 @@ struct VPTransformState {
346346
/// This includes both the original MDs from \p From and additional ones (\see
347347
/// addNewMetadata). Use this for *newly created* instructions in the vector
348348
/// loop.
349-
void addMetadata(Instruction *To, Instruction *From);
350-
351-
/// Similar to the previous function but it adds the metadata to a
352-
/// vector of instructions.
353-
void addMetadata(ArrayRef<Value *> To, Instruction *From);
349+
void addMetadata(Value *To, Instruction *From);
354350

355351
/// Set the debug location in the builder using the debug location \p DL.
356352
void setDebugLocFrom(DebugLoc DL);

0 commit comments

Comments
 (0)