hfinkel added a comment. We could add a TTI callback like we have for popcnt. You could also argue that this is the better canonical form because it can enable other analysis/optimizations (and we should fix the expansion if it is suboptimal). Repository: rL LLVM https://reviews.llvm.org/D32605