[PATCH] D147060: [MachineSink] Fix an assertion failure in isCycleInvariant

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 01:20:17 PDT 2023


jmorse added a comment.

A more generalised solution I believe would be to skip debug instructions while examining the basic block -- that would mean

- Using an iterator-based for loop rather than a range based loop, and
- `skipDebugInstructionsForward` to increment past any debug instructions at the start of each iteration

Which would mean the rest of the logic in FindCycleSinkCandidates could remain unaltered. (The presence of debug instructions is awkward, but we're slowly trying to get rid of them).

For the test, I would recommend using a MIR test that runs only the machine-sink pass, to minimise the chance of other optimisation passes affecting the coverage of this test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147060



More information about the llvm-commits mailing list