4 ms·
Holy shit, this is an excellent tour. I want to look at constraint-based register allocation for my next project, I think. I also wanted to see if it were possi
by tekknolagi 3y ago
Holy shit, this is an excellent tour. I want to look at constraint-based
register allocation for my next project, I think. I also wanted to see if it
were possible to synthesize a data format and short x86 opcode sequences that
would satisfy certain mathematical laws, but I did not figure out how to do
that. Maybe we should chat.
In particular, I love the tiny tiny Union-Find!
uf = {}
def find(x):
while x in uf:
x = uf[x]
return x
def union(x,y):
x = find(x)
y = find(y)
if x != y:
uf[x] = y
return y
That's even smaller than the impl I use in toy projects. Wow.
And thanks for linking to my DDCG posts :)
- philzook 3y agoThanks! Big fan of your posts! Keep it up!
- UncleEntity 3y agoMan, that's a very good explanation of DDCG. I've actually tried to understand the original paper at one point and translated all the complicated greek pseudo-code into, umm...pseudo-code to use at some future point. I spent a little time pondering on how to combine it with global value numbering (if that's even something worthwhile to pursue is still an open question) for an added 'cheap' optimization and to manage a java-like local variable heap(?) but haven't done anything with it yet. A little off topic but props where they're due...
- tekknolagi 3y agoThank you!