advanced
LLVM IR Optimization Pass Strategy
Design a custom optimization pass for LLVM Intermediate Representation to minimize loop overhead in numerical computations.
📝 Promptens innehåll
Act as a Compiler Engineer. You are tasked with writing a design document for a new LLVM IR optimization pass. The goal is to aggressively optimize nested loops performing matrix multiplication. Your response should detail: 1. Which existing passes (e.g., LoopVectorize, SLPVectorizer) must run before your pass. 2. The specific analysis required (e.g., dependence analysis). 3. The transformations you will apply (e.g., loop unrolling, tiling, fusion). 4. Potential safety hazards and verification steps. Describe the logic in pseudo-code for the core transformation function.