一句话:提出 ISAMORE 框架,利用 e-graph 反合一从领域应用中挖掘语义等价的可复用自定义指令,性能提升 1.12–2.69 倍。
领域专用加速器依赖自定义指令触发专用硬件,但现有自动探索方法可复用性差、性能受限,只能识别语法相似的标量指令序列,遗漏语义等价模式。本文提出端到端框架 ISAMORE:先用结构化 DSL 将应用编码进 e-graph,再由核心方法 RII 通过 e-graph 反合一发现跨应用的语义等价公共模式;RII 用分阶段迭代与启发式提升可扩展性,引入模式向量化把标量公共操作打包为向量指令 lane,并基于 profiling 的硬件感知代价模型做 Pareto 最优选择以权衡性能与面积。评估显示其较基线提升 1.12x–2.69x,并在库分析、量化 LLM 推理与后量子密码等案例中验证了实用价值。
Domain-specific accelerators provide an increasingly valuable source of performance for diverse applications. Custom instructions that trigger the execution of dedicated hardware units or accelerators for common application functions become key building blocks in modern computing systems, balancing performance and cost effectiveness. RISC-V, the open and extensible instruction set architecture, is increasingly popularizing this trend. However, exploring custom instructions for an application domain remains challenging. Existing automated approaches suffer from poor reusability and limited performance. They can only identify or merge syntactically similar, scalar instruction sequences while missing semantically equivalent patterns. We present ISAMORE, an end-to-end framework for discovering reusable custom instructions from domain applications. ISAMORE encodes general applications in an e-graph by constructing a structured domain-specific language. Its core methodology, reusable instruction identification (RII), leverages e-graph anti-unification (AU) to identify semantically equivalent common patterns across diverse applications, fully unleashing the potential of custom instructions. RII employs a phase-oriented iterative process with smart heuristics to enhance the scalability when dealing with real-world codebases. Besides, RII introduces the novel pattern vectorization technique, packing common operations from scalar programs into lanes of vectorized custom instructions to exploit data-level parallelism. Moreover, RII's Pareto-optimal pattern selection balances performance gains with area overheads, guided by a profiling-based hardware-aware cost model. Evaluation demonstrates ISAMORE 's substantial performance gains, 1.12x-2.69x, over baseline approaches. We also demonstrate ISAMORE's practical potentials using various case studies, including library analysis for three application domains and hardware specialization for quantized LLM inference and post-quantum cryptography.