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
doc/IR.md— Documentation (the only place for doc-comments)include/hermes/IR/Instrs.def— Instruction registrationinclude/hermes/IR/Instrs.h— Class definition (NO doc-comments here)include/hermes/IR/IRBuilder.h— Builder declarationlib/IR/IRBuilder.cpp— Builder implementationlib/IR/IRVerifier.cpp— Verification logiclib/Optimizer/Scalar/TypeInference.cpp— Type inference stublib/BCGen/HBC/ISel.cpp— HBC instruction selection (stub or implementation)lib/BCGen/SH/SH.cpp— Static Hermes codegen (stub or implementation)lib/BCGen/facebook/Mins/Mins.cpp— Mins codegen (stub or implementation)- Tests — At minimum, update or add tests in
test/