[LLVMdev] overflow + saturation stuff
gohman at apple.com
Mon Feb 9 10:20:48 CST 2009
On Feb 8, 2009, at 11:33 AM, Chris Lattner wrote:
> On Feb 8, 2009, at 8:58 AM, Dan Gohman wrote:
>> Hi Chris,
>> Would it be better to split add into multiple opcodes instead of
>> SubclassData bits?
> No, I don't think so. The big difference here is that (like type)
> "opcode" never changes for an instruction once it is created. I
> expect that optimizations would want to play with these (e.g. convert
> them to 'undefined' when it can prove overflow never happens) so I
> think it is nice to not have it be in the opcode field.
Why is this? If SubclassData can be modified, why not SubclassID too?
Having it const may help guard against something accidentally changing
it to an opcode that would require a different subclass, but it's a
member, so modifications to it could be fairly effectively controlled.
I agree that isa/dyn_cast can be quite flexible, but they can handle
ranges of opcodes just as well as they can handle opcodes composed
from multiple fields. The big-switch idiom is a staple of compiler
construction; it would be nice to be able to continue to use it
More information about the LLVMdev