diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-12-09 18:39:32 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-12-09 18:39:32 +0000 |
commit | fb494914779d4e2b86b038a1491138d305e46789 (patch) | |
tree | a2d3d2e3ced8ad76719bb8128792c26d767d85a7 /clang/lib/CodeGen/CGLoopInfo.cpp | |
parent | 5bf8fef58013e2c97180236fa6973faa40435d5f (diff) | |
download | bcm5719-llvm-fb494914779d4e2b86b038a1491138d305e46789.tar.gz bcm5719-llvm-fb494914779d4e2b86b038a1491138d305e46789.zip |
IR: Update clang for Metadata/Value split in r223802
Match LLVM API changes from r223802.
llvm-svn: 223803
Diffstat (limited to 'clang/lib/CodeGen/CGLoopInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGLoopInfo.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGLoopInfo.cpp b/clang/lib/CodeGen/CGLoopInfo.cpp index a273f1d4dda..89f43c28159 100644 --- a/clang/lib/CodeGen/CGLoopInfo.cpp +++ b/clang/lib/CodeGen/CGLoopInfo.cpp @@ -24,40 +24,39 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) { Attrs.VectorizerEnable == LoopAttributes::VecUnspecified) return nullptr; - SmallVector<Value *, 4> Args; + SmallVector<Metadata *, 4> Args; // Reserve operand 0 for loop id self reference. MDNode *TempNode = MDNode::getTemporary(Ctx, None); Args.push_back(TempNode); // Setting vectorizer.width if (Attrs.VectorizerWidth > 0) { - Value *Vals[] = { MDString::get(Ctx, "llvm.loop.vectorize.width"), - ConstantInt::get(Type::getInt32Ty(Ctx), - Attrs.VectorizerWidth) }; + Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.vectorize.width"), + ConstantAsMetadata::get(ConstantInt::get( + Type::getInt32Ty(Ctx), Attrs.VectorizerWidth))}; Args.push_back(MDNode::get(Ctx, Vals)); } // Setting vectorizer.unroll if (Attrs.VectorizerUnroll > 0) { - Value *Vals[] = { MDString::get(Ctx, "llvm.loop.interleave.count"), - ConstantInt::get(Type::getInt32Ty(Ctx), - Attrs.VectorizerUnroll) }; + Metadata *Vals[] = {MDString::get(Ctx, "llvm.loop.interleave.count"), + ConstantAsMetadata::get(ConstantInt::get( + Type::getInt32Ty(Ctx), Attrs.VectorizerUnroll))}; Args.push_back(MDNode::get(Ctx, Vals)); } // Setting vectorizer.enable if (Attrs.VectorizerEnable != LoopAttributes::VecUnspecified) { - Value *Vals[] = { MDString::get(Ctx, "llvm.loop.vectorize.enable"), - ConstantInt::get(Type::getInt1Ty(Ctx), - (Attrs.VectorizerEnable == - LoopAttributes::VecEnable)) }; + Metadata *Vals[] = { + MDString::get(Ctx, "llvm.loop.vectorize.enable"), + ConstantAsMetadata::get(ConstantInt::get( + Type::getInt1Ty(Ctx), + (Attrs.VectorizerEnable == LoopAttributes::VecEnable)))}; Args.push_back(MDNode::get(Ctx, Vals)); } - MDNode *LoopID = MDNode::get(Ctx, Args); - assert(LoopID->use_empty() && "LoopID should not be used"); - // Set the first operand to itself. + MDNode *LoopID = MDNode::get(Ctx, Args); LoopID->replaceOperandWith(0, LoopID); MDNode::deleteTemporary(TempNode); return LoopID; |