> BTW: anyone aware of LLVM optimizer passimplementations that can deal with MBAs ?
Your best bet is InstCombine, but likely most of the MBA patterns aren't going to be InstCombine patterns because who writes that kind of code?
In principle, you might see if you can tickle Alive2 (which can map LLVM IR to SMT logic) to see if you can get a peephole optimizer that's querying an SMT solver. But I'm not aware of anyone who's built a pass like that yet, and it's definitely not a regular pass in the compiler.
Wasn't aware of Alive2. Thx, I'll have look.
I had some success with https://github.com/mrphrazer/msynth But its hard to glue this to LLVM.