[all-commits] [llvm/llvm-project] ae7b1e: [SCEV] Handle unreachable binop when matching shif...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed Mar 31 10:34:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae7b1e8823a51068cfa64875fc5222e5b1d16760
      https://github.com/llvm/llvm-project/commit/ae7b1e8823a51068cfa64875fc5222e5b1d16760
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-03-31 (Wed, 31 Mar 2021)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/shift-recurrences.ll

  Log Message:
  -----------
  [SCEV] Handle unreachable binop when matching shift recurrence

This fixes an issue introduced with my change d4648e, and reported in pr49768.

The root problem is that dominance collapses in unreachable code, and that LoopInfo explicitly only models reachable code.  Since the recurrence matcher doesn't filter by reachability (and can't easily because not all consumers have domtree), we need to bailout before assuming that finding a recurrence implies we found a loop.




More information about the All-commits mailing list