Skip to content

Commit 6e0d4d5

Browse files
authored
[MISC] Fix compilation warnings (#18509)
This commit addresses various compilation warnings across the codebase: - Fixed warnings in IR transform infrastructure (transform.h, transform.cc) - Updated Python bindings to resolve type-related warnings (transform.py) - Addressed warnings in Relax alter_op_impl transformation - Fixed compilation warnings in TIR schedule compute_inline primitive These changes improve code quality and ensure clean compilation across different compilers and platforms.
1 parent 6041e9f commit 6e0d4d5

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

include/tvm/ir/transform.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,9 @@ TVM_DLL Pass ApplyPassToFunction(Pass pass, ffi::String func_name_regex,
557557
/*!
558558
* \brief A special trace pass that prints the header and IR to LOG(INFO).
559559
* \param header The header to be attached to the output.
560-
* \param show_meta_data Whether should we show meta data.
561560
* \return The pass.
562561
*/
563-
TVM_DLL Pass PrintIR(ffi::String header = "", bool show_meta_data = false);
562+
TVM_DLL Pass PrintIR(ffi::String header = "");
564563

565564
} // namespace transform
566565
} // namespace tvm

python/tvm/ir/transform.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,22 +348,19 @@ def create_module_pass(pass_arg):
348348
return create_module_pass
349349

350350

351-
def PrintIR(header="", show_meta_data=False):
351+
def PrintIR(header=""):
352352
"""A special trace pass that prints the header and IR.
353353
354354
Parameters
355355
----------
356356
header : str
357357
The header to be displayed along with the dump.
358358
359-
show_meta_data : bool
360-
A boolean flag to indicate if meta data should be printed.
361-
362359
Returns
363360
--------
364361
The pass
365362
"""
366-
return _ffi_transform_api.PrintIR(header, show_meta_data)
363+
return _ffi_transform_api.PrintIR(header)
367364

368365

369366
def ApplyPassToFunction(

src/ir/transform.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ TVM_FFI_STATIC_INIT_BLOCK() {
642642
});
643643
}
644644

645-
Pass PrintIR(ffi::String header, bool show_meta_data) {
646-
auto pass_func = [header, show_meta_data](IRModule mod, const PassContext& ctx) {
645+
Pass PrintIR(ffi::String header) {
646+
auto pass_func = [header](IRModule mod, const PassContext& ctx) {
647647
LOG(INFO) << "PrintIR(" << header << "):\n" << mod;
648648
return mod;
649649
};

src/relax/transform/alter_op_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class AlterOpImplMutator : public ExprMutator {
194194
// We want to avoid two layout_transform ops to share the same index map even if they are
195195
// identical. The scope of vars used in index map initial indices is local to the op. Not doing
196196
// so would confuse the structural equality check.
197-
attrs->index_map = std::move(DeepCopyIndexMap(index_map));
197+
attrs->index_map = DeepCopyIndexMap(index_map);
198198
attrs->axis_separators = std::move(axis_separators);
199199
attrs->input_axis_separators = std::move(input_axis_separators);
200200
return Call(layout_transform_op_, {expr}, Attrs{std::move(attrs)}, {});

src/tir/schedule/primitive/compute_inline.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -992,11 +992,10 @@ class ReductionEpilogueFuser : public BaseInliner {
992992
public:
993993
explicit ReductionEpilogueFuser(const Buffer& reduction_buffer, const BlockNode* reduction_block,
994994
const BlockRealize& epilogue_block_realize,
995-
const StmtSRef& scope_root_sref, const IRModule& mod)
995+
const StmtSRef& scope_root_sref)
996996
: BaseInliner(reduction_buffer, epilogue_block_realize->block, scope_root_sref),
997997
reduction_block_(reduction_block),
998-
epilogue_block_(epilogue_block_realize->block.get()),
999-
mod_(mod) {}
998+
epilogue_block_(epilogue_block_realize->block.get()) {}
1000999

10011000
bool BodyPatternAllowFusion(const BlockRealize& epilogue_block_realize);
10021001

@@ -1031,7 +1030,6 @@ class ReductionEpilogueFuser : public BaseInliner {
10311030

10321031
const BlockNode* reduction_block_;
10331032
const BlockNode* epilogue_block_;
1034-
const IRModule& mod_;
10351033
PrimExpr epilogue_addend_{nullptr}; // C[vi, vj] in D = temp + C
10361034
Buffer epilogue_output_buffer_{nullptr}; // Output buffer D
10371035
ffi::Array<PrimExpr> epilogue_output_indices_{nullptr}; // Indices of D[vi, vj]
@@ -1412,7 +1410,7 @@ void FuseReductionEpilogueImpl(ScheduleState self, const StmtSRef& reduction_blo
14121410

14131411
// Step 4. Analyze the epilogue pattern
14141412
ReductionEpilogueFuser fuser(reduction_buffer, _reduction_block, epilogue_block_realize,
1415-
scope_root_sref, self->mod);
1413+
scope_root_sref);
14161414
if (!fuser.BodyPatternAllowFusion(epilogue_block_realize)) {
14171415
throw BodyAnalysisError(true, self->mod, epilogue_block);
14181416
}

0 commit comments

Comments
 (0)