[PATCH] D41689: [SCEVAA] Don't crash on pointers with no dominance relationship.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 18:29:30 PST 2018


efriedma created this revision.
efriedma added reviewers: chandlerc, hfinkel, davide, sanjoy.

If you try to compute the difference between two SCEV values which don't have a dominance relationship (so there's no point in the source code where the difference could actually be computed), SCEV will crash.  This patch teaches SCEVAA not to do that.

I'm not sure this is the right fix; it seems like I'm working around the underlying issue rather than actually solving it.  Does it makes sense to call AliasAnalysis::alias() in the case where HasDominanceRelation returns false?  Alias analysis is normally defined in terms of memory operations, so I'm not sure what alias() means in the case where you can't construct a memory operation which refers to both pointers.

Fixes https://bugs.llvm.org/show_bug.cgi?id=33761.


Repository:
  rL LLVM

https://reviews.llvm.org/D41689

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41689.128481.patch
Type: text/x-patch
Size: 6444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180103/c1ce3a08/attachment.bin>


More information about the llvm-commits mailing list