Skip to content

Commit 14091d6

Browse files
davidjwooigcbot
authored andcommitted
Enhance create_indirectStore
Update create_indirectStore so that it can handle its data parameter having a non-vector type.
1 parent ad5638c commit 14091d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,8 +2283,9 @@ LLVM3DBuilder<T, Inserter>::create_indirectStore(llvm::Value *srcBuffer, llvm::V
22832283
srcBuffer->getType(),
22842284
data->getType(),
22852285
};
2286-
llvm::Function *pFunc =
2287-
llvm::GenISAIntrinsic::getDeclaration(module, llvm::GenISAIntrinsic::GenISA_storerawvector_indexed, types);
2286+
llvm::GenISAIntrinsic::ID id = data->getType()->isVectorTy() ? llvm::GenISAIntrinsic::GenISA_storerawvector_indexed
2287+
: llvm::GenISAIntrinsic::GenISA_storeraw_indexed;
2288+
llvm::Function *pFunc = llvm::GenISAIntrinsic::getDeclaration(module, id, types);
22882289
llvm::Value *alignment = this->getInt32(data->getType()->getScalarSizeInBits() / 8);
22892290
return this->CreateCall5(pFunc, srcBuffer, offset, data, alignment, this->getInt1(isVolatile));
22902291
}

0 commit comments

Comments
 (0)