arcana-lab / noelle

NOELLE Offers Empowering LLVM Extensions
MIT License
75 stars 36 forks source link

Bugfix for missing loop carried dependence from store to itself and helix executing last iteration twice #53

Closed kalxr closed 1 year ago

kalxr commented 1 year ago

This fixes two bugs:

  1. Bug where a loop was being parallelized as DOALL when it should not have been. The cause of the bug was a missing loop carried memory dependence from a store instruction to itself (the one that stores to tmp[0] in the new SingleStoreLoopCarriedDependence test). In the PDG analysis, potential self-edges for stores were explicitly ignored. I'm not sure why it was written that way, but I changed it to consider the relevant cases and added a new regression test.
  2. HELIX would execute the last iteration of a loop twice under specific conditions. This is related to to a previous fix for a variant of this bug. Added a new test, HelixLastIteration, that exposes this case.