5

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

Comments
  • 1
    yes but you're giving them ideas on how to exclude programmers from even existing

    imagine they pushed all companies to only code like that instead like this vibe coding thing is being pushed. these guys seem to eat it up

    would be quite a bit of work to set that up but these people _want_ to _take your jobs_ so to speak. which I don't fear or anything. but if they have the political clout to force companies to force their devs to use AI, whether the AI to machine code or programmers to machine code system would be better would be irrelevant, because they'd just overtake everything with the politics even if it may not be the best way

    and you can't compete because they fund the tools, and nobody thinks that you politically are worth it anymore
Add Comment