[llvm] e5abd96 - [VPlan] Remove VPTransformState::addMetadata with ArrayRef arg (NFCI).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 3 01:43:26 PDT 2024
Author: Florian Hahn
Date: 2024-04-03T09:43:12+01:00
New Revision: e5abd963c758bcfa1380d688bec31dddc834a2dd
URL: https://github.com/llvm/llvm-project/commit/e5abd963c758bcfa1380d688bec31dddc834a2dd
DIFF: https://github.com/llvm/llvm-project/commit/e5abd963c758bcfa1380d688bec31dddc834a2dd.diff
LOG: [VPlan] Remove VPTransformState::addMetadata with ArrayRef arg (NFCI).
addMeadata is only over called with a single element, clean up the
variant that takes multiple values.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 9a8f53c8dbe441..f0b7008992d7bf 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -358,23 +358,14 @@ void VPTransformState::addNewMetadata(Instruction *To,
LVer->annotateInstWithNoAlias(To, Orig);
}
-void VPTransformState::addMetadata(Instruction *To, Instruction *From) {
+void VPTransformState::addMetadata(Value *To, Instruction *From) {
// No source instruction to transfer metadata from?
if (!From)
return;
- propagateMetadata(To, From);
- addNewMetadata(To, From);
-}
-
-void VPTransformState::addMetadata(ArrayRef<Value *> To, Instruction *From) {
- // No source instruction to transfer metadata from?
- if (!From)
- return;
-
- for (Value *V : To) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- addMetadata(I, From);
+ if (Instruction *ToI = dyn_cast<Instruction>(To)) {
+ propagateMetadata(ToI, From);
+ addNewMetadata(ToI, From);
}
}
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 707a826ecdc256..813ebda29ffd90 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -346,11 +346,7 @@ struct VPTransformState {
/// This includes both the original MDs from \p From and additional ones (\see
/// addNewMetadata). Use this for *newly created* instructions in the vector
/// loop.
- void addMetadata(Instruction *To, Instruction *From);
-
- /// Similar to the previous function but it adds the metadata to a
- /// vector of instructions.
- void addMetadata(ArrayRef<Value *> To, Instruction *From);
+ void addMetadata(Value *To, Instruction *From);
/// Set the debug location in the builder using the debug location \p DL.
void setDebugLocFrom(DebugLoc DL);
More information about the llvm-commits
mailing list