@@ -916,22 +916,27 @@ getMatmulOrIGEMMLoweringConfigAndWorkgroupSize(
916916 if (!scaled && useDirectLoad) {
917917 Attribute lhsAttr = useGlobalDma;
918918 Attribute rhsAttr = useGlobalDma;
919- // Apply XOR swizzle for bank conflict avoidance. Only swizzle operands
920- // whose reduction dim is innermost (contiguous reads).
921- if (!transposedLhs) {
922- FailureOr<Attribute> lhsSwizzleAttr =
923- getXorShuffleAttr (context, useGlobalDma, target, kind,
924- schedule->kTileSizes , kMMAOperandLhs );
925- if (succeeded (lhsSwizzleAttr)) {
926- lhsAttr = *lhsSwizzleAttr;
919+ // Apply XOR swizzle for BF16 DMA operands whose reduction dim is
920+ // innermost (contiguous reads) to avoid LDS bank conflicts.
921+ SmallVector<Type> elemTypes;
922+ kind.getElementTypes (elemTypes);
923+ bool isBF16 = !elemTypes.empty () && elemTypes[0 ].isBF16 ();
924+ if (isBF16) {
925+ if (!transposedLhs) {
926+ FailureOr<Attribute> lhsSwizzleAttr =
927+ getXorShuffleAttr (context, useGlobalDma, target, kind,
928+ schedule->kTileSizes , kMMAOperandLhs );
929+ if (succeeded (lhsSwizzleAttr)) {
930+ lhsAttr = *lhsSwizzleAttr;
931+ }
927932 }
928- }
929- if (transposedRhs) {
930- FailureOr<Attribute> rhsSwizzleAttr =
931- getXorShuffleAttr (context, useGlobalDma, target, kind,
932- schedule-> kTileSizes , kMMAOperandRhs );
933- if ( succeeded (rhsSwizzleAttr)) {
934- rhsAttr = *rhsSwizzleAttr;
933+ if (transposedRhs) {
934+ FailureOr<Attribute> rhsSwizzleAttr =
935+ getXorShuffleAttr (context, useGlobalDma, target, kind,
936+ schedule-> kTileSizes , kMMAOperandRhs );
937+ if ( succeeded (rhsSwizzleAttr)) {
938+ rhsAttr = *rhsSwizzleAttr;
939+ }
935940 }
936941 }
937942 promotionArray = {lhsAttr, rhsAttr};
0 commit comments