[PATCH] D46044: [LoopUnrollPeel] Fix potentially incorrect invalidation of SCEV in peelLoop

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 06:59:35 PST 2019


fhahn added a comment.

If the current code is correct in that the parent loop needs to be forgotten, then I agree that we should forget all parent loops.

But do we actually need to invalidate the parent? IIUC (and I am not very familiar with the SCEV invalidation code), there are the following ways a SCEVExpr from the peeled loop could impact an SCEV Expr in a parent loop:

1. Add rec expr escaping from L: those should be kept track in LoopUsers and should be properly invalidated by forgetLoop
2. expressions based on L's header phis: those should be invalidated by forgetLoop too.
3. loop invariant value escaping from L: those should be unchanged by peeling/unrolling, so there should be no need for invalidation.


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

https://reviews.llvm.org/D46044





More information about the llvm-commits mailing list