[llvm] [profcheck][CVP] Adding 'unknown' branch weights for `urem` expansion in CVP (PR #180637)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 16 15:45:37 PST 2026


================
@@ -878,6 +880,11 @@ static bool expandUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR,
     auto *Cmp = B.CreateICmp(ICmpInst::ICMP_ULT, FrozenX, FrozenY,
                              Instr->getName() + ".cmp");
     ExpandedOp = B.CreateSelect(Cmp, FrozenX, AdjX);
+    // Test Unlikely Branch Weights.
+    applyProfMetadataIfEnabled(ExpandedOp, [&](Instruction *Inst) {
----------------
boomanaiden154 wrote:

We don't need to check `ProfcheckDisableMetadataFixes` given these are unknown branch weights. The instruction `dyn_cast` would be the same number of lines and arguably a lot more clear.

https://github.com/llvm/llvm-project/pull/180637


More information about the llvm-commits mailing list