[llvm] 803e03f - [llvm] Revive constructor of 'ResourceSegments'

Youngsuk Kim via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 04:03:15 PDT 2024


Author: Youngsuk Kim
Date: 2024-05-01T06:01:40-05:00
New Revision: 803e03fbb7cd97461f349fb6e235592681fc1e6c

URL: https://github.com/llvm/llvm-project/commit/803e03fbb7cd97461f349fb6e235592681fc1e6c
DIFF: https://github.com/llvm/llvm-project/commit/803e03fbb7cd97461f349fb6e235592681fc1e6c.diff

LOG: [llvm] Revive constructor of 'ResourceSegments'

582c6a82b4bc2ac5cbff803960eeb022bff10168 removed a constructor of
'ResourceSegments' that is needed in LLVM unit tests.

* Revert 582c6a82b4bc2ac5cbff803960eeb022bff10168
* Update the constructor to take a const reference of
  `std::list` as pointed out in #89193.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachineScheduler.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/MachineScheduler.h b/llvm/include/llvm/CodeGen/MachineScheduler.h
index 90d719e111d677..b15abf040058e8 100644
--- a/llvm/include/llvm/CodeGen/MachineScheduler.h
+++ b/llvm/include/llvm/CodeGen/MachineScheduler.h
@@ -807,6 +807,10 @@ class ResourceSegments {
   // constructor for empty set
   explicit ResourceSegments(){};
   bool empty() const { return _Intervals.empty(); }
+  explicit ResourceSegments(const std::list<IntervalTy> &Intervals)
+      : _Intervals(Intervals) {
+    sortAndMerge();
+  }
 
   friend bool operator==(const ResourceSegments &c1,
                          const ResourceSegments &c2) {


        


More information about the llvm-commits mailing list