Skip to content

Commit 4e59edf

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Conversion/TritonGPUToLLVM/ConvertLayoutOpToLLVM.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ 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>(loc, i8_ty, rewriter.getI8IntegerAttr(0));
149+
for (auto &v : outVals){
150+
v = b.icmp_ne(v, zero);
151+
}
152+
return outVals;
153+
}
147154
for (auto &v : outVals) {
148155
v = b.trunc(llvmElemTy, v);
149156
}

0 commit comments

Comments
 (0)