[PATCH] D104603: [LV] Fix crash when target instruction for sinking is dead.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 07:15:47 PDT 2021


Ayal added a comment.

Ahh, the culprit here is a chain of FOR phi-users all sinking after a Previous - the latter should never be dead, but any member of the chain may by dead.
In the test case: `%rec.2` is the FOR phi, `%rec.2.prev` is Previous, and {`%cmp`, `%C`, `%B2`} is the chain of users, where `%B2` is dead as it feeds the loop's conditional branch only.

An alternative fix is to have RecurrenceDescriptor::isFirstOrderRecurrence() sink the chain in reverse, always after the non-dead Previous; as you originally suggested in D84951 <https://reviews.llvm.org/D84951>?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104603



More information about the llvm-commits mailing list