avr-llvm / llvm

[MERGED UPSTREAM] AVR backend for the LLVM compiler library
220 stars 21 forks source link

WIP: Use the generic branch relaxation infrastructure #231

Closed dylanmckay closed 7 years ago

dylanmckay commented 7 years ago

Fixes #228.

shepmaster commented 7 years ago

Exciting!

dylanmckay commented 7 years ago

Thinking about this more, we probably don't really need this.

It's true that in general, we definitely need some sort of branch relaxation as many of our instructions can only point ~127 bytes ahead or behind of the current IP, but this is normally done in the linker.

The backend used to resolve a lot more fixups to addresses, but I've changed that previously so that we almost always emit relocations in these cases. This means that the linker can do the relaxation.

dylanmckay commented 7 years ago

I've done this and it's in LLVM trunk.

shepmaster commented 7 years ago

Should we delete the branch or do you want to keep it for posterity?

dylanmckay commented 7 years ago

Might as well delete to be honest, this patch only has a small amount of the actual code required/