It would actually be very straightforward to do so if the costs of testing solutions weren't so high. CPU architecture and JIT code can both be represented as unstructured (non-tabular) data. I even recall a circuit having been optimized by a genetic algorithm a while ago in an experiment. I also recall using LSTM to generate valid code from IIRC examples in Linux. Superiptimizatiom is also a relevant topic.
We just need better simulation tools or more resources.