[PATCH] D152605: [AVR][NFC] Improve CodeGen tests

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 20:35:48 PDT 2023

benshi001 created this revision.
benshi001 added reviewers: Patryk27, aykevl, jacquesguan.
Herald added subscribers: Jim, dylanmckay.
Herald added a project: All.
benshi001 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

  rG LLVM Github Monorepo



Index: llvm/test/CodeGen/AVR/hardware-mul.ll
--- llvm/test/CodeGen/AVR/hardware-mul.ll
+++ llvm/test/CodeGen/AVR/hardware-mul.ll
@@ -1,29 +1,40 @@
-; RUN: llc -mattr=mul,movw < %s -march=avr | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
+; RUN: llc -mattr=mul,movw < %s -mtriple=avr | FileCheck %s
 ; Tests lowering of multiplication to hardware instructions.
 define i8 @mult8(i8 %a, i8 %b) {
 ; CHECK-LABEL: mult8:
-; CHECK: muls r22, r24
-; CHECK: clr r1
-; CHECK: mov  r24, r0
+; CHECK:       ; %bb.0:
+; CHECK-NEXT:    muls r22, r24
+; CHECK-NEXT:    clr r1
+; CHECK-NEXT:    mov r24, r0
+; CHECK-NEXT:    ret
   %mul = mul i8 %b, %a
   ret i8 %mul
 define i16 @mult16(i16 %a, i16 %b) {
 ; CHECK-LABEL: mult16:
-; CHECK: muls r22, r25
-; CHECK: mov  r20, r0
-; CHECK: mul  r22, r24
-; CHECK: mov  r21, r0
-; CHECK: mov  r18, r1
-; CHECK: clr r1
-; CHECK: add  r18, r20
-; CHECK: muls r23, r24
-; CHECK: clr r1
-; CHECK: add  r18, r0
-; :TODO: finish after reworking shift instructions
+; CHECK:       ; %bb.0:
+; CHECK-NEXT:    muls r22, r25
+; CHECK-NEXT:    mov r20, r0
+; CHECK-NEXT:    clr r1
+; CHECK-NEXT:    mul r22, r24
+; CHECK-NEXT:    mov r21, r0
+; CHECK-NEXT:    mov r18, r1
+; CHECK-NEXT:    clr r1
+; CHECK-NEXT:    add r18, r20
+; CHECK-NEXT:    muls r23, r24
+; CHECK-NEXT:    clr r1
+; CHECK-NEXT:    add r18, r0
+; CHECK-NEXT:    mov r19, r18
+; CHECK-NEXT:    clr r18
+; CHECK-NEXT:    mov r24, r21
+; CHECK-NEXT:    clr r25
+; CHECK-NEXT:    or r24, r18
+; CHECK-NEXT:    or r25, r19
+; CHECK-NEXT:    ret
   %mul = mul nsw i16 %b, %a
   ret i16 %mul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152605.530137.patch
Type: text/x-patch
Size: 1727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230610/442e11d9/attachment.bin>

More information about the llvm-commits mailing list