What problem does it solve?
Writing compiler transformation passes for LuisaCompute's XIR intermediate representation requires deep knowledge of non-obvious API conventions, terminator semantics, and mutation patterns; this Skill captures that hard-won knowledge so you avoid common pitfalls like invalid casts, wrong setter names, and unsafe instruction-list mutation.
Core Features & Use Cases
- Pass authoring conventions: Standard
<Name>Info POD interface, module/function entry points, PassReport statistics, and PassPipeline integration with fixed-point sub-pipelines.
- API reference and pitfalls catalogue: Complete terminator inventory (BranchInst, SwitchInst, LoopInst, RayQueryLoopInst, etc.), XIRBuilder usage, two-phase collect-rewrite mutation idiom, and a list of mistakes that compile but break passes.
- Memory-effect classification: Purity tables for GVN, DCE, and SCCP passes using
get_memory_info(), plus LLVM pass equivalents for cross-referencing implementations.
- Use Case: You need to implement a new CFG simplification pass under
src/xir/passes/. This Skill tells you exactly where to put the header and implementation, how to register it in CMake, how to write Boost.UT tests with reachable test blocks, and which API traps to avoid.
Quick Start
Use the xir_passes skill to help me implement a new XIR transformation pass under src/xir/passes/ with proper registration and unit tests.