From f36f0f23c430c9b049b98761b425ddb184a1e1d8 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 19 Jul 2022 14:54:57 -0400 Subject: [PATCH] [x86] add tests for fixup-bw with size optimization attrs; NFC --- llvm/test/CodeGen/X86/fixup-bw-copy.ll | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/llvm/test/CodeGen/X86/fixup-bw-copy.ll b/llvm/test/CodeGen/X86/fixup-bw-copy.ll index 88a2af9..f73b0c8 100644 --- a/llvm/test/CodeGen/X86/fixup-bw-copy.ll +++ b/llvm/test/CodeGen/X86/fixup-bw-copy.ll @@ -6,7 +6,7 @@ target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" -define i8 @test_movb(i8 %a0) { +define i8 @test_movb(i8 %a0) nounwind { ; X64-LABEL: test_movb: ; X64: # %bb.0: ; X64-NEXT: movl %edi, %eax @@ -20,6 +20,34 @@ define i8 @test_movb(i8 %a0) { ret i8 %a0 } +define i8 @test_movb_Os(i8 %a0) nounwind optsize { +; X64-LABEL: test_movb_Os: +; X64: # %bb.0: +; X64-NEXT: movl %edi, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq +; +; X32-LABEL: test_movb_Os: +; X32: # %bb.0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: retl + ret i8 %a0 +} + +define i8 @test_movb_Oz(i8 %a0) nounwind minsize { +; X64-LABEL: test_movb_Oz: +; X64: # %bb.0: +; X64-NEXT: movl %edi, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq +; +; X32-LABEL: test_movb_Oz: +; X32: # %bb.0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: retl + ret i8 %a0 +} + define i16 @test_movw(i16 %a0) { ; X64-LABEL: test_movw: ; X64: # %bb.0: -- 2.7.4