[PATCH] [DependenceAnalysis] Fix for PR21585: collectUpperBound triggers asserts

Philip Pfaffe philip.pfaffe at gmail.com
Mon May 11 02:50:44 PDT 2015


I agree with hfinkel. Blindly truncating the upper bound leads to wrong dependence results if the subscripts wrap (due to a trip count that is larger than the subscript's type).

I updated the patch to catch this early and treat the wrapping subscripts accordingly, namely by recognizing them as NonLinear. Moreover, I added Brendon's code snippet to the test, as well as two more testcases that produce wrong dependence info when wrapping subscripts are treated as Linear.

I'm open for discussion on whether truncating the upper bound is the most beautiful thing to do here (as apposed to, e.g., zero extending where ever this function is used), or whether it may still lead to wrong results in any other way.


http://reviews.llvm.org/D9455

Files:
  lib/Analysis/DependenceAnalysis.cpp
  test/Analysis/DependenceAnalysis/PR21585.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9455.25452.patch
Type: text/x-patch
Size: 3839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150511/3b0a6a0d/attachment.bin>


More information about the llvm-commits mailing list