-
Notifications
You must be signed in to change notification settings - Fork 697
Description
Filing this issue to capture a discussion that occurred in PR #79.
load/store are often spec'd as having an explicit type, and as being able to implicitly sext
/zext
/trunc
their inputs.
I'm wondering if instead load/store should:
- Be sized to N bytes, and require explicit type cast for load outputs and store input.
- Require implicit
trunc
for stores, andsext
/zext
for loads.
This is different from some compiler IRs, including LLVM's. However, the current stated goal for this format is to keep it simple, and expect the macro layer to capture redundancy. It seems like separating conversion, extension and truncation out of load/store fits the goal.
Keeping this simple doesn't prevent optimization. It's pretty easy to detect this pattern when doing instruction selection, if such an instruction even exists on the target architecture. It does mean the IR has lees magic, and is even easier to spec and implement in a dump interpreter.