Skip to content

Conversation

tul
Copy link
Contributor

@tul tul commented Jan 10, 2025

The AddLoadNil method is used to merge multiple consecutive LOADNIL instructions of consecutive registers into a single LOADNIL instruction, but it caused issues when the merged instructions were JMP targets, and so generated invalid code; so the merging functionality has been removed.

It is safe to merge the LOADNIL instructions under certain conditions, but additional logic / complexity would be needed to determine this, hence simply disabling merging for now.

Fixes #522

The `AddLoadNil` method used to merge multiple consecutive LOADNIL instructions
of consecutive registers into a single LOADNIL instruction, but it
caused issues when the merged instructions were JMP targets, and so
generated invalid code; so the merging functionality has been removed.

It is safe to merge the LOADNIL instructions under certain conditions,
but additional logic / complexity would be needed.
@coveralls
Copy link

Coverage Status

coverage: 89.603% (-0.02%) from 89.623%
when pulling b3dcd3f on tul:disable_loadnil_merge
into ccacf66 on yuin:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LOADNIL merging optimisation (still) produces invalid code
2 participants