[X86] Fix scheduler class for BTmi instructions

This wasn't treated as a folded load instruction

llvm-svn: 343424
This commit is contained in:
Simon Pilgrim 2018-09-30 20:19:16 +00:00
parent d435ce4343
commit f21083870d
5 changed files with 31 additions and 31 deletions

View File

@ -1799,7 +1799,7 @@ def BT64ri8 : RIi8<0xBA, MRM4r, (outs), (ins GR64:$src1, i64i8imm:$src2),
// Note that these instructions aren't slow because that only applies when the
// other operand is in a register. When it's an immediate, bt is still fast.
let SchedRW = [WriteALU] in {
let SchedRW = [WriteALULd] in {
def BT16mi8 : Ii8<0xBA, MRM4m, (outs), (ins i16mem:$src1, i16i8imm:$src2),
"bt{w}\t{$src2, $src1|$src1, $src2}",
[(set EFLAGS, (X86bt (loadi16 addr:$src1),

View File

@ -2703,7 +2703,7 @@ define void @test_bt_btc_btr_bts_16(i16 %a0, i16 %a1, i16 *%a2) optsize {
; ATOM-NEXT: btcw $7, %di # sched: [1:1.00]
; ATOM-NEXT: btrw $7, %di # sched: [1:1.00]
; ATOM-NEXT: btsw $7, %di # sched: [1:1.00]
; ATOM-NEXT: btw $7, (%rdx) # sched: [1:0.50]
; ATOM-NEXT: btw $7, (%rdx) # sched: [1:1.00]
; ATOM-NEXT: btcw $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btrw $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btsw $7, (%rdx) # sched: [2:1.00]
@ -2725,7 +2725,7 @@ define void @test_bt_btc_btr_bts_16(i16 %a0, i16 %a1, i16 *%a2) optsize {
; SLM-NEXT: btcw $7, %di # sched: [1:0.50]
; SLM-NEXT: btrw $7, %di # sched: [1:0.50]
; SLM-NEXT: btsw $7, %di # sched: [1:0.50]
; SLM-NEXT: btw $7, (%rdx) # sched: [1:0.50]
; SLM-NEXT: btw $7, (%rdx) # sched: [4:1.00]
; SLM-NEXT: btcw $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btrw $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btsw $7, (%rdx) # sched: [4:2.00]
@ -2857,7 +2857,7 @@ define void @test_bt_btc_btr_bts_16(i16 %a0, i16 %a1, i16 *%a2) optsize {
; BTVER2-NEXT: btcw $7, %di # sched: [1:0.50]
; BTVER2-NEXT: btrw $7, %di # sched: [1:0.50]
; BTVER2-NEXT: btsw $7, %di # sched: [1:0.50]
; BTVER2-NEXT: btw $7, (%rdx) # sched: [1:0.50]
; BTVER2-NEXT: btw $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btcw $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btrw $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btsw $7, (%rdx) # sched: [4:1.00]
@ -2926,7 +2926,7 @@ define void @test_bt_btc_btr_bts_32(i32 %a0, i32 %a1, i32 *%a2) optsize {
; ATOM-NEXT: btcl $7, %edi # sched: [1:1.00]
; ATOM-NEXT: btrl $7, %edi # sched: [1:1.00]
; ATOM-NEXT: btsl $7, %edi # sched: [1:1.00]
; ATOM-NEXT: btl $7, (%rdx) # sched: [1:0.50]
; ATOM-NEXT: btl $7, (%rdx) # sched: [1:1.00]
; ATOM-NEXT: btcl $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btrl $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btsl $7, (%rdx) # sched: [2:1.00]
@ -2948,7 +2948,7 @@ define void @test_bt_btc_btr_bts_32(i32 %a0, i32 %a1, i32 *%a2) optsize {
; SLM-NEXT: btcl $7, %edi # sched: [1:0.50]
; SLM-NEXT: btrl $7, %edi # sched: [1:0.50]
; SLM-NEXT: btsl $7, %edi # sched: [1:0.50]
; SLM-NEXT: btl $7, (%rdx) # sched: [1:0.50]
; SLM-NEXT: btl $7, (%rdx) # sched: [4:1.00]
; SLM-NEXT: btcl $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btrl $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btsl $7, (%rdx) # sched: [4:2.00]
@ -3080,7 +3080,7 @@ define void @test_bt_btc_btr_bts_32(i32 %a0, i32 %a1, i32 *%a2) optsize {
; BTVER2-NEXT: btcl $7, %edi # sched: [1:0.50]
; BTVER2-NEXT: btrl $7, %edi # sched: [1:0.50]
; BTVER2-NEXT: btsl $7, %edi # sched: [1:0.50]
; BTVER2-NEXT: btl $7, (%rdx) # sched: [1:0.50]
; BTVER2-NEXT: btl $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btcl $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btrl $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btsl $7, (%rdx) # sched: [4:1.00]
@ -3149,7 +3149,7 @@ define void @test_bt_btc_btr_bts_64(i64 %a0, i64 %a1, i64 *%a2) optsize {
; ATOM-NEXT: btcq $7, %rdi # sched: [1:1.00]
; ATOM-NEXT: btrq $7, %rdi # sched: [1:1.00]
; ATOM-NEXT: btsq $7, %rdi # sched: [1:1.00]
; ATOM-NEXT: btq $7, (%rdx) # sched: [1:0.50]
; ATOM-NEXT: btq $7, (%rdx) # sched: [1:1.00]
; ATOM-NEXT: btcq $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btrq $7, (%rdx) # sched: [2:1.00]
; ATOM-NEXT: btsq $7, (%rdx) # sched: [2:1.00]
@ -3171,7 +3171,7 @@ define void @test_bt_btc_btr_bts_64(i64 %a0, i64 %a1, i64 *%a2) optsize {
; SLM-NEXT: btcq $7, %rdi # sched: [1:0.50]
; SLM-NEXT: btrq $7, %rdi # sched: [1:0.50]
; SLM-NEXT: btsq $7, %rdi # sched: [1:0.50]
; SLM-NEXT: btq $7, (%rdx) # sched: [1:0.50]
; SLM-NEXT: btq $7, (%rdx) # sched: [4:1.00]
; SLM-NEXT: btcq $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btrq $7, (%rdx) # sched: [4:2.00]
; SLM-NEXT: btsq $7, (%rdx) # sched: [4:2.00]
@ -3303,7 +3303,7 @@ define void @test_bt_btc_btr_bts_64(i64 %a0, i64 %a1, i64 *%a2) optsize {
; BTVER2-NEXT: btcq $7, %rdi # sched: [1:0.50]
; BTVER2-NEXT: btrq $7, %rdi # sched: [1:0.50]
; BTVER2-NEXT: btsq $7, %rdi # sched: [1:0.50]
; BTVER2-NEXT: btq $7, (%rdx) # sched: [1:0.50]
; BTVER2-NEXT: btq $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btcq $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btrq $7, (%rdx) # sched: [4:1.00]
; BTVER2-NEXT: btsq $7, (%rdx) # sched: [4:1.00]

View File

@ -977,7 +977,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 1.00 btcw $7, %di
# CHECK-NEXT: 1 1 1.00 btrw $7, %di
# CHECK-NEXT: 1 1 1.00 btsw $7, %di
# CHECK-NEXT: 1 1 0.50 * btw $7, (%rax)
# CHECK-NEXT: 1 1 1.00 * btw $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btcw $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btrw $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btsw $7, (%rax)
@ -993,7 +993,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 1.00 btcl $7, %edi
# CHECK-NEXT: 1 1 1.00 btrl $7, %edi
# CHECK-NEXT: 1 1 1.00 btsl $7, %edi
# CHECK-NEXT: 1 1 0.50 * btl $7, (%rax)
# CHECK-NEXT: 1 1 1.00 * btl $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btcl $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btrl $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btsl $7, (%rax)
@ -1009,7 +1009,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 1.00 btcq $7, %rdi
# CHECK-NEXT: 1 1 1.00 btrq $7, %rdi
# CHECK-NEXT: 1 1 1.00 btsq $7, %rdi
# CHECK-NEXT: 1 1 0.50 * btq $7, (%rax)
# CHECK-NEXT: 1 1 1.00 * btq $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btcq $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btrq $7, (%rax)
# CHECK-NEXT: 1 2 1.00 * * btsq $7, (%rax)
@ -1614,7 +1614,7 @@ xorq (%rax), %rdi
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1]
# CHECK-NEXT: 2392.00 2051.00
# CHECK-NEXT: 2393.50 2049.50
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] Instructions:
@ -1734,7 +1734,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - 1.00 btcw $7, %di
# CHECK-NEXT: - 1.00 btrw $7, %di
# CHECK-NEXT: - 1.00 btsw $7, %di
# CHECK-NEXT: 0.50 0.50 btw $7, (%rax)
# CHECK-NEXT: 1.00 - btw $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btcw $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btrw $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btsw $7, (%rax)
@ -1750,7 +1750,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - 1.00 btcl $7, %edi
# CHECK-NEXT: - 1.00 btrl $7, %edi
# CHECK-NEXT: - 1.00 btsl $7, %edi
# CHECK-NEXT: 0.50 0.50 btl $7, (%rax)
# CHECK-NEXT: 1.00 - btl $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btcl $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btrl $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btsl $7, (%rax)
@ -1766,7 +1766,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - 1.00 btcq $7, %rdi
# CHECK-NEXT: - 1.00 btrq $7, %rdi
# CHECK-NEXT: - 1.00 btsq $7, %rdi
# CHECK-NEXT: 0.50 0.50 btq $7, (%rax)
# CHECK-NEXT: 1.00 - btq $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btcq $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btrq $7, (%rax)
# CHECK-NEXT: 1.00 1.00 btsq $7, (%rax)

View File

@ -977,7 +977,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 2 1 0.50 btcw $7, %di
# CHECK-NEXT: 2 1 0.50 btrw $7, %di
# CHECK-NEXT: 2 1 0.50 btsw $7, %di
# CHECK-NEXT: 1 1 0.50 * btw $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btw $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btcw $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btrw $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btsw $7, (%rax)
@ -993,7 +993,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 2 1 0.50 btcl $7, %edi
# CHECK-NEXT: 2 1 0.50 btrl $7, %edi
# CHECK-NEXT: 2 1 0.50 btsl $7, %edi
# CHECK-NEXT: 1 1 0.50 * btl $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btl $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btcl $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btrl $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btsl $7, (%rax)
@ -1009,7 +1009,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 2 1 0.50 btcq $7, %rdi
# CHECK-NEXT: 2 1 0.50 btrq $7, %rdi
# CHECK-NEXT: 2 1 0.50 btsq $7, %rdi
# CHECK-NEXT: 1 1 0.50 * btq $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btq $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btcq $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btrq $7, (%rax)
# CHECK-NEXT: 2 4 1.00 * * btsq $7, (%rax)
@ -1626,7 +1626,7 @@ xorq (%rax), %rdi
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
# CHECK-NEXT: 581.50 631.50 380.00 - - - - 319.00 64.00 223.00 - - - -
# CHECK-NEXT: 581.50 631.50 380.00 - - - - 322.00 64.00 223.00 - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions:
@ -1746,7 +1746,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btcw $7, %di
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btrw $7, %di
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btsw $7, %di
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btw $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - btw $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btcw $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btrw $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btsw $7, (%rax)
@ -1762,7 +1762,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btcl $7, %edi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btrl $7, %edi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btsl $7, %edi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btl $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - btl $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btcl $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btrl $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btsl $7, (%rax)
@ -1778,7 +1778,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btcq $7, %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btrq $7, %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btsq $7, %rdi
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - btq $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - btq $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btcq $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btrq $7, (%rax)
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - btsq $7, (%rax)

View File

@ -977,7 +977,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 0.50 btcw $7, %di
# CHECK-NEXT: 1 1 0.50 btrw $7, %di
# CHECK-NEXT: 1 1 0.50 btsw $7, %di
# CHECK-NEXT: 1 1 0.50 * btw $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btw $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btcw $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btrw $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btsw $7, (%rax)
@ -993,7 +993,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 0.50 btcl $7, %edi
# CHECK-NEXT: 1 1 0.50 btrl $7, %edi
# CHECK-NEXT: 1 1 0.50 btsl $7, %edi
# CHECK-NEXT: 1 1 0.50 * btl $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btl $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btcl $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btrl $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btsl $7, (%rax)
@ -1009,7 +1009,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: 1 1 0.50 btcq $7, %rdi
# CHECK-NEXT: 1 1 0.50 btrq $7, %rdi
# CHECK-NEXT: 1 1 0.50 btsq $7, %rdi
# CHECK-NEXT: 1 1 0.50 * btq $7, (%rax)
# CHECK-NEXT: 1 4 1.00 * btq $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btcq $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btrq $7, (%rax)
# CHECK-NEXT: 2 4 2.00 * * btsq $7, (%rax)
@ -1620,7 +1620,7 @@ xorq (%rax), %rdi
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7]
# CHECK-NEXT: 400.00 - - 41.00 - 595.50 437.50 554.00
# CHECK-NEXT: 400.00 - - 41.00 - 595.50 437.50 557.00
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions:
@ -1740,7 +1740,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btcw $7, %di
# CHECK-NEXT: - - - - - 0.50 0.50 - btrw $7, %di
# CHECK-NEXT: - - - - - 0.50 0.50 - btsw $7, %di
# CHECK-NEXT: - - - - - 0.50 0.50 - btw $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 1.00 btw $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btcw $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btrw $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btsw $7, (%rax)
@ -1756,7 +1756,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btcl $7, %edi
# CHECK-NEXT: - - - - - 0.50 0.50 - btrl $7, %edi
# CHECK-NEXT: - - - - - 0.50 0.50 - btsl $7, %edi
# CHECK-NEXT: - - - - - 0.50 0.50 - btl $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 1.00 btl $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btcl $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btrl $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btsl $7, (%rax)
@ -1772,7 +1772,7 @@ xorq (%rax), %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btcq $7, %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btrq $7, %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btsq $7, %rdi
# CHECK-NEXT: - - - - - 0.50 0.50 - btq $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 1.00 btq $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btcq $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btrq $7, (%rax)
# CHECK-NEXT: - - - - - 0.50 0.50 2.00 btsq $7, (%rax)