[llvm] [RegisterCoalescer] Skip the pattern that can't resolve (PR #71024)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 23:41:17 PDT 2023
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 749083b91f31f370cf64831d3e7e6215b6d51442 95dbe42be96903dcaeedb5b9878339ba29008f78 -- llvm/lib/CodeGen/RegisterCoalescer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index c962668d314c..8593606882b2 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -3483,17 +3483,17 @@ void JoinVals::eraseInstrs(SmallPtrSetImpl<MachineInstr*> &ErasedInstrs,
}
}
-// If the overlapping segment all be mark as CR_Replace resolution,
+// If the overlapping segment all be mark as CR_Replace resolution,
// but can't be resolved resolveConflicts/pruneValues function.
-//
-// This function target this particular pattern and make joinVReg fail.
//
-// For example:
-// LHS: %12 [32r,80r:0)[96r,240r:1) 0 at 32r 1 at 96r
+// This function target this particular pattern and make joinVReg fail.
+//
+// For example:
+// LHS: %12 [32r,80r:0)[96r,240r:1) 0 at 32r 1 at 96r
// RHS: %17 [240e,288r:1) 0 at 48r 1 at 240e
-// [96r,240r:2) and [240e,288r:1) both be mark as CR_Replace,
+// [96r,240r:2) and [240e,288r:1) both be mark as CR_Replace,
// but does't be resolved after pruneValues.
-//
+//
bool JoinVals::canCRReplaceBeResolved(JoinVals &Other) {
for (auto Seg : LR.segments) {
for (auto OtherSeg : Other.LR.segments) {
@@ -3635,7 +3635,8 @@ bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) {
return false;
// Some CR_Replace can't be solved by pruneValues. Early exit here.
- if (!LHSVals.canCRReplaceBeResolved(RHSVals) || !RHSVals.canCRReplaceBeResolved(LHSVals))
+ if (!LHSVals.canCRReplaceBeResolved(RHSVals) ||
+ !RHSVals.canCRReplaceBeResolved(LHSVals))
return false;
// All clear, the live ranges can be merged.
``````````
</details>
https://github.com/llvm/llvm-project/pull/71024
More information about the llvm-commits
mailing list