ekatz added a comment. I admit, I don't know much about CG, but shouldn't this optimization be done in the IR level? Or were these SELECTS only introduced in CG? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76523/new/ https://reviews.llvm.org/D76523