add-ir-instruction

Installation
SKILL.md

Adding a New IR Instruction to Hermes

When adding a new IR instruction, you must touch a specific set of files. This skill describes each file, the pattern to follow, and important conventions.

Checklist of Files to Modify

  1. doc/IR.md — Documentation (the only place for doc-comments)
  2. include/hermes/IR/Instrs.def — Instruction registration
  3. include/hermes/IR/Instrs.h — Class definition (NO doc-comments here)
  4. include/hermes/IR/IRBuilder.h — Builder declaration
  5. lib/IR/IRBuilder.cpp — Builder implementation
  6. lib/IR/IRVerifier.cpp — Verification logic
  7. lib/Optimizer/Scalar/TypeInference.cpp — Type inference stub
  8. lib/BCGen/HBC/ISel.cpp — HBC instruction selection (stub or implementation)
  9. lib/BCGen/SH/SH.cpp — Static Hermes codegen (stub or implementation)
  10. lib/BCGen/facebook/Mins/Mins.cpp — Mins codegen (stub or implementation)
  11. Tests — At minimum, update or add tests in test/
Related skills
Installs
19
Repository
facebook/hermes
GitHub Stars
11.0K
First Seen
Mar 4, 2026