chrisjbris wrote: It's possible I'm misusing shouldFoldSelectWithIdentityConstant(), but if this is the case I propose adding a similar function to TargetLowering that fulfills the intended purpose in this PR. https://github.com/llvm/llvm-project/pull/147325