You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2020/04/22 02:11:36 UTC

[incubator-tvm] branch master updated: [LLVM] Use ArrayRef in calls to CreateShuffleVector (#5399)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new ef61fd5  [LLVM] Use ArrayRef<int> in calls to CreateShuffleVector (#5399)
ef61fd5 is described below

commit ef61fd5049eaee6f780fcff5069910fb202ad84c
Author: Krzysztof Parzyszek <kp...@quicinc.com>
AuthorDate: Tue Apr 21 21:11:28 2020 -0500

    [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.
---
 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 820a20c..a8b0d0e 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<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);
   }
@@ -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);
       }
@@ -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);
     }