Skip to content

Commit

Permalink
[LLVM] Create fixed vector size according to latest LLVM12+ changes (a…
Browse files Browse the repository at this point in the history
…pache#6717)

The vector handling code in LLVM keeps evolving to accommodate scalable
vectors. As a result, code related to vector sizes changes quite often.
  • Loading branch information
Krzysztof Parzyszek authored and trevor-m committed Dec 4, 2020
1 parent bec9562 commit 69aafde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69aafde

Please sign in to comment.