[ValueTracking] Teach canCreateUndefOrPoison that ctpop does not create undef or poison.
This select of ctpop with 0 pattern can get left behind after loop idiom recognize converts a loop to ctpop. LLVM 10 was able to optimize this, but LLVM 11 and later is not. The difference seems to be that some select transforms are now limited based on canCreateUndefOrPoison. Teaching canCreateUndefOrPoison about ctpop restores the LLVM 10 codegen. Differential Revision: https://reviews.llvm.org/D99207
Loading
Please sign in to comment