But optimizing compilers that analyze your code and find that portion of your code can be rewritten to make the produced executable more efficient? I'd say it sound a lot like AI, yeah. I woulnd't be shocked if someone told me "gcc's -O3 option uses AI techniques".
The latter is called Programming By Example, and the pattern-finding process needed to infer generalities from specific samples does benefit from machine learning techniques.