[PATCH] D89800: [ARM][LowOverheadLoops] Don't generate a LOL if lr is redefined after the start

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 06:26:05 PST 2020


samparker added a comment.

So my thoughts:

- For the case where LRDef is not null, we should be able to check that this same value is used by 'Dec'. That way we have proved explicitly the the use-def chain is correct instead of relying on the check of the live-out value.
- For any the case where LRDef is null, I'm pretty sure we just need to try harder to find it - something needs to be setting LR for loop entry.
- My issue with the isSafeToDefRegAt is that is a local check. If WLS is in the preheader predecessor, we could decide we that defining LR is safe (locally), but then LR is redefined in the preheader.

So looks like two patches to me: modify the current one to find the explicit use-def chain, and then another to prove WLS safety. I reckon you could make a copy of your test and change it to use a WLS to show that we've got a bug.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89800



More information about the llvm-commits mailing list