[llvm] [CodeGen][MISched] Handle empty sized resource usage. (PR #75951)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 21:42:55 PST 2024


================
@@ -4266,6 +4266,12 @@ unsigned ResourceSegments::getFirstAvailableAt(
   assert(std::is_sorted(std::begin(_Intervals), std::end(_Intervals),
                         sortIntervals) &&
          "Cannot execute on an un-sorted set of intervals.");
+
+  // Zero resource usage is allowed by TargetSchedule.td but we do not construct
+  // a ResourceSegment interval for that situation.
----------------
michaelmaitland wrote:

This is not an optimization. It was made because intersect will crash when considering the empty interval since intervals are supposed to be [a, b), not (a, b)

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


More information about the llvm-commits mailing list