diff options
author | Majid Dadashi <5490974+majiddadashi@users.noreply.github.com> | 2025-08-05 09:55:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-05 09:55:47 -0700 |
commit | f45f4ae7834e2be54cc5d2f51c413d4259ec682e (patch) | |
tree | 9f714b20c8619f246f492469cae0b7785fb2b853 /llvm/lib/TextAPI | |
parent | ed294c28aca6f1371df3de42131f7b41e2be151b (diff) | |
download | llvm-f45f4ae7834e2be54cc5d2f51c413d4259ec682e.zip llvm-f45f4ae7834e2be54cc5d2f51c413d4259ec682e.tar.gz llvm-f45f4ae7834e2be54cc5d2f51c413d4259ec682e.tar.bz2 |
Avoid unnecessary erasing of constant Locs (#151573)
Do not erase location info when moving an op within the same block.
Since #75415 , the FoldUtils.cpp erases the location information when
moving an operation. This was being done even when an operation was
moved to the front of a block it was already in.
In TFLite, this location information is used to provide meaningful names
for tensors, which aids in debugging and mapping compiled tensors back
to their original layers. The aggressive erasure of location info caused
many tensors in TFLite models to receive generic names (e.g.,
tfl.pseudo_qconst), making the models harder to inspect.
This change modifies the logic to preserve the location of an operation
when it is moved within the same block. The location is now only erased
when the operation is moved from a different block entirely. This
ensures that most tensor names are preserved, improving the debugging
experience for TFLite models.
Diffstat (limited to 'llvm/lib/TextAPI')
0 files changed, 0 insertions, 0 deletions