[all-commits] [llvm/llvm-project] 87e2e8: [MLIR] Fuse locations of merged constants (#74670)
Billy Zhu via All-commits
all-commits at lists.llvm.org
Mon Dec 11 19:32:08 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 87e2e89019ec4405fa47c3b4585be4e67473b590
https://github.com/llvm/llvm-project/commit/87e2e89019ec4405fa47c3b4585be4e67473b590
Author: Billy Zhu <billyzhu at modular.com>
Date: 2023-12-11 (Mon, 11 Dec 2023)
Changed paths:
M mlir/include/mlir/Transforms/FoldUtils.h
M mlir/lib/Transforms/Utils/FoldUtils.cpp
A mlir/test/Transforms/canonicalize-debuginfo.mlir
A mlir/test/Transforms/constant-fold-debuginfo.mlir
Log Message:
-----------
[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).
More information about the All-commits
mailing list