From 20e996378d37dcb5c9b5edd42556ad79208a047e Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Tue, 21 Apr 2020 21:11:28 -0500 Subject: [PATCH] [LLVM] Use ArrayRef in calls to CreateShuffleVector (#5399) This switch was made in LLVM 11. Previously this function was expecting mask indices of type uint32_t. This variant is now deprecated. --- src/target/llvm/codegen_llvm.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc index 820a20c802fb..a8b0d0e0ce2d 100644 --- a/src/target/llvm/codegen_llvm.cc +++ b/src/target/llvm/codegen_llvm.cc @@ -491,7 +491,11 @@ llvm::Value* CodeGenLLVM::CreateVecSlice(llvm::Value* vec, int begin, int extent llvm::Value* CodeGenLLVM::CreateVecFlip(llvm::Value* vec) { int num_elems = static_cast(vec->getType()->getVectorNumElements()); +#if TVM_LLVM_VERSION >= 110 + std::vector indices; +#else std::vector indices; +#endif for (int i = 0; i < num_elems; ++i) { indices.push_back(num_elems - i - 1); } @@ -531,7 +535,11 @@ llvm::Value* CodeGenLLVM::CreateVecConcat(std::vector vecs) { rhs = CreateVecPad(rhs, lhs_lanes); } const size_t shared_lanes = std::max(lhs_lanes, rhs_lanes); +#if TVM_LLVM_VERSION >= 110 + std::vector mask; +#else std::vector mask; +#endif for (size_t i = 0; i < lhs_lanes; ++i) { mask.push_back(i); } @@ -872,7 +880,11 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) { llvm::Value *v0 = MakeValue(op->args[0]); llvm::Value *v1 = MakeValue(op->args[1]); int num_elems = static_cast(v0->getType()->getVectorNumElements()) * 2; +#if TVM_LLVM_VERSION >= 110 + std::vector indices; +#else std::vector indices; +#endif for (int i = 0; i < num_elems; ++i) { indices.push_back(i); }