You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This extends the SCCP optimizer to handle compile-time constant sign
extension operations (OP_sign_ext), complementing the existing constant
truncation optimization.
- 8-bit to 32-bit sign extension (char to int)
- 16-bit to 32-bit sign extension (short to int)
- Proper sign bit propagation for negative values
When sign extension operations have constant operands, they are
evaluated at compile-time and replaced with direct constant loads,
eliminating runtime overhead.
Example transformations:
- char c = -1; int i = c; → i directly loads 0xFFFFFFFF (-1)
- char c = 127; int i = c; → i directly loads 0x0000007F (127)
0 commit comments