[all-commits] [llvm/llvm-project] 0a82d8: [Dependence Analysis] Fix ExactSIV producing wrong...

Andy Kaylor via All-commits all-commits at lists.llvm.org
Tue Apr 27 12:25:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a82d885a4fc198395369e9ae75dfe175140df94
      https://github.com/llvm/llvm-project/commit/0a82d885a4fc198395369e9ae75dfe175140df94
  Author: Andy Kaylor <andrew.kaylor at intel.com>
  Date:   2021-04-27 (Tue, 27 Apr 2021)

  Changed paths:
    M llvm/lib/Analysis/DependenceAnalysis.cpp
    M llvm/test/Analysis/DependenceAnalysis/Coupled.ll
    M llvm/test/Analysis/DependenceAnalysis/ExactSIV.ll

  Log Message:
  -----------
  [Dependence Analysis] Fix ExactSIV producing wrong analysis

Patch by Artem Radzikhovskyy!

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.

Differential Revision: https://reviews.llvm.org/D100331




More information about the All-commits mailing list