Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
Just had a thought: Instead of LLVM modeling and optimizing an IR and then backends having to optimize again for actual machine code lowering, wouldn't it be possible to unite both under one unified system?
If you model everything as one huge and complex state machine with a bunch of predefined "micro ops", couldn't you write an optimizer which lowers to the mathmatical presentation of the target platform's instructions?
I.e. the actual identities of the instructions don't matter. What matters is that the input ir is `(x + 3) & 0xff` and the optimizer tries to fit a sequence of instructions to that so that it "solves the system". It doesn't know x86 `andb`; it knows that `andb` takes an input, maybe truncates it, does a bitwise or, and stores the output into a reg
That way you wouldn't have to write complex target dependent backends. Just declare the sequence of actiosn each instruction does and llvm would automatically be able to produce very high quality machine code
I think there's a phd worth of research here but helllll no I'm not touching compilers again lol
rant
llvm