[llvm] [CodeGen] Fix SplitCriticalEdge using parent valno for subrange segments (PR #208480)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 08:26:50 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/MachineBasicBlock.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 3b15f5d6f..5d27412a0 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -1350,11 +1350,12 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(
LI.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI));
for (auto &SR : LI.subranges()) {
// Use the subrange's own value number; reusing the parent range's
- // VNInfo overlaps the subrange's existing value with a foreign valno
- // when the register is live through the split block. Mirrors the
- // live-through update loop below.
+ // VNInfo overlaps the subrange's existing value with a foreign
+ // valno when the register is live through the split block. Mirrors
+ // the live-through update loop below.
if (VNInfo *SubVNI = SR.getVNInfoAt(PrevIndex))
- SR.addSegment(LiveInterval::Segment(StartIndex, EndIndex, SubVNI));
+ SR.addSegment(
+ LiveInterval::Segment(StartIndex, EndIndex, SubVNI));
}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/208480
More information about the llvm-commits
mailing list