Array access dependencies

Hi all

I am relatively new to LLVM and I am still trying to work my way through. What I am trying to implement is a list of array access and indices of the same within loops. I can then probably try to work on dependencies they can have.

I have already got all the Basic blocks in a loop and I am looking at load & store instructions to reconstruct array access (casting GEP instructions).

I tried the default dependence analysis to get probable dependencies but it was of no use.

Is there a more graceful way of looking for array accesses or reconstructing them for that matter.

Any help would be appreciated


Disclaimer:- The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this email. Please notify the sender immediately and destroy all copies of this message and any attachments. The views expressed in this E-mail message (including the enclosure/(s) or attachment/(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of IIT Hyderabad. Before opening any mail and attachments please check them for viruses, malware, and the sender email address is indeed from IITH domain. IITH does not accept any liability for malware infected mails.

At the last LLVM Developer's Meeting, there was a talk about LLVM
dependency analyses: 2020 LLVM Developers’ Meeting: S. Baziotis & S. Moll “Finding Your Way Around the LLVM Dependence..” - YouTube



Hopefully the video Michael posted will help you, thanks for posting. It’s more useful to the user of these passes than the developer I guess (it describes
the theoretical background, hurdles of the implementation etc.). But the two passes we describe, DependenceAnalysis and MemorySSA, have very clean
interfaces so you shouldn’t have a problem in that matter. You probably want to look at DependenceAnalysis for array accesses.

Reconstructing array accesses from LLVM IR and / or performing dependence analysis on them is quite difficult
because a lot of info from the front-end has been lost. I mention it in the talk in the talk and you can also
see a recent post in the mailing list:

That said DependenceAnalysis will help you if what you do is not super fancy and you are not interested in run-time checks.


Στις Τετ, 18 Νοε 2020 στις 3:27 π.μ., ο/η Michael Kruse via llvm-dev <> έγραψε:


Thanks a ton for your replies. I’ll go through the video and the links provided.