diff --git a/src/target/llvm/codegen_llvm.cc b/src/target/llvm/codegen_llvm.cc index 5085c1e40b78..41437f86362f 100644 --- a/src/target/llvm/codegen_llvm.cc +++ b/src/target/llvm/codegen_llvm.cc @@ -625,19 +625,6 @@ llvm::Value* CodeGenLLVM::GetConstString(const std::string& str) { } llvm::Value* CodeGenLLVM::CreateBufferPtr(DataType t, llvm::Value* buffer, llvm::Value* index) { - CHECK_EQ(t.lanes(), 1); - llvm::PointerType* btype = llvm::dyn_cast(buffer->getType()); - CHECK(btype != nullptr); - llvm::PointerType* ptype = DTypeToLLVMType(t)->getPointerTo(btype->getAddressSpace()); - if (btype != ptype) { - buffer = builder_->CreatePointerCast(buffer, ptype); - } - - return builder_->CreateInBoundsGEP(buffer, index); -} - -llvm::Value* CodeGenLLVM::CreateBufferVecPtr(DataType t, llvm::Value* buffer, llvm::Value* index) { - CHECK_GT(t.lanes(), 1); llvm::PointerType* btype = llvm::dyn_cast(buffer->getType()); CHECK(btype != nullptr); llvm::PointerType* ptype = DTypeToLLVMType(t)->getPointerTo(btype->getAddressSpace()); @@ -792,7 +779,7 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) { addrspace = llvm::dyn_cast(ptr->getType())->getAddressSpace(); } else { PrimExpr index = r->base / make_const(DataType::Int(32), r->lanes); - ptr = CreateBufferVecPtr(l->dtype, MakeValue(l->buffer_var), MakeValue(index)); + ptr = CreateBufferPtr(l->dtype, MakeValue(l->buffer_var), MakeValue(index)); addrspace = llvm::dyn_cast(ptr->getType())->getAddressSpace(); } return builder_->CreatePointerCast(ptr, t_char_->getPointerTo(addrspace)); diff --git a/src/target/llvm/codegen_llvm.h b/src/target/llvm/codegen_llvm.h index 9e7b56a6d7ae..7e576ca0a282 100644 --- a/src/target/llvm/codegen_llvm.h +++ b/src/target/llvm/codegen_llvm.h @@ -264,7 +264,6 @@ class CodeGenLLVM : public ExprFunctor, llvm::Value* CreateMul(DataType t, llvm::Value* a, llvm::Value* b); llvm::Value* CreateBroadcast(llvm::Value* value, int lanes); llvm::Value* CreateBufferPtr(DataType t, llvm::Value* buffer, llvm::Value* index); - llvm::Value* CreateBufferVecPtr(DataType t, llvm::Value* buffer, llvm::Value* index); // Vector concatenation. llvm::Value* CreateVecSlice(llvm::Value* vec, int begin, int extent); llvm::Value* CreateVecFlip(llvm::Value* vec);