From: Igor Breger Date: Wed, 16 Aug 2017 07:25:51 +0000 (+0000) Subject: [GlobalISel][X86] Fix mir tests, use correct physical register.NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d6d71c7e1b393c2fd25b78873d0366bed1e5e52;p=llvm [GlobalISel][X86] Fix mir tests, use correct physical register.NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310996 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/GlobalISel/select-GV.mir b/test/CodeGen/X86/GlobalISel/select-GV.mir index 2f2fd51d99d..7e8d61f002e 100644 --- a/test/CodeGen/X86/GlobalISel/select-GV.mir +++ b/test/CodeGen/X86/GlobalISel/select-GV.mir @@ -7,9 +7,10 @@ @g_int = global i32 0, align 4 - define i32* @test_global_ptrv() { + define void @test_global_ptrv() { entry: - ret i32* @g_int + store i32* @g_int, i32** undef + ret void } define i32 @test_global_valv() { @@ -27,31 +28,45 @@ legalized: true regBankSelected: true # X64ALL: registers: # X64ALL-NEXT: - { id: 0, class: gr64, preferred-register: '' } +# X64ALL-NEXT: - { id: 1, class: gr64, preferred-register: '' } # -# X32ALL: registers: -# X32ALL-NEXT: - { id: 0, class: gr32, preferred-register: '' } +# X32: registers: +# X32-NEXT: - { id: 0, class: gr32, preferred-register: '' } +# X32-NEXT: - { id: 1, class: gr32, preferred-register: '' } +# +# X32ABI: registers: +# X32ABI-NEXT: - { id: 0, class: low32_addr_access, preferred-register: '' } +# X32ABI-NEXT: - { id: 1, class: gr32, preferred-register: '' } registers: - { id: 0, class: gpr, preferred-register: '' } -# X64: %0 = LEA64r _, 1, _, @g_int, _ -# X64-NEXT: %rax = COPY %0 -# X64-NEXT: RET 0, implicit %rax + - { id: 1, class: gpr, preferred-register: '' } +# X64: %0 = IMPLICIT_DEF +# X64-NEXT: %1 = LEA64r _, 1, _, @g_int, _ +# X64-NEXT: MOV64mr %0, 1, _, 0, _, %1 :: (store 8 into `i32** undef`) +# X64-NEXT: RET 0 # -# X64_DARWIN_PIC: %0 = LEA64r %rip, 1, _, @g_int, _ -# X64_DARWIN_PIC-NEXT: %rax = COPY %0 -# X64_DARWIN_PIC-NEXT: RET 0, implicit %rax +# X64_DARWIN_PIC: %0 = IMPLICIT_DEF +# X64_DARWIN_PIC-NEXT: %1 = LEA64r %rip, 1, _, @g_int, _ +# X64_DARWIN_PIC-NEXT: MOV64mr %0, 1, _, 0, _, %1 :: (store 8 into `i32** undef`) +# X64_DARWIN_PIC-NEXT: RET 0 # -# X32: %0 = LEA32r _, 1, _, @g_int, _ -# X32-NEXT: %rax = COPY %0 -# X32-NEXT: RET 0, implicit %rax +# X32: %0 = IMPLICIT_DEF +# X32-NEXT: %1 = LEA32r _, 1, _, @g_int, _ +# X32-NEXT: MOV32mr %0, 1, _, 0, _, %1 :: (store 8 into `i32** undef`) +# X32-NEXT: RET 0 # -# X32ABI: %0 = LEA64_32r _, 1, _, @g_int, _ -# X32ABI-NEXT: %rax = COPY %0 -# X32ABI-NEXT: RET 0, implicit %rax +# X32ABI: %0 = IMPLICIT_DEF +# X32ABI-NEXT: %1 = LEA64_32r _, 1, _, @g_int, _ +# X32ABI-NEXT: MOV32mr %0, 1, _, 0, _, %1 :: (store 8 into `i32** undef`) +# X32ABI-NEXT: RET 0 body: | bb.1.entry: - %0(p0) = G_GLOBAL_VALUE @g_int - %rax = COPY %0(p0) - RET 0, implicit %rax + liveins: %rdi + + %0(p0) = IMPLICIT_DEF + %1(p0) = G_GLOBAL_VALUE @g_int + G_STORE %1(p0), %0(p0) :: (store 8 into `i32** undef`) + RET 0 ... --- diff --git a/test/CodeGen/X86/GlobalISel/select-add.mir b/test/CodeGen/X86/GlobalISel/select-add.mir index 45811c5cdc2..7bc3526ab36 100644 --- a/test/CodeGen/X86/GlobalISel/select-add.mir +++ b/test/CodeGen/X86/GlobalISel/select-add.mir @@ -85,7 +85,7 @@ body: | %0(s32) = COPY %edi %1(s32) = COPY %esi %2(s32) = G_ADD %0, %1 - %rax = COPY %2(s32) + %eax = COPY %2(s32) ... --- diff --git a/test/CodeGen/X86/GlobalISel/select-sub.mir b/test/CodeGen/X86/GlobalISel/select-sub.mir index d47f77828c9..971b5468079 100644 --- a/test/CodeGen/X86/GlobalISel/select-sub.mir +++ b/test/CodeGen/X86/GlobalISel/select-sub.mir @@ -73,7 +73,7 @@ body: | %0(s32) = COPY %edi %1(s32) = COPY %esi %2(s32) = G_SUB %0, %1 - %rax = COPY %2(s32) + %eax = COPY %2(s32) ... ---