jayfoad wrote: > However, during legalisation we introduce an OR of the loaded value with a constant. At that point the cttz should have been replaced with cttz_zero_undef. Does #92514 work for you? https://github.com/llvm/llvm-project/pull/79127