[REFACTOR][IR] Remove dead AttrFunctor template#19528
Merged
Merged
Conversation
AttrFunctor had no remaining subclasses, friend declarations, or macro callers outside its own header. An exhaustive search across include/, src/, tests/, python/, apps/, web/, and cmake/ confirms it is unused infrastructure. The one #include "attr_functor.h" in src/ir/attrs.cc is a stale leftover from a prior migration — the file references only DictAttrs and AttrFieldInfoNode (declared in tvm/ir/attrs.h), not any AttrFunctor symbols. Removes src/ir/attr_functor.h and drops the stale include.
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the attr_functor.h header file and its inclusion in src/ir/attrs.cc. The AttrFunctor template class, which provided a dispatch mechanism for common attribute types and symbolic integer expressions, has been deleted. I have no feedback to provide.
tlopex
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AttrFunctoris declared infrastructure with no remaining users.An exhaustive search across
include/,src/,tests/,python/,apps/,web/, andcmake/confirms zero subclasses, zero frienddeclarations, and zero macro callers outside the header itself —
its two internal macros (
ATTR_FUNCTOR_DEFAULT,ATTR_FUNCTOR_DISPATCH)are only used inside
src/ir/attr_functor.h. The one#include "attr_functor.h"insrc/ir/attrs.ccis a stale leftoverfrom a prior migration; that file references only
DictAttrsandAttrFieldInfoNode(fromtvm/ir/attrs.h), not anyAttrFunctorsymbols.
Removes
src/ir/attr_functor.h(150 lines) and drops the stale include.No build-system changes needed — the header was never enumerated in
any
CMakeLists.txt.