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

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 08:16:14 PDT 2021


kparzysz 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;
----------------
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?


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