Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVM] Use ArrayRef<int> in calls to CreateShuffleVector #5399

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(vec->getType()->getVectorNumElements());
#if TVM_LLVM_VERSION >= 110
std::vector<int> indices;
#else
std::vector<unsigned> indices;
#endif
for (int i = 0; i < num_elems; ++i) {
indices.push_back(num_elems - i - 1);
}
Expand Down Expand Up @@ -531,7 +535,11 @@ llvm::Value* CodeGenLLVM::CreateVecConcat(std::vector<llvm::Value*> vecs) {
rhs = CreateVecPad(rhs, lhs_lanes);
}
const size_t shared_lanes = std::max(lhs_lanes, rhs_lanes);
#if TVM_LLVM_VERSION >= 110
std::vector<int> mask;
#else
std::vector<unsigned> mask;
#endif
for (size_t i = 0; i < lhs_lanes; ++i) {
mask.push_back(i);
}
Expand Down Expand Up @@ -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<int>(v0->getType()->getVectorNumElements()) * 2;
#if TVM_LLVM_VERSION >= 110
std::vector<int> indices;
#else
std::vector<unsigned> indices;
#endif
for (int i = 0; i < num_elems; ++i) {
indices.push_back(i);
}
Expand Down