Implementing Loop Dependency Analysis in LLVM IR
The prior tutorial showed how to determine whether a loop can be shuffled (parallelized) by examining access patterns, computing distance vectors, and applying the first-positive rule. This tutorial puts those ideas into code. We’ll write a mini LLVM pass that takes a loop nest and reports which levels are shuffleable. For pedagogical purposes, we keep the problem constrained and avoid LLVM’s built-in dependence analysis. Problem Scope Our pass handles loops matching this template: ...