> Why don't companies fire all their developers if they can have an algorithm that can output cheap and quality code?
Because it takes an experienced developer to get the machine to output cheap and quality code well enough to be useful.
That developer is just a whole lot more valuable now, because they can do more work at a higher quality.