spatel added a comment. I haven't looked at the details of the motivating examples, but CodeGenPrepare has cross-basic-block transforms to invert canonicalizations using TTI/TLI. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112300/new/ https://reviews.llvm.org/D112300