[PATCH] D104503: [SCEV] Don't require dominance ordering of add/mul/min/max expressions

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 16:48:56 PDT 2021


reames updated this revision to Diff 355069.
reames added a comment.

Refresh, mostly to add test for following comment.

After giving them some more thought, I believe I've convinced myself that this is the correct approach.  Why?  Because it's exactly the approach we already use.

If you look at the newly added test_non_dom2 test case, you'll find an example which is identical to the test_non_dom case except that I replaced a gep with a call to an external function.  Assume that external function just contains the original gep, and returns it's result.  The modified test case didn't crash, and we do in fact form SCEVs with non-dominating arguments.

In the example, we happily form the SCEV "((-1 * %addr1) + %addr2)" where %addr1 and %add2 represent SCEVUnknowns, and neither dominate the other.  As Max points out, it's odd that such an expression isn't expandable, but we already have that problem.  This patch does not introduce a new concept after all.


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

https://reviews.llvm.org/D104503

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
  llvm/test/Analysis/ScalarEvolution/scev-aa.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104503.355069.patch
Type: text/x-patch
Size: 6933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210628/d57a2e99/attachment.bin>


More information about the llvm-commits mailing list