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
Here are two IR functions implementing this pseudocode:
defsomefunction(x):
returnswitch.table[x-15]
When somefunction2 is compiled the -15 is moved to the constant table pointer, rather than doing an operation at runtime. Great.
This doesn't happen with somefunction1. Presumably because the compiler wants to maintain the same 8-bit wraparound behavior, so wants to do the arithmetic in 8 bits. But that behavior is irrelevant, as can be determined by either the llvm.assume or the size of the table.
The text was updated successfully, but these errors were encountered:
Two LLVM IR functions
Here are two IR functions implementing this pseudocode:
When
somefunction2
is compiled the-15
is moved to the constant table pointer, rather than doing an operation at runtime. Great.This doesn't happen with
somefunction1
. Presumably because the compiler wants to maintain the same 8-bit wraparound behavior, so wants to do the arithmetic in 8 bits. But that behavior is irrelevant, as can be determined by either thellvm.assume
or the size of the table.The text was updated successfully, but these errors were encountered: