[llvm] 1b969c6 - Recommit "[M68k] Regenerate divide-by-constant.ll. NFC"
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 12:25:10 PST 2023
Author: Craig Topper
Date: 2023-01-03T12:24:14-08:00
New Revision: 1b969c6b6052d7882f9108c48c3a55c38a85f827
URL: https://github.com/llvm/llvm-project/commit/1b969c6b6052d7882f9108c48c3a55c38a85f827
DIFF: https://github.com/llvm/llvm-project/commit/1b969c6b6052d7882f9108c48c3a55c38a85f827.diff
LOG: Recommit "[M68k] Regenerate divide-by-constant.ll. NFC"
Division algorithm was improved in D140750.
Fixes #59802.
Added:
Modified:
llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll b/llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll
index 4711ff6e648a3..9976875ddf3b7 100644
--- a/llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll
+++ b/llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll
@@ -39,10 +39,9 @@ define zeroext i8 @test3(i8 zeroext %x, i8 zeroext %c) {
; CHECK-NEXT: ; %bb.0: ; %entry
; CHECK-NEXT: move.b (11,%sp), %d0
; CHECK-NEXT: and.l #255, %d0
-; CHECK-NEXT: mulu #-21845, %d0
+; CHECK-NEXT: mulu #21846, %d0
; CHECK-NEXT: lsr.l #8, %d0
; CHECK-NEXT: lsr.l #8, %d0
-; CHECK-NEXT: lsr.w #1, %d0
; CHECK-NEXT: and.l #65535, %d0
; CHECK-NEXT: rts
entry:
@@ -127,11 +126,9 @@ define i8 @test8(i8 %x) nounwind {
; CHECK: ; %bb.0:
; CHECK-NEXT: move.b (7,%sp), %d0
; CHECK-NEXT: and.l #255, %d0
-; CHECK-NEXT: lsr.w #1, %d0
-; CHECK-NEXT: mulu #26887, %d0
+; CHECK-NEXT: mulu #841, %d0
; CHECK-NEXT: lsr.l #8, %d0
; CHECK-NEXT: lsr.l #8, %d0
-; CHECK-NEXT: lsr.w #4, %d0
; CHECK-NEXT: ; kill: def $bd0 killed $bd0 killed $d0
; CHECK-NEXT: rts
%div = udiv i8 %x, 78
@@ -143,10 +140,9 @@ define i8 @test9(i8 %x) nounwind {
; CHECK: ; %bb.0:
; CHECK-NEXT: move.b (7,%sp), %d0
; CHECK-NEXT: and.l #255, %d0
-; CHECK-NEXT: mulu #18079, %d0
+; CHECK-NEXT: mulu #565, %d0
; CHECK-NEXT: lsr.l #8, %d0
; CHECK-NEXT: lsr.l #8, %d0
-; CHECK-NEXT: lsr.w #5, %d0
; CHECK-NEXT: ; kill: def $bd0 killed $bd0 killed $d0
; CHECK-NEXT: rts
%div = udiv i8 %x, 116
More information about the llvm-commits
mailing list