Skip to content

Commit f11c4c0

Browse files
committed
fixes
1 parent a0e8c1f commit f11c4c0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ struct AssertOpToAssertfailLowering
337337
///
338338
/// This pass only handles device code and is not meant to be run on GPU host
339339
/// code.
340-
struct LowerGpuOpsToNVVMOpsPass
340+
struct LowerGpuOpsToNVVMOpsPass final
341341
: public impl::ConvertGpuOpsToNVVMOpsBase<LowerGpuOpsToNVVMOpsPass> {
342342
using Base::Base;
343343

344-
void getDependentDialects(DialectRegistry &registry) const override final {
344+
void getDependentDialects(DialectRegistry &registry) const override {
345345
Base::getDependentDialects(registry);
346346
registerConvertToLLVMDependentDialectLoading(registry);
347347
}
@@ -389,7 +389,7 @@ struct LowerGpuOpsToNVVMOpsPass
389389
if (!iface) {
390390
m.emitError()
391391
<< "dialect does not implement ConvertToLLVMPatternInterface: "
392-
<< dialectName << "\n";
392+
<< dialectName;
393393
return signalPassFailure();
394394
}
395395

@@ -398,7 +398,8 @@ struct LowerGpuOpsToNVVMOpsPass
398398
}
399399
} else {
400400
for (Dialect *dialect : getContext().getLoadedDialects()) {
401-
if (isa<math::MathDialect>(dialect)) // Need custom math lowering
401+
// Skip math patterns as nvvm needs custom math lowering.
402+
if (isa<math::MathDialect>(dialect))
402403
continue;
403404

404405
auto iface = dyn_cast<ConvertToLLVMPatternInterface>(dialect);

mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> {
199199
//
200200
// This pass only handles device code and is not meant to be run on GPU host
201201
// code.
202-
struct LowerGpuOpsToROCDLOpsPass
202+
struct LowerGpuOpsToROCDLOpsPass final
203203
: public impl::ConvertGpuOpsToROCDLOpsBase<LowerGpuOpsToROCDLOpsPass> {
204204
LowerGpuOpsToROCDLOpsPass() = default;
205205
LowerGpuOpsToROCDLOpsPass(const std::string &chipset, unsigned indexBitwidth,
@@ -215,7 +215,7 @@ struct LowerGpuOpsToROCDLOpsPass
215215
this->runtime = runtime;
216216
}
217217

218-
void getDependentDialects(DialectRegistry &registry) const override final {
218+
void getDependentDialects(DialectRegistry &registry) const override {
219219
Base::getDependentDialects(registry);
220220
registerConvertToLLVMDependentDialectLoading(registry);
221221
}
@@ -304,7 +304,7 @@ struct LowerGpuOpsToROCDLOpsPass
304304
if (!iface) {
305305
m.emitError()
306306
<< "dialect does not implement ConvertToLLVMPatternInterface: "
307-
<< dialectName << "\n";
307+
<< dialectName;
308308
return signalPassFailure();
309309
}
310310

0 commit comments

Comments
 (0)