Skip to content

Commit 2446c2f

Browse files
authored
[Backend] Bump to llvm/llvm-project@a992f294 (#8919)
This pulls in the following fixes: * llvm/llvm-project#168801 * llvm/llvm-project#168805 * llvm/llvm-project#169851 Along the way, we need to adjust `TMEMLoadOpPattern` and `RelayoutTritonGPU` due to * llvm/llvm-project#169606
1 parent 9073370 commit 2446c2f

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

cmake/llvm-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ebf5d9ef7de29b55fd9e9d504f83689b4013e0de
1+
a992f29451b9e140424f35ac5e20177db4afbdc0

lib/Conversion/TritonToTritonGPU/RelayoutTritonGPU.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ struct TMEMLoadOpPattern : public OpConversionPattern<ttng::TMEMLoadOp> {
3434
LogicalResult
3535
matchAndRewrite(ttng::TMEMLoadOp op, OpAdaptor adaptor,
3636
ConversionPatternRewriter &rewriter) const override {
37+
Type resultType = getTypeConverter()->convertType(op.getType());
3738
RankedTensorType type = getTMEMTensorLayout(
3839
typeConverter, op.getType(), op.getSrc().getType(), lookupNumWarps(op));
3940
rewriter.modifyOpInPlace(op, [&] { op.getResult().setType(type); });
40-
Type resultType = getTypeConverter()->convertType(op.getType());
41+
if (type == resultType)
42+
return success();
43+
4144
rewriter.setInsertionPointAfter(op);
4245
auto cvt = ConvertLayoutOp::create(rewriter, op.getLoc(), resultType,
4346
op.getResult());
44-
rewriter.replaceAllUsesExcept(op.getResult(), cvt, cvt);
47+
// Bypass the rewriter to avoid issues with the conversion framework's
48+
// tracking of conditional replacements.
49+
// See https://github.com/llvm/llvm-project/commit/504b50789602
50+
op.getResult().replaceAllUsesExcept(cvt, cvt);
4551
return success();
4652
}
4753
};
@@ -115,7 +121,10 @@ class RelayoutTritonGPU
115121
// clang-format on
116122
>(typeConverter, context);
117123

118-
if (failed(applyPartialConversion(mod, target, std::move(patterns))))
124+
ConversionConfig config;
125+
config.allowPatternRollback = false;
126+
if (failed(
127+
applyPartialConversion(mod, target, std::move(patterns), config)))
119128
return signalPassFailure();
120129
}
121130
};

third_party/amd/backend/compiler.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ def make_amdgcn(src, metadata, options):
451451
dump_file_id)
452452
amdgcn = llvm.translate_to_asm(src, amd.TARGET_TRIPLE, options.arch, features, flags, options.enable_fp_fusion,
453453
False)
454-
# TODO: Remove the following workaround once LLVM is bumped to include: https://github.com/llvm/llvm-project/pull/169851
455-
# Workaround for LLVM ERROR: cannot evaluate equated symbol 'amdgcn.device.init.num_named_barrier'
456-
if knobs.compilation.enable_asan and 'gfx1250' not in options.arch:
457-
amdgcn = amdgcn.replace('.amdgpu_metadata',
458-
'\t.set\tamdgcn.device.init.num_named_barrier, 0\n.amdgpu_metadata')
459454
if knobs.amd.dump_amdgcn:
460455
print("// -----// AMDGCN Dump //----- //")
461456
print(amdgcn)

0 commit comments

Comments
 (0)