RKSimon added a comment. Also, we have TargetLowering::hasAndNot - could we not use that and work to make this a generic combine? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112754/new/ https://reviews.llvm.org/D112754