Andarwinux wrote: I noticed x86 currently doesn't have a cost test for masked divrem like https://github.com/llvm/llvm-project/blob/main/llvm/test/Analysis/CostModel/AArch64/masked-divrem.ll, so might need to add one. https://github.com/llvm/llvm-project/pull/215124