Skip to content

Commit

Permalink
[LLVM] Create fixed vector size according to latest LLVM12+ changes (#…
Browse files Browse the repository at this point in the history
…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 committed Oct 22, 2020
1 parent 27c45d5 commit ef6e52f
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 ef6e52f

Please sign in to comment.