aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectOptimize.cpp
diff options
context:
space:
mode:
authorBilly Zhu <billyzhu@modular.com>2023-12-11 19:31:54 -0800
committerGitHub <noreply@github.com>2023-12-11 19:31:54 -0800
commit87e2e89019ec4405fa47c3b4585be4e67473b590 (patch)
tree51f261dd4d8d70fbf94d4400290096c96d1ec38f /llvm/lib/CodeGen/SelectOptimize.cpp
parent59f3661bd22766e5d0dea391d4950605b249594a (diff)
downloadllvm-87e2e89019ec4405fa47c3b4585be4e67473b590.zip
llvm-87e2e89019ec4405fa47c3b4585be4e67473b590.tar.gz
llvm-87e2e89019ec4405fa47c3b4585be4e67473b590.tar.bz2
[MLIR] Fuse locations of merged constants (#74670)
When merging constants by the operation folder, the location of the op that remains should be updated to track the new meaning of this op. This way we do not lose track of all possible source locations that the constant op came from, and the final location of the op is less reliant on the order of folding. This will also help debuggers understand how to step these instructions. This PR introduces a helper for operation folder to fuse another location into the location of an op. When an op is deduplicated, fuse the location of the op to be removed into the op that is retained. The retained op now represents both original ops. The FusedLoc will have a string metadata to help understand the reason for the location fusion (motivated by the [example](https://github.com/llvm/llvm-project/blob/71be8f3c23497e28c86f1135f564b16106d8d6fb/mlir/include/mlir/IR/BuiltinLocationAttributes.td#L130) in the docstring of FusedLoc).
Diffstat (limited to 'llvm/lib/CodeGen/SelectOptimize.cpp')
0 files changed, 0 insertions, 0 deletions