[PATCH] D98232: [regalloc] Ensure Query::collectInterferringVregs is called before interval iteration

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 10:59:39 PST 2021


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

Nice catch!

Question below regarding the use of `Optional`.



================
Comment at: llvm/include/llvm/CodeGen/LiveIntervalUnion.h:117
     ConstSegmentIter LiveUnionI;    ///< current position in LiveUnion
-    SmallVector<LiveInterval*,4> InterferingVRegs;
+    Optional<SmallVector<LiveInterval *, 4>> InterferingVRegs;
     bool CheckedFirstInterference = false;
----------------
That part of the patch is not strictly needed.

I am guessing we want this because that way accessing `InterferingVRegs` without calling `collectInterferingVRegs` first will produce a runtime crash instead of silently checking against something empty.

Am I understanding correctly?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98232/new/

https://reviews.llvm.org/D98232



More information about the llvm-commits mailing list