[PATCH] D100331: [Dependence Analysis] Fix ExactSIV producing wrong analysis

Artem Radzikhovskyy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 12 11:02:10 PDT 2021


artemrad created this revision.
artemrad added reviewers: Meinersbur, sebpop, fhahn, dmgreen, grosser, etiotto, bollu.
artemrad added a project: LLVM.
Herald added subscribers: bmahjour, hiraditya.
artemrad requested review of this revision.
Herald added a subscriber: llvm-commits.

Symptom: ExactSIV test produced incorrect analysis of dependencies see LIT tests
Bug: At the end of the algorithm when determining dependence direction original author forgot to divide intermediate results by gcd and round result toward zero

Although this bug can be fixed with significantly fewer changes I opted to write the code in such a way that reflects the original algorithm that Banerjee proposed, for easier reference in the future. This surprisingly results in shorter code, and fewer quotient and max/min calculations.

Changes Summary:

- fixed findGCD to return valid x and y so that they match the function description where: ax - by = gcd(a,b)
- Fixed ExactSIV test, to produce proper results
- Documented the extension of Banerjee's algorithm that the original code author introduced. Banerjee's original algorithm only tested whether Dst depends on Src, the extension also allows us to test whether Src depends on Dst, in one pass.
- ExactRDIV test worked fine. Since it uses findGCD(), it needed to be updated.Since ExactRDIV test has very few changes from the core algorithm of ExactSIV I modified the test to have consistent format as ExactSIV.
- Updated the LIT tests to be testing for correct values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100331

Files:
  llvm/lib/Analysis/DependenceAnalysis.cpp
  llvm/test/Analysis/DependenceAnalysis/Coupled.ll
  llvm/test/Analysis/DependenceAnalysis/ExactSIV.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100331.336836.patch
Type: text/x-patch
Size: 18529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210412/d6c25598/attachment.bin>


More information about the llvm-commits mailing list