Confirmed users
24
edits
Line 78: | Line 78: | ||
There are some caveats when implementing such a function: | There are some caveats when implementing such a function: | ||
* One needs to keep type consistent. The output type of the replacement MIR node must be the same as the replaced MIR node. | * One needs to keep type consistent. The output type of the replacement MIR node must be the same as the replaced MIR node. | ||
* If you make an assumption on type of the operand and don't use that operand in the replacement MIR node you need to mark that the operand as "''setGuardRangeBailouts''". That will make sure | * If you make an assumption on type of the operand and don't use that operand in the replacement MIR node you need to mark that the operand as "''setGuardRangeBailouts''". That will make sure the engine doesn't remove the type assumption. | ||
=== Examples === | === Examples === |