tqchen commented on code in PR #19873:
URL: https://github.com/apache/tvm/pull/19873#discussion_r3499249837
##########
src/target/llvm/codegen_llvm.cc:
##########
@@ -109,6 +109,16 @@ PrimType WithScalableVScaleFactor(const PrimType& dtype,
int vscale_factor) {
return PrimType::ScalableVector(dtype.code(), dtype.bits(), vscale_factor);
}
+// Bool tensors are backed by int8 so vectorized accesses lower to real
loads/stores
+// (ld1b/st1b) instead of the i1 predicate registers that an i1 type would
force.
+PrimType BoolStorageType(const PrimType& dtype) {
+ if (!dtype.MatchesCode(DLDataTypeCode::kDLBool)) return dtype;
+ if (dtype.IsScalableVector()) {
+ return PrimType::ScalableVector(DLDataTypeCode::kDLInt, 8,
dtype.VScaleFactor());
Review Comment:
the name here is confusing. i think a better way here is always support
element_type as bool8, and allow translation of LLVMType(bool8) to i8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]