Skip to content

Commit d5ac9d0

Browse files
committed
Fix truncated bits for boolean in swizzling path
Signed-off-by: Witold Dziurdz <[email protected]>
1 parent 8744d8e commit d5ac9d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Conversion/TritonGPUToLLVM/ConvertLayoutOpToLLVM.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ struct ConvertLayoutOpUsingLinearLayoutsConversion
144144
inVals, [&](Value v) { return b.zext(i8ElemTy, v).getResult(); }));
145145
auto outVals = transferWithinBlockSwizzlingImpl(
146146
loc, rewriter, srcLayout, dstLayout, newInVals, i8ElemTy, smemBase);
147+
if (llvmElemTy.getIntOrFloatBitWidth() == 1) {
148+
auto zero = rewriter.create<LLVM::ConstantOp>(
149+
loc, i8_ty, rewriter.getI8IntegerAttr(0));
150+
for (auto &v : outVals) {
151+
v = b.icmp_ne(v, zero);
152+
}
153+
return outVals;
154+
}
147155
for (auto &v : outVals) {
148156
v = b.trunc(llvmElemTy, v);
149157
}

0 commit comments

Comments
 (0)