[PATCH] D100004: [SCEV] Correct handling of recurrences matched in partially unreachable code (try 2)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 19:27:36 PDT 2021


reames created this revision.
reames added reviewers: mkazantsev, nikic, lebedev.ri.
Herald added subscribers: dantrushin, hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

(This is, I think, entirely functionally equivalent to https://reviews.llvm.org/D99929.  I just preferred this way of framing the fix.  The key difference here is focusing on the connection between the loop trip count and the recurrence.  I do think we have a recurrence, it's just a trivially one where only the first iteration runs.)

As shown by PR49856 and the reopened test case on PR49768, my first attempt at accounting for unreachable blocks wasn't quite complete.  The new approach simply takes what was previously the assert, turns it into a bail out, and adds a comment explaining why it can happen.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100004

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100004.335699.patch
Type: text/x-patch
Size: 4492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210407/4f8a99d8/attachment.bin>


More information about the llvm-commits mailing list