|
From: Julian S. <js...@ac...> - 2013-01-31 08:38:36
|
On 01/31/2013 03:19 AM, Florian Krohm wrote:
> We should change the definition of HReg to make mixups of integers
> (typically register number) and HReg less likely.
Yes.
> While it would be preferred to find such mixups so at compile time, I
> cannot think of a non-intrusive way to do it.
Didn't you have some previous proposal that did this?
typedef struct { UInt r; } HReg;
so that the typechecker can find all mixups? Changing the encoding
as you suggest is also possible, but the failures will appear as incorrect
generated code, which is a lot harder to diagnose than compiler errors.
What's the objection to the struct scheme? Provided that gcc can inline
suitably, so that there is no extra performance overhead -- important since
regalloc and hence HReg related stuff is the biggest JIT cost -- I would
be happy with it.
But I'd also be happy with your different-encoding scheme too, if you
prefer that. The current situation is for sure not good.
J
|