How takashiidobe/rocky works
Rocky is a Rust tool that compiles HIP source for gfx1031, extracts its GPU code object, disassembles it, lifts a supported comparison instruction, and emits verified LLVM IR to a sibling .ll file. The main path is orchestrated by src/main.rs; compilation and disassembly use external ROCm/LLVM tools. Parsing currently recognizes only v_cmp_eq_u32_e32, rather than implementing the README’s broader CFG-and-fuzz testing flow. The graph reflects sampled source; broader README workflow items are not treated as implemented subsystems.
Main entry points: main.rs Pipeline Runner · compile/mod.rs HIP Compiler · asm/mod.rs Disassembly Service · instruction.rs Compare Decoder
Components 16
Pipeline
- Pipeline Runner
src/main.rs - Process Runner
src/tool.rs
HIP Compilation
- HIP Compiler
src/compile/mod.rs
Disassembly
- Disassembly Service
src/asm/mod.rs - Disassembly Parser
src/asm/disassembly.rs - Assembly Lexer
src/asm/lexer.rs
LLVM Lifting
- Compare Decoder
src/llvm/instruction.rs - Register Types
src/llvm/register.rs - LLVM IR Emitter
src/llvm/ir.rs
Other components
- Engineer
- HIP Source
- hipcc
- Offload Bundler
- GPU Code Object
- llvm-objdump
- LLVM IR File
Connections 19
- Engineer → Pipeline Runner: provides source
README.md - Pipeline Runner → HIP Compiler: compiles source
src/main.rs - HIP Compiler → hipcc: invokes
src/compile/mod.rs - HIP Compiler → Offload Bundler: unbundles image
src/compile/mod.rs - HIP Compiler → Process Runner: runs commands
src/compile/mod.rs - HIP Source → HIP Compiler: supplies input
src/compile/mod.rs - HIP Compiler → GPU Code Object: produces
src/compile/mod.rs - Pipeline Runner → Disassembly Service: disassembles object
src/main.rs - Disassembly Service → llvm-objdump: invokes
src/asm/mod.rs - Disassembly Service → Process Runner: runs command
src/asm/mod.rs - Disassembly Service → Disassembly Parser: parses output
src/asm/mod.rs - Disassembly Parser → Assembly Lexer: tokenizes lines
src/asm/disassembly.rs - Pipeline Runner → Compare Decoder: decodes disassembly
src/main.rs - Compare Decoder → Assembly Lexer: reads operand tokens
src/llvm/instruction.rs - Compare Decoder → Register Types: parses registers
src/llvm/instruction.rs - Pipeline Runner → LLVM IR Emitter: emits IR
src/main.rs - LLVM IR Emitter → Compare Decoder: consumes decoded instructions
src/llvm/ir.rs - LLVM IR Emitter → Register Types: uses register indices
src/llvm/ir.rs - Pipeline Runner → LLVM IR File: writes IR
src/main.rs