[llvm-dev] Incorrect behavior in the LLVM dependence analyzer

Ejjeh, Adel via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 30 15:55:54 PDT 2020


Hello Everyone,

I am still looking for some insight regarding the below issue. Please reach out if you have any advice!

Thanks,
-Adel

From: "Ejjeh, Adel" <aejjeh at illinois.edu>
Date: Thursday, April 23, 2020 at 5:21 PM
To: LLVM Dev <llvm-dev at lists.llvm.org>
Subject: Incorrect behavior in the LLVM dependence analyzer

Hi all,

I am trying to use the dependence analyzer in a pass that I am writing and I was surprised to see an incorrect behavior when I try to query DependenceInfo for dependences between instructions. Specifically, if the two instructions are loads/stores accessing an array in a loop, the depend() method would return a dependence regardless of the order of instructions specified. (i.e. if the two instructions where L1 and S1, both depend(L1, S1) and depend(S1,L1) would return a dependence), even though only one of the two dependences is valid when the chronological order of the instructions is considered. To illustrate consider this example:

for(int i = 0; i < n; i++) {
S0:   A[i] = …;
S1:   … = A[i+1];
}

In the example, there is an antidependence between S1 and S0 with distance 1. However, when querying DependenceInfo it also returns a flow dependence from S0 to S1. Is this the expected behavior of DependenceInfo or Is it a known problem? If it is the expected behavior, is there a way to check if the dependence you are getting back is a correct one or not? Does anyone have any ideas about possible workarounds or solutions?
Regards,
- Adel

--
Adel Ejjeh
PhD Candidate – Computer Science
University of Illinois at Urbana Champaign
201 N Goodwin Ave, Urbana, IL 61801
aejjeh at illinois.edu<mailto:aejjeh at illinois.edu> | adel.ejjeh at gmail.com<mailto:adel.ejjeh at gmail.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200430/278d5685/attachment-0001.html>


More information about the llvm-dev mailing list