[PATCH] D158880: Map LLVM values to corresponding source-level expressions

Shivam Rajput via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 12:54:30 PDT 2023


phyBrackets created this revision.
phyBrackets added reviewers: karthiksenthil, sguggill.
Herald added subscribers: asbirlea, hiraditya.
Herald added a project: All.
phyBrackets requested review of this revision.
Herald added subscribers: llvm-commits, wangpc.
Herald added a project: LLVM.

The primary objective of this project is to enhance the effectiveness of compiler-generated remarks and analysis reports for code optimization. These messages, while often comprehensive, lack direct connections to the corresponding source-level expressions. The goal is to bridge this gap by utilizing LLVM's intrinsic functions, which establish mappings between LLVM program entities and source-level expressions. The project specifically focuses on utilizing these intrinsic functions to generate or derive source expressions from LLVM values. This functionality is particularly important for enhancing memory access optimizations, including the reporting of memory access dependences that hinder vectorization.

The core achievement of the project is the development of an analysis pass that operates on LLVM intermediate representation (IR). This analysis pass identifies load and store instructions, and then conducts a recursive traversal to construct source expressions that represent equivalent source-level memory references. This is achieved by utilizing the metadata and debug intrinsics available in the LLVM IR. This pass was integrated into the loop vectorizer framework, which is a significant step towards practical application. Accompanying the implementation, a comprehensive suite of tests was developed to ensure the accuracy and expected behavior of the analysis pass.

This work is done under Google Summer Of Code , Project link https://discourse.llvm.org/t/map-llvm-values-to-corresponding-source-level-expressions/68450 ,

I am hoping for the better review on this patch and future of this analysis pass. I would highly recommend to look at this final report for much better idea about the implementation and what we lacking right now https://docs.google.com/document/d/1t1K6vzCYDnFBTH8d1NIJInhxRe5mc1FxkMaX_2WVcmc/edit?usp=sharing


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158880

Files:
  llvm/include/llvm/Analysis/LoopAccessAnalysis.h
  llvm/include/llvm/Analysis/LoopAnalysisManager.h
  llvm/include/llvm/Analysis/SourceExpressionAnalysis.h
  llvm/lib/Analysis/CMakeLists.txt
  llvm/lib/Analysis/LoopAccessAnalysis.cpp
  llvm/lib/Analysis/SourceExpressionAnalysis.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Scalar/LoopPassManager.cpp
  llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Analysis/SourceExpressionAnalysis/loop.ll
  llvm/test/Analysis/SourceExpressionAnalysis/mul.ll
  llvm/test/Analysis/SourceExpressionAnalysis/struct.ll
  llvm/test/Transforms/LoopVectorize/report-source-expr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158880.553581.patch
Type: text/x-patch
Size: 77368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230825/becb2f1c/attachment.bin>


More information about the llvm-commits mailing list