[llvm] [CodeGen] Emit a more efficient magic number multiplication for exact udivs (PR #87161)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue May 7 13:40:59 PDT 2024
================
@@ -5122,6 +5149,29 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) {
return true;
};
+ if (MI.getFlag(MachineInstr::MIFlag::IsExact)) {
+ // Collect all magic values from the build vector.
+ bool Matched = matchUnaryPredicate(MRI, RHS, BuildExactUDIVPattern);
+ (void)Matched;
+ assert(Matched && "Expected unary predicate match to succeed");
----------------
arsenm wrote:
Well both asserts would be written cleaner this way
https://github.com/llvm/llvm-project/pull/87161
More information about the llvm-commits
mailing list