[PATCH] D33316: [SCEV] Do not fold expressions with SCEVUnknown Phis into AddRecExpr's

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 05:32:35 PDT 2017


mkazantsev created this revision.
Herald added a subscriber: mzolotukhin.

When folding arguments of AddExpr or MulExpr with recurrences, we rely on the fact that
the loop of our base recurrency is the bottom-lost in terms of domination. This assumption
may be broken by an expression which is treated as invariant, and which depends on a complex
Phi for which SCEVUnknown was created. If such Phi is a loop Phi, and this loop is lower than
the chosen AddRecExpr's loop, it is invalid to fold our expression with the recurrence.


https://reviews.llvm.org/D33316

Files:
  lib/Analysis/ScalarEvolution.cpp
  test/Analysis/ScalarEvolution/different-loops-recs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33316.99426.patch
Type: text/x-patch
Size: 6245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170518/0a844924/attachment.bin>


More information about the llvm-commits mailing list