Skip to content

Commit b6025b4

Browse files
wdziurdzwhitneywhtsang
authored andcommitted
Fix truncated bits for boolean in swizzling path
Signed-off-by: Witold Dziurdz <[email protected]>
1 parent b3d648d commit b6025b4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Conversion/TritonGPUToLLVM/ConvertLayoutOpToLLVM.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ 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 = b.int_val(8, 0);
149+
for (auto &v : outVals)
150+
v = b.icmp_ne(v, zero);
151+
return outVals;
152+
}
147153
for (auto &v : outVals) {
148154
v = b.trunc(llvmElemTy, v);
149155
}

0 commit comments

Comments
 (0)