[PATCH] D110182: [LiveIntervals] Find better anchoring end points when repairing ranges

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 08:20:35 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveIntervals.cpp:1667
   // instructions that already have indexes.
-  while (Begin != MBB->begin() && !Indexes->hasIndex(*Begin))
+  while (Begin != MBB->begin() && !Indexes->hasIndex(*std::prev(Begin)))
     --Begin;
----------------
kparzysz wrote:
> I haven't given this code an in-depth look, but the first thing I noticed is that it gets the preceding iterator: how do we know that `std::prev(Begin)` is actually valid?
Because of the `Begin != MBB->begin()` check!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110182



More information about the llvm-commits mailing list