From c9f5b8b7fac5621675d61ba77a42a4d8df8b8995 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Thu, 22 Oct 2020 13:43:52 -0500 Subject: [PATCH] [LLVM] Create fixed vector size according to latest LLVM12+ changes (#6717) The vector handling code in LLVM keeps evolving to accommodate scalable vectors. As a result, code related to vector sizes changes quite often. --- src/target/llvm/codegen_llvm.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc index cb04e6b8055b1..40ec2cc9e0b83 100644 --- a/src/target/llvm/codegen_llvm.cc +++ b/src/target/llvm/codegen_llvm.cc @@ -475,7 +475,9 @@ llvm::Value* CodeGenLLVM::CreateBroadcast(llvm::Value* value, int lanes) { llvm::Constant* undef = llvm::UndefValue::get(type); llvm::Constant* zero = ConstInt32(0); value = builder_->CreateInsertElement(undef, value, zero); -#if TVM_LLVM_VERSION >= 110 +#if TVM_LLVM_VERSION >= 120 + llvm::Constant* mask = llvm::ConstantVector::getSplat(llvm::ElementCount::getFixed(lanes), zero); +#elif TVM_LLVM_VERSION >= 110 llvm::Constant* mask = llvm::ConstantVector::getSplat(llvm::ElementCount(lanes, /*Scalable=*/false), zero); #else