+# 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'
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() {
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
- { reg: '$ebx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
- { reg: '$ebx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
- { reg: '$ebx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$eax' }
- { reg: '$ebx' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$ebx' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$ebx' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$ebx' }
- { reg: '$ebp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$ebp' }
- { reg: '$eax' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
+# 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'
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() {
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() {
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
- { reg: '$rbx' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rdi' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rax' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbp' }
- { reg: '$rax' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbx' }
- { reg: '$rbp' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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
regBankSelected: false
selected: false
tracksRegLiveness: true
-liveins:
+liveins:
- { reg: '$rbp' }
- { reg: '$rax' }
-frameInfo:
+frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
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