[llvm] [LiveRange] Verify Other LiveRange in Join API (PR #66809)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 13:06:07 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-regalloc

<details>
<summary>Changes</summary>

The LiveRange::join API takes in two live ranges. We should verify the
LiveRange argument passed in as well.


---
Full diff: https://github.com/llvm/llvm-project/pull/66809.diff


1 Files Affected:

- (modified) llvm/lib/CodeGen/LiveInterval.cpp (+1) 


``````````diff
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 1cf354349c5610c..a8e45d46c07cee6 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -629,6 +629,7 @@ void LiveRange::join(LiveRange &Other,
                      const int *RHSValNoAssignments,
                      SmallVectorImpl<VNInfo *> &NewVNInfo) {
   verify();
+  Other.verify();
 
   // Determine if any of our values are mapped.  This is uncommon, so we want
   // to avoid the range scan if not.

``````````

</details>


https://github.com/llvm/llvm-project/pull/66809


More information about the llvm-commits mailing list