[PATCH] D157954: [LoopSink] Don't sort BBs if there is only 1 of them (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 02:54:41 PDT 2023


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

LGTM. Took me a while to get it, but you're saying that by default sort with one element will not invoke the comparison callback, while in debug mode it will be done to verify the strict weak ordering. That's why we did not previously hit the assertion failure.

I'm not sure whether this is really the right fix (possibly the earlier `BBsToSinkInto.size() > 1` check should be removed), but this is fine to fix the assertion failure while keeping the current behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157954



More information about the llvm-commits mailing list