File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3883,16 +3883,16 @@ Instruction *InstCombinerImpl::visitSwitchInst(SwitchInst &SI) {
38833883
38843884 auto MaybeInvertible = [&](Value *Cond) -> std::optional<InvertFn> {
38853885 if (match (Cond, m_Add (m_Value (Op0), m_APInt (CondOpC))))
3886- // Change 'switch (X+C) case A :' into 'switch (X) case C-A '.
3887- return [](const APInt &C , const APInt &Case ) { return C - Case ; };
3886+ // Change 'switch (X+C) case Case :' into 'switch (X) case Case-C '.
3887+ return [](const APInt &Case , const APInt &C ) { return Case - C ; };
38883888
38893889 if (match (Cond, m_Sub (m_APInt (CondOpC), m_Value (Op0))))
3890- // Change 'switch (C-X) case A :' into 'switch (X) case A-C '.
3891- return [](const APInt &C , const APInt &Case ) { return Case - C ; };
3890+ // Change 'switch (C-X) case Case :' into 'switch (X) case C-Case '.
3891+ return [](const APInt &Case , const APInt &C ) { return C - Case ; };
38923892
38933893 if (match (Cond, m_Xor (m_Value (Op0), m_APInt (CondOpC))))
3894- // Change 'switch (X^C) case A :' into 'switch (X) case A ^C'.
3895- return [](const APInt &C , const APInt &Case ) { return C ^ Case ; };
3894+ // Change 'switch (X^C) case Case :' into 'switch (X) case Case ^C'.
3895+ return [](const APInt &Case , const APInt &C ) { return Case ^ C ; };
38963896
38973897 return std::nullopt ;
38983898 };
You can’t perform that action at this time.
0 commit comments