Skip to content

Commit ef61fd5

Browse files
author
Krzysztof Parzyszek
authored
[LLVM] Use ArrayRef<int> 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.
1 parent d327787 commit ef61fd5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/target/llvm/codegen_llvm.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ llvm::Value* CodeGenLLVM::CreateVecSlice(llvm::Value* vec, int begin, int extent
491491

492492
llvm::Value* CodeGenLLVM::CreateVecFlip(llvm::Value* vec) {
493493
int num_elems = static_cast<int>(vec->getType()->getVectorNumElements());
494+
#if TVM_LLVM_VERSION >= 110
495+
std::vector<int> indices;
496+
#else
494497
std::vector<unsigned> indices;
498+
#endif
495499
for (int i = 0; i < num_elems; ++i) {
496500
indices.push_back(num_elems - i - 1);
497501
}
@@ -531,7 +535,11 @@ llvm::Value* CodeGenLLVM::CreateVecConcat(std::vector<llvm::Value*> vecs) {
531535
rhs = CreateVecPad(rhs, lhs_lanes);
532536
}
533537
const size_t shared_lanes = std::max(lhs_lanes, rhs_lanes);
538+
#if TVM_LLVM_VERSION >= 110
539+
std::vector<int> mask;
540+
#else
534541
std::vector<unsigned> mask;
542+
#endif
535543
for (size_t i = 0; i < lhs_lanes; ++i) {
536544
mask.push_back(i);
537545
}
@@ -872,7 +880,11 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) {
872880
llvm::Value *v0 = MakeValue(op->args[0]);
873881
llvm::Value *v1 = MakeValue(op->args[1]);
874882
int num_elems = static_cast<int>(v0->getType()->getVectorNumElements()) * 2;
883+
#if TVM_LLVM_VERSION >= 110
884+
std::vector<int> indices;
885+
#else
875886
std::vector<unsigned> indices;
887+
#endif
876888
for (int i = 0; i < num_elems; ++i) {
877889
indices.push_back(i);
878890
}

0 commit comments

Comments
 (0)