From 2463b9b21b9390eb563220609f2f4ee18fa4be51 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 7 Oct 2019 06:50:56 +0000 Subject: [PATCH] [X86] Autogenerate checks in leaFixup32.mir and leaFixup64.mir. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373878 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/leaFixup32.mir | 157 +++++++++++------ test/CodeGen/X86/leaFixup64.mir | 293 +++++++++++++++++++++----------- 2 files changed, 294 insertions(+), 156 deletions(-) diff --git a/test/CodeGen/X86/leaFixup32.mir b/test/CodeGen/X86/leaFixup32.mir index ede0df7c77d..23f3d761696 100644 --- a/test/CodeGen/X86/leaFixup32.mir +++ b/test/CodeGen/X86/leaFixup32.mir @@ -1,3 +1,4 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -run-pass x86-fixup-LEAs -mtriple=i386 -verify-machineinstrs -mcpu=corei7-avx -o - %s | FileCheck %s --- | ; ModuleID = 'test/CodeGen/X86/fixup-lea.ll' @@ -40,13 +41,13 @@ define i32 @test1lea_ebp_32() { ret i32 0 } - + ;test2addi32_32: 3 operands LEA32r that can be replaced with 2 add instructions where ADD32ri32 ; is chosen define i32 @test2addi32_32() { ret i32 0 } - + ;test1mov1add_ebp_32: 2 operands LEA32r that can be replaced with 1 add 1 mov instructions ; where the base is rbp/r13/ebp register define i32 @test1mov1add_ebp_32() { @@ -64,7 +65,7 @@ define i32 @testleaadd_ebp_index2_32() { ret i32 0 } - + ;test_skip_opt_32: 3 operands LEA32r that can not be replaced with 2 instructions define i32 @test_skip_opt_32() { ret i32 0 @@ -84,10 +85,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -104,9 +105,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp - ; CHECK: $eax = ADD32rr $eax, $ebp - ; CHECK: $eax = ADD32ri8 $eax, -5 - + + ; CHECK-LABEL: name: test2add_32 + ; CHECK: liveins: $eax, $ebp + ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags + ; CHECK: $eax = ADD32ri8 $eax, -5, implicit-def $eflags + ; CHECK: RETQ $eax $eax = LEA32r killed $eax, 1, killed $ebp, -5, $noreg RETQ $eax @@ -119,10 +123,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -139,9 +143,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp - ; CHECK: $ebp = ADD32rr $ebp, $eax - ; CHECK: $ebp = ADD32ri8 $ebp, -5 - + + ; CHECK-LABEL: name: test2add_ebp_32 + ; CHECK: liveins: $eax, $ebp + ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags + ; CHECK: $ebp = ADD32ri8 $ebp, -5, implicit-def $eflags + ; CHECK: RETQ $ebp $ebp = LEA32r killed $ebp, 1, killed $eax, -5, $noreg RETQ $ebp @@ -154,10 +161,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -174,8 +181,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp - ; CHECK: $ebp = ADD32rr $ebp, $eax - + + ; CHECK-LABEL: name: test1add_ebp_32 + ; CHECK: liveins: $eax, $ebp + ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags + ; CHECK: RETQ $ebp $ebp = LEA32r killed $ebp, 1, killed $eax, 0, $noreg RETQ $ebp @@ -188,11 +198,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } - { reg: '$ebx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -209,9 +219,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $esi - ; CHECK: $ebx = LEA32r killed $eax, 1, killed $ebp, 0 - ; CHECK: $ebx = ADD32ri8 $ebx, -5 - + + ; CHECK-LABEL: name: testleaadd_32 + ; CHECK: liveins: $eax, $ebp, $esi + ; CHECK: $ebx = LEA32r killed $eax, 1, killed $ebp, 0, $noreg + ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA32r killed $eax, 1, killed $ebp, -5, $noreg RETQ $ebx @@ -224,11 +237,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } - { reg: '$ebx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -245,9 +258,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp + + ; CHECK-LABEL: name: testleaadd_ebp_32 + ; CHECK: liveins: $eax, $ebp ; CHECK: $ebx = LEA32r killed $eax, 1, killed $ebp, 0, $noreg - ; CHECK: $ebx = ADD32ri8 $ebx, -5 - + ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA32r killed $ebp, 1, killed $eax, -5, $noreg RETQ $ebx @@ -260,11 +276,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } - { reg: '$ebx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -281,8 +297,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp + + ; CHECK-LABEL: name: test1lea_ebp_32 + ; CHECK: liveins: $eax, $ebp ; CHECK: $ebx = LEA32r killed $eax, 1, killed $ebp, 0, $noreg - + ; CHECK: RETQ $ebx $ebx = LEA32r killed $ebp, 1, killed $eax, 0, $noreg RETQ $ebx @@ -295,10 +314,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -315,9 +334,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp - ; CHECK: $eax = ADD32rr $eax, $ebp - ; CHECK: $eax = ADD32ri $eax, 129 - + + ; CHECK-LABEL: name: test2addi32_32 + ; CHECK: liveins: $eax, $ebp + ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags + ; CHECK: $eax = ADD32ri $eax, 129, implicit-def $eflags + ; CHECK: RETQ $eax $eax = LEA32r killed $eax, 1, killed $ebp, 129, $noreg RETQ $eax @@ -330,11 +352,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$eax' } - { reg: '$ebx' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -351,9 +373,13 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx - ; CHECK: $ebx = MOV32rr $ebp - ; CHECK: $ebx = ADD32rr $ebx, $ebp - + + ; CHECK-LABEL: name: test1mov1add_ebp_32 + ; CHECK: liveins: $eax, $ebp, $ebx + ; CHECK: $ebx = MOV32rr $ebp + ; CHECK: $ebx = ADD32rr $ebx, $ebp, implicit-def $eflags + ; CHECK: $ebx = LEA32r killed $ebp, 1, $ebp, 0, $noreg + ; CHECK: RETQ $ebx $ebx = LEA32r killed $ebp, 1, $ebp, 0, $noreg RETQ $ebx @@ -366,10 +392,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$ebx' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -386,9 +412,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx + + ; CHECK-LABEL: name: testleaadd_ebp_index_32 + ; CHECK: liveins: $eax, $ebp, $ebx ; CHECK: $ebx = LEA32r $noreg, 1, $ebp, 5, $noreg - ; CHECK: $ebx = ADD32rr $ebx, $ebp - + ; CHECK: $ebx = ADD32rr $ebx, $ebp, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA32r $ebp, 1, $ebp, 5, $noreg RETQ $ebx @@ -401,10 +430,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$ebx' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -421,9 +450,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx + + ; CHECK-LABEL: name: testleaadd_ebp_index2_32 + ; CHECK: liveins: $eax, $ebp, $ebx ; CHECK: $ebx = LEA32r $noreg, 4, $ebp, 5, $noreg - ; CHECK: $ebx = ADD32rr $ebx, $ebp - + ; CHECK: $ebx = ADD32rr $ebx, $ebp, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA32r $ebp, 4, $ebp, 5, $noreg RETQ $ebx @@ -436,10 +468,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$ebx' } - { reg: '$ebp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -456,8 +488,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx + + ; CHECK-LABEL: name: test_skip_opt_32 + ; CHECK: liveins: $eax, $ebp, $ebx ; CHECK: $ebp = LEA32r killed $ebp, 4, killed $ebp, 0, $noreg - + ; CHECK: RETQ $ebp $ebp = LEA32r killed $ebp, 4, killed $ebp, 0, $noreg RETQ $ebp @@ -470,10 +505,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$ebp' } - { reg: '$eax' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -488,12 +523,22 @@ frameInfo: hasVAStart: false hasMustTailInVarArgFunc: false body: | + ; CHECK-LABEL: name: test_skip_eflags_32 + ; CHECK: bb.0 (%ir-block.0): + ; CHECK: successors: %bb.1(0x80000000) + ; CHECK: liveins: $eax, $ebp, $ebx + ; CHECK: CMP32rr $eax, killed $ebx, implicit-def $eflags + ; CHECK: $ebx = LEA32r killed $eax, 4, killed $eax, 5, $noreg + ; CHECK: JCC_1 %bb.1, 4, implicit $eflags + ; CHECK: RETQ $ebx + ; CHECK: bb.1: + ; CHECK: liveins: $eax, $ebp, $ebx + ; CHECK: $ebp = LEA32r killed $ebx, 4, killed $ebx, 0, $noreg + ; CHECK: $ebp = ADD32ri8 $ebp, 5, implicit-def $eflags + ; CHECK: RETQ $ebp bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx - ; CHECK: $ebx = LEA32r killed $eax, 4, killed $eax, 5, $noreg - ; CHECK: $ebp = LEA32r killed $ebx, 4, killed $ebx, 0, $noreg - ; CHECK: $ebp = ADD32ri8 $ebp, 5 - + CMP32rr $eax, killed $ebx, implicit-def $eflags $ebx = LEA32r killed $eax, 4, killed $eax, 5, $noreg JCC_1 %bb.1, 4, implicit $eflags diff --git a/test/CodeGen/X86/leaFixup64.mir b/test/CodeGen/X86/leaFixup64.mir index 4e9c47b11fc..77be5822256 100644 --- a/test/CodeGen/X86/leaFixup64.mir +++ b/test/CodeGen/X86/leaFixup64.mir @@ -1,3 +1,4 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -run-pass x86-fixup-LEAs -mtriple=x86_64-gnu-unknown -verify-machineinstrs -mcpu=corei7-avx -o - %s | FileCheck %s --- | ; ModuleID = 'lea-2.ll' @@ -78,13 +79,13 @@ define i32 @test8() { ret i32 0 } - + ;testleaaddi32_64_32: 3 operands LEA64_32r that can be replaced with 1 lea + 1 add instructions where ; ADD64ri32 is chosen define i32 @testleaaddi32_64_32() { ret i32 0 } - + ;test1mov1add_rbp_64_32: 2 operands LEA64_32r cannot be replaced with 1 add 1 mov instructions ; where the base is rbp/r13/ebp register define i32 @test1mov1add_rbp_64_32() { @@ -102,13 +103,13 @@ define i32 @testleaadd_rbp_index2_64_32() { ret i32 0 } - + ;test2addi32_64: 3 operands LEA64r that can be replaced with 2 add instructions where ADD64ri32 ; is chosen define i32 @test2addi32_64() { ret i32 0 } - + ;test1mov1add_rbp_64: 2 operands LEA64r that can be replaced with 1 add 1 mov instructions ; where the base is rbp/r13/ebp register define i32 @test1mov1add_rbp_64() { @@ -157,10 +158,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -177,9 +178,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_64_32_1 + ; CHECK: liveins: $rax, $rbp ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags, implicit $rax, implicit $rbp ; CHECK: $eax = ADD32ri8 $eax, -5, implicit-def $eflags - + ; CHECK: RETQ $eax $eax = LEA64_32r killed $rax, 1, killed $rbp, -5, $noreg RETQ $eax @@ -192,10 +196,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -212,9 +216,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_rbp_64_32_1 + ; CHECK: liveins: $rax, $rbp ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags, implicit $rbp, implicit $rax ; CHECK: $ebp = ADD32ri8 $ebp, -5, implicit-def $eflags - + ; CHECK: RETQ $ebp $ebp = LEA64_32r killed $rbp, 1, killed $rax, -5, $noreg RETQ $ebp @@ -227,10 +234,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -247,8 +254,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: test1lea_rbp_64_32_1 + ; CHECK: liveins: $rax, $rbp ; CHECK: $ebp = ADD32rr $ebp, $eax, implicit-def $eflags, implicit $rbp, implicit $rax - + ; CHECK: RETQ $ebp $ebp = LEA64_32r killed $rbp, 1, killed $rax, 0, $noreg RETQ $ebp @@ -261,10 +271,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -281,9 +291,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp - ; CHECK: $rax = ADD64rr $rax, $rbp - ; CHECK: $rax = ADD64ri8 $rax, -5 - + + ; CHECK-LABEL: name: test2add_64 + ; CHECK: liveins: $rax, $rbp + ; CHECK: $rax = ADD64rr $rax, $rbp, implicit-def $eflags + ; CHECK: $rax = ADD64ri8 $rax, -5, implicit-def $eflags + ; CHECK: RETQ $eax $rax = LEA64r killed $rax, 1, killed $rbp, -5, $noreg RETQ $eax @@ -296,10 +309,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -316,9 +329,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp - ; CHECK: $rbp = ADD64rr $rbp, $rax - ; CHECK: $rbp = ADD64ri8 $rbp, -5 - + + ; CHECK-LABEL: name: test2add_rbp_64 + ; CHECK: liveins: $rax, $rbp + ; CHECK: $rbp = ADD64rr $rbp, $rax, implicit-def $eflags + ; CHECK: $rbp = ADD64ri8 $rbp, -5, implicit-def $eflags + ; CHECK: RETQ $ebp $rbp = LEA64r killed $rbp, 1, killed $rax, -5, $noreg RETQ $ebp @@ -331,10 +347,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -351,8 +367,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp - ; CHECK: $rbp = ADD64rr $rbp, $rax - + + ; CHECK-LABEL: name: test1add_rbp_64 + ; CHECK: liveins: $rax, $rbp + ; CHECK: $rbp = ADD64rr $rbp, $rax, implicit-def $eflags + ; CHECK: RETQ $ebp $rbp = LEA64r killed $rbp, 1, killed $rax, 0, $noreg RETQ $ebp @@ -365,11 +384,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -386,9 +405,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_64_32 + ; CHECK: liveins: $rax, $rbp ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg - ; CHECK: $ebx = ADD32ri8 $ebx, -5 - + ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rax, 1, killed $rbp, -5, $noreg RETQ $ebx @@ -401,11 +423,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -422,9 +444,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_rbp_64_32 + ; CHECK: liveins: $rax, $rbp ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg - ; CHECK: $ebx = ADD32ri8 $ebx, -5 - + ; CHECK: $ebx = ADD32ri8 $ebx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rbp, 1, killed $rax, -5, $noreg RETQ $ebx @@ -437,11 +462,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -458,8 +483,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: test1lea_rbp_64_32 + ; CHECK: liveins: $rax, $rbp ; CHECK: $ebx = LEA64_32r killed $rax, 1, killed $rbp, 0, $noreg - + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rbp, 1, killed $rax, 0, $noreg RETQ $ebx @@ -472,11 +500,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -493,9 +521,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_64 + ; CHECK: liveins: $rax, $rbp ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg - ; CHECK: $rbx = ADD64ri8 $rbx, -5 - + ; CHECK: $rbx = ADD64ri8 $rbx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $rbx = LEA64r killed $rax, 1, killed $rbp, -5, $noreg RETQ $ebx @@ -508,11 +539,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -529,9 +560,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: testleaadd_rbp_64 + ; CHECK: liveins: $rax, $rbp ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg - ; CHECK: $rbx = ADD64ri8 $rbx, -5 - + ; CHECK: $rbx = ADD64ri8 $rbx, -5, implicit-def $eflags + ; CHECK: RETQ $ebx $rbx = LEA64r killed $rbp, 1, killed $rax, -5, $noreg RETQ $ebx @@ -544,11 +578,11 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } - { reg: '$rbx' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -565,8 +599,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: test1lea_rbp_64 + ; CHECK: liveins: $rax, $rbp ; CHECK: $rbx = LEA64r killed $rax, 1, killed $rbp, 0, $noreg - + ; CHECK: RETQ $ebx $rbx = LEA64r killed $rbp, 1, killed $rax, 0, $noreg RETQ $ebx @@ -579,10 +616,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rdi' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -599,8 +636,13 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rdi, $rbp - ; CHECK: $r12 = LEA64r $noreg, 2, killed $r13, 5, $noreg - ; CHECK: $r12 = ADD64rr $r12, killed $rbp + ; CHECK-LABEL: name: test8 + ; CHECK: liveins: $rdi, $rbp + ; CHECK: $rbp = KILL $rbp, implicit-def $rbp + ; CHECK: $r13 = KILL $rdi, implicit-def $r13 + ; CHECK: $r12 = LEA64r $noreg, 2, killed $r13, 5, $noreg + ; CHECK: $r12 = ADD64rr $r12, killed $rbp, implicit-def $eflags + ; CHECK: RETQ $r12 $rbp = KILL $rbp, implicit-def $rbp $r13 = KILL $rdi, implicit-def $r13 $r12 = LEA64r killed $rbp, 2, killed $r13, 5, $noreg @@ -615,10 +657,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -635,9 +677,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp - ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags + + ; CHECK-LABEL: name: testleaaddi32_64_32 + ; CHECK: liveins: $rax, $rbp + ; CHECK: $eax = ADD32rr $eax, $ebp, implicit-def $eflags, implicit $rax, implicit $rbp ; CHECK: $eax = ADD32ri $eax, 129, implicit-def $eflags - + ; CHECK: RETQ $eax $eax = LEA64_32r killed $rax, 1, killed $rbp, 129, $noreg RETQ $eax @@ -650,10 +695,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -670,8 +715,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx - ; CHECK: $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 0, $noreg + ; CHECK-LABEL: name: test1mov1add_rbp_64_32 + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 0, $noreg + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 0, $noreg RETQ $ebx @@ -684,10 +732,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -704,8 +752,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx + + ; CHECK-LABEL: name: testleaadd_rbp_index_64_32 + ; CHECK: liveins: $rax, $rbp, $rbx ; CHECK: $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 5, $noreg - + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rbp, 1, killed $rbp, 5, $noreg RETQ $ebx @@ -718,10 +769,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -738,8 +789,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $eax, $ebp, $ebx + + ; CHECK-LABEL: name: testleaadd_rbp_index2_64_32 + ; CHECK: liveins: $eax, $ebp, $ebx ; CHECK: $ebx = LEA64_32r killed $rbp, 4, killed $rbp, 5, $noreg - + ; CHECK: RETQ $ebx $ebx = LEA64_32r killed $rbp, 4, killed $rbp, 5, $noreg RETQ $ebx @@ -752,10 +806,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -772,9 +826,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp + + ; CHECK-LABEL: name: test2addi32_64 + ; CHECK: liveins: $rax, $rbp ; CHECK: $rax = ADD64rr $rax, $rbp, implicit-def $eflags ; CHECK: $rax = ADD64ri32 $rax, 129, implicit-def $eflags - + ; CHECK: RETQ $eax $rax = LEA64r killed $rax, 1, killed $rbp, 129, $noreg RETQ $eax @@ -787,10 +844,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rax' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -807,9 +864,13 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx + + ; CHECK-LABEL: name: test1mov1add_rbp_64 + ; CHECK: liveins: $rax, $rbp, $rbx ; CHECK: $rbx = MOV64rr $rbp - ; CHECK: $rbx = ADD64rr $rbx, $rbp - + ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags + ; CHECK: $rbx = LEA64r killed $rbp, 1, $rbp, 0, $noreg + ; CHECK: RETQ $ebx $rbx = LEA64r killed $rbp, 1, $rbp, 0, $noreg RETQ $ebx @@ -822,10 +883,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -842,9 +903,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx - ; CHECK: $rbx = LEA64r $noreg, 1, $rbp, 5, $noreg - ; CHECK: $rbx = ADD64rr $rbx, $rbp - + + ; CHECK-LABEL: name: testleaadd_rbp_index_64 + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: $rbx = LEA64r $noreg, 1, $rbp, 5, $noreg + ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags + ; CHECK: RETQ $ebx $rbx = LEA64r $rbp, 1, $rbp, 5, $noreg RETQ $ebx @@ -857,10 +921,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -877,9 +941,12 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx + + ; CHECK-LABEL: name: testleaadd_rbp_index2_64 + ; CHECK: liveins: $rax, $rbp, $rbx ; CHECK: $rbx = LEA64r $noreg, 4, $rbp, 5, $noreg - ; CHECK: $rbx = ADD64rr $rbx, $rbp - + ; CHECK: $rbx = ADD64rr $rbx, $rbp, implicit-def $eflags + ; CHECK: RETQ $ebx $rbx = LEA64r $rbp, 4, $rbp, 5, $noreg RETQ $ebx @@ -892,10 +959,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -912,8 +979,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx + + ; CHECK-LABEL: name: test_skip_opt_64 + ; CHECK: liveins: $rax, $rbp, $rbx ; CHECK: $rbp = LEA64r killed $rbp, 4, killed $rbp, 0, $noreg - + ; CHECK: RETQ $ebp $rbp = LEA64r killed $rbp, 4, killed $rbp, 0, $noreg RETQ $ebp @@ -926,10 +996,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbp' } - { reg: '$rax' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -944,12 +1014,22 @@ frameInfo: hasVAStart: false hasMustTailInVarArgFunc: false body: | + ; CHECK-LABEL: name: test_skip_eflags_64 + ; CHECK: bb.0 (%ir-block.0): + ; CHECK: successors: %bb.1(0x80000000) + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: CMP64rr $rax, killed $rbx, implicit-def $eflags + ; CHECK: $rbx = LEA64r killed $rax, 4, killed $rax, 5, $noreg + ; CHECK: JCC_1 %bb.1, 4, implicit $eflags + ; CHECK: RETQ $ebx + ; CHECK: bb.1: + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: $rbp = LEA64r killed $rbx, 4, killed $rbx, 0, $noreg + ; CHECK: $rbp = ADD64ri8 $rbp, 5, implicit-def $eflags + ; CHECK: RETQ $ebp bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx - ; CHECK: $rbx = LEA64r killed $rax, 4, killed $rax, 5, $noreg - ; CHECK: $rbp = LEA64r killed $rbx, 4, killed $rbx, 0, $noreg - ; CHECK: $rbp = ADD64ri8 $rbp, 5 - + CMP64rr $rax, killed $rbx, implicit-def $eflags $rbx = LEA64r killed $rax, 4, killed $rax, 5, $noreg JCC_1 %bb.1, 4, implicit $eflags @@ -968,10 +1048,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbx' } - { reg: '$rbp' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -988,8 +1068,11 @@ frameInfo: body: | bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx + + ; CHECK-LABEL: name: test_skip_opt_64_32 + ; CHECK: liveins: $rax, $rbp, $rbx ; CHECK: $ebp = LEA64_32r killed $rbp, 4, killed $rbp, 0, $noreg - + ; CHECK: RETQ $ebp $ebp = LEA64_32r killed $rbp, 4, killed $rbp, 0, $noreg RETQ $ebp @@ -1002,10 +1085,10 @@ legalized: false regBankSelected: false selected: false tracksRegLiveness: true -liveins: +liveins: - { reg: '$rbp' } - { reg: '$rax' } -frameInfo: +frameInfo: isFrameAddressTaken: false isReturnAddressTaken: false hasStackMap: false @@ -1020,12 +1103,22 @@ frameInfo: hasVAStart: false hasMustTailInVarArgFunc: false body: | + ; CHECK-LABEL: name: test_skip_eflags_64_32 + ; CHECK: bb.0 (%ir-block.0): + ; CHECK: successors: %bb.1(0x80000000) + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: CMP64rr $rax, killed $rbx, implicit-def $eflags + ; CHECK: $ebx = LEA64_32r killed $rax, 4, killed $rax, 5, $noreg + ; CHECK: JCC_1 %bb.1, 4, implicit $eflags + ; CHECK: RETQ $ebx + ; CHECK: bb.1: + ; CHECK: liveins: $rax, $rbp, $rbx + ; CHECK: $ebp = LEA64_32r killed $rbx, 4, killed $rbx, 0, $noreg + ; CHECK: $ebp = ADD32ri8 $ebp, 5, implicit-def $eflags + ; CHECK: RETQ $ebp bb.0 (%ir-block.0): liveins: $rax, $rbp, $rbx - ; CHECK: $ebx = LEA64_32r killed $rax, 4, killed $rax, 5, $noreg - ; CHECK: $ebp = LEA64_32r killed $rbx, 4, killed $rbx, 0, $noreg - ; CHECK: $ebp = ADD32ri8 $ebp, 5 - + CMP64rr $rax, killed $rbx, implicit-def $eflags $ebx = LEA64_32r killed $rax, 4, killed $rax, 5, $noreg JCC_1 %bb.1, 4, implicit $eflags -- 2.40.0