diff options
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 17e11724183..f02cf0a55bd 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -531,7 +531,7 @@ static std::string getDebugLocString(const Loop *L) { /// \brief Propagate known metadata from one instruction to another. static void propagateMetadata(Instruction *To, const Instruction *From) { - SmallVector<std::pair<unsigned, MDNode *>, 4> Metadata; + SmallVector<std::pair<unsigned, Value *>, 4> Metadata; From->getAllMetadataOtherThanDebugLoc(Metadata); for (auto M : Metadata) { diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 73767b46a36..5771582896d 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -188,12 +188,12 @@ static void propagateIRFlags(Value *I, ArrayRef<Value *> VL) { /// \returns \p I after propagating metadata from \p VL. static Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL) { Instruction *I0 = cast<Instruction>(VL[0]); - SmallVector<std::pair<unsigned, MDNode *>, 4> Metadata; + SmallVector<std::pair<unsigned, Value *>, 4> Metadata; I0->getAllMetadataOtherThanDebugLoc(Metadata); for (unsigned i = 0, n = Metadata.size(); i != n; ++i) { unsigned Kind = Metadata[i].first; - MDNode *MD = Metadata[i].second; + MDNode *MD = cast_or_null<MDNode>(Metadata[i].second); for (int i = 1, e = VL.size(); MD && i != e; i++) { Instruction *I = cast<Instruction>(VL[i]); |