add-ir-instruction

Guide adding a new IR instruction to the Hermes JavaScript engine.

11.2k|839|Updated Oct 22, 2018
One-click install
npx skills add https://github.com/facebook/hermes --skill add-ir-instruction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-ir-instruction
Source: https://github.com/facebook/hermes/tree/main/.claude/skills/add-ir-instruction
Command: npx skills add https://github.com/facebook/hermes --skill add-ir-instruction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide for adding new Intermediate Representation (IR) instructions to the Hermes JavaScript engine, ensuring all necessary files and conventions are followed.

Core Features & Use Cases

  • Structured Guidance: Details the exact files to modify and the patterns to follow for each.
  • Convention Enforcement: Highlights key conventions like documentation placement and naming consistency.
  • Use Case: A compiler engineer needs to introduce a new optimization instruction into Hermes and requires a step-by-step process to correctly integrate it into the codebase.

Quick Start

Follow the guide to add a new IR instruction named 'MyNewInst' to the Hermes compiler.

Frequently Asked Questions about add-ir-instruction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new IR instruction to the Hermes JavaScript engine?

To add a new IR instruction to Hermes, you must modify documentation, register the instruction, define its class, implement the IR builder, add verification logic, update type inference, and implement code generation across multiple backends.

What files need to be modified when adding an instruction to the Hermes compiler?

Adding an instruction to the Hermes compiler requires modifying files for documentation, instruction registration, class definitions, IR builder implementation, verification logic, type inference, and code generation for HBC, SH, and Mins backends.

Does adding a new Hermes IR instruction require updating all backends?

Yes, adding a new Hermes IR instruction requires implementing code generation across multiple backends, specifically HBC, SH, and Mins, ensuring the new instruction is fully supported throughout the compiler infrastructure.

What conventions should I follow when implementing a new IR instruction in Hermes?

When implementing a new Hermes IR instruction, you must follow key conventions including proper documentation placement and maintaining naming consistency across all modified files to ensure correct integration into the codebase.

Do I need to implement a lowering pass for every new IR instruction in Hermes?

Implementing a lowering pass for a new IR instruction in Hermes is optional. The guide addresses optional lowering pass implementation alongside mandatory steps like type inference, verification logic, and backend code generation.

What testing procedures are required after adding an IR instruction to Hermes?

After adding an IR instruction to Hermes, you must follow specific testing procedures to verify the implementation. This ensures the new instruction correctly integrates with type inference, verification logic, and backend code generation.