[llvm] r342235 - [X86][BMI1] Fix BLSI/BLSMSK/BLSR BMI1 scheduling on btver2
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 14 06:31:14 PDT 2018
Author: rksimon
Date: Fri Sep 14 06:31:14 2018
New Revision: 342235
URL: http://llvm.org/viewvc/llvm-project?rev=342235&view=rev
Log:
[X86][BMI1] Fix BLSI/BLSMSK/BLSR BMI1 scheduling on btver2
These have the same behaviour as tzcnt on btver2 - confirmed with AMD 16h SOG, Agner and instlatx64.
Modified:
llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
llvm/trunk/test/CodeGen/X86/bmi-schedule.ll
llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-bmi1.s
Modified: llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td?rev=342235&r1=342234&r2=342235&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td (original)
+++ llvm/trunk/lib/Target/X86/X86ScheduleBtVer2.td Fri Sep 14 06:31:14 2018
@@ -205,7 +205,7 @@ defm : JWriteResIntPair<WriteTZCNT,
// BMI1 BEXTR/BLS, BMI2 BZHI
defm : JWriteResIntPair<WriteBEXTR, [JALU01], 1>;
-defm : JWriteResIntPair<WriteBLS, [JALU01], 1>;
+defm : JWriteResIntPair<WriteBLS, [JALU01], 2, [2]>;
defm : X86WriteResPairUnsupported<WriteBZHI>;
////////////////////////////////////////////////////////////////////////////////
Modified: llvm/trunk/test/CodeGen/X86/bmi-schedule.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bmi-schedule.ll?rev=342235&r1=342234&r2=342235&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bmi-schedule.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bmi-schedule.ll Fri Sep 14 06:31:14 2018
@@ -238,8 +238,8 @@ define i32 @test_blsi_i32(i32 %a0, i32 *
;
; BTVER2-LABEL: test_blsi_i32:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsil (%rsi), %ecx # sched: [4:1.00]
-; BTVER2-NEXT: blsil %edi, %eax # sched: [1:0.50]
+; BTVER2-NEXT: blsil (%rsi), %ecx # sched: [5:1.00]
+; BTVER2-NEXT: blsil %edi, %eax # sched: [2:1.00]
; BTVER2-NEXT: addl %ecx, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -289,8 +289,8 @@ define i64 @test_blsi_i64(i64 %a0, i64 *
;
; BTVER2-LABEL: test_blsi_i64:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsiq (%rsi), %rcx # sched: [4:1.00]
-; BTVER2-NEXT: blsiq %rdi, %rax # sched: [1:0.50]
+; BTVER2-NEXT: blsiq (%rsi), %rcx # sched: [5:1.00]
+; BTVER2-NEXT: blsiq %rdi, %rax # sched: [2:1.00]
; BTVER2-NEXT: addq %rcx, %rax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -340,8 +340,8 @@ define i32 @test_blsmsk_i32(i32 %a0, i32
;
; BTVER2-LABEL: test_blsmsk_i32:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsmskl (%rsi), %ecx # sched: [4:1.00]
-; BTVER2-NEXT: blsmskl %edi, %eax # sched: [1:0.50]
+; BTVER2-NEXT: blsmskl (%rsi), %ecx # sched: [5:1.00]
+; BTVER2-NEXT: blsmskl %edi, %eax # sched: [2:1.00]
; BTVER2-NEXT: addl %ecx, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -391,8 +391,8 @@ define i64 @test_blsmsk_i64(i64 %a0, i64
;
; BTVER2-LABEL: test_blsmsk_i64:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsmskq (%rsi), %rcx # sched: [4:1.00]
-; BTVER2-NEXT: blsmskq %rdi, %rax # sched: [1:0.50]
+; BTVER2-NEXT: blsmskq (%rsi), %rcx # sched: [5:1.00]
+; BTVER2-NEXT: blsmskq %rdi, %rax # sched: [2:1.00]
; BTVER2-NEXT: addq %rcx, %rax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -442,8 +442,8 @@ define i32 @test_blsr_i32(i32 %a0, i32 *
;
; BTVER2-LABEL: test_blsr_i32:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsrl (%rsi), %ecx # sched: [4:1.00]
-; BTVER2-NEXT: blsrl %edi, %eax # sched: [1:0.50]
+; BTVER2-NEXT: blsrl (%rsi), %ecx # sched: [5:1.00]
+; BTVER2-NEXT: blsrl %edi, %eax # sched: [2:1.00]
; BTVER2-NEXT: addl %ecx, %eax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
@@ -493,8 +493,8 @@ define i64 @test_blsr_i64(i64 %a0, i64 *
;
; BTVER2-LABEL: test_blsr_i64:
; BTVER2: # %bb.0:
-; BTVER2-NEXT: blsrq (%rsi), %rcx # sched: [4:1.00]
-; BTVER2-NEXT: blsrq %rdi, %rax # sched: [1:0.50]
+; BTVER2-NEXT: blsrq (%rsi), %rcx # sched: [5:1.00]
+; BTVER2-NEXT: blsrq %rdi, %rax # sched: [2:1.00]
; BTVER2-NEXT: addq %rcx, %rax # sched: [1:0.50]
; BTVER2-NEXT: retq # sched: [4:1.00]
;
Modified: llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-bmi1.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-bmi1.s?rev=342235&r1=342234&r2=342235&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-bmi1.s (original)
+++ llvm/trunk/test/tools/llvm-mca/X86/BtVer2/resources-bmi1.s Fri Sep 14 06:31:14 2018
@@ -54,18 +54,18 @@ tzcnt (%rax), %rcx
# CHECK-NEXT: 1 4 1.00 * bextrl %eax, (%rbx), %ecx
# CHECK-NEXT: 1 1 0.50 bextrq %rax, %rbx, %rcx
# CHECK-NEXT: 1 4 1.00 * bextrq %rax, (%rbx), %rcx
-# CHECK-NEXT: 1 1 0.50 blsil %eax, %ecx
-# CHECK-NEXT: 1 4 1.00 * blsil (%rax), %ecx
-# CHECK-NEXT: 1 1 0.50 blsiq %rax, %rcx
-# CHECK-NEXT: 1 4 1.00 * blsiq (%rax), %rcx
-# CHECK-NEXT: 1 1 0.50 blsmskl %eax, %ecx
-# CHECK-NEXT: 1 4 1.00 * blsmskl (%rax), %ecx
-# CHECK-NEXT: 1 1 0.50 blsmskq %rax, %rcx
-# CHECK-NEXT: 1 4 1.00 * blsmskq (%rax), %rcx
-# CHECK-NEXT: 1 1 0.50 blsrl %eax, %ecx
-# CHECK-NEXT: 1 4 1.00 * blsrl (%rax), %ecx
-# CHECK-NEXT: 1 1 0.50 blsrq %rax, %rcx
-# CHECK-NEXT: 1 4 1.00 * blsrq (%rax), %rcx
+# CHECK-NEXT: 1 2 1.00 blsil %eax, %ecx
+# CHECK-NEXT: 1 5 1.00 * blsil (%rax), %ecx
+# CHECK-NEXT: 1 2 1.00 blsiq %rax, %rcx
+# CHECK-NEXT: 1 5 1.00 * blsiq (%rax), %rcx
+# CHECK-NEXT: 1 2 1.00 blsmskl %eax, %ecx
+# CHECK-NEXT: 1 5 1.00 * blsmskl (%rax), %ecx
+# CHECK-NEXT: 1 2 1.00 blsmskq %rax, %rcx
+# CHECK-NEXT: 1 5 1.00 * blsmskq (%rax), %rcx
+# CHECK-NEXT: 1 2 1.00 blsrl %eax, %ecx
+# CHECK-NEXT: 1 5 1.00 * blsrl (%rax), %ecx
+# CHECK-NEXT: 1 2 1.00 blsrq %rax, %rcx
+# CHECK-NEXT: 1 5 1.00 * blsrq (%rax), %rcx
# CHECK-NEXT: 1 2 1.00 tzcntl %eax, %ecx
# CHECK-NEXT: 1 5 1.00 * tzcntl (%rax), %ecx
# CHECK-NEXT: 1 2 1.00 tzcntq %rax, %rcx
@@ -89,7 +89,7 @@ tzcnt (%rax), %rcx
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
-# CHECK-NEXT: 14.00 14.00 - - - - - 12.00 - - - - - -
+# CHECK-NEXT: 20.00 20.00 - - - - - 12.00 - - - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions:
@@ -101,18 +101,18 @@ tzcnt (%rax), %rcx
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - bextrl %eax, (%rbx), %ecx
# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - bextrq %rax, %rbx, %rcx
# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - bextrq %rax, (%rbx), %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsil %eax, %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsil (%rax), %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsiq %rax, %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsiq (%rax), %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsmskl %eax, %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsmskl (%rax), %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsmskq %rax, %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsmskq (%rax), %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsrl %eax, %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsrl (%rax), %ecx
-# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - blsrq %rax, %rcx
-# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - blsrq (%rax), %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsil %eax, %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsil (%rax), %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsiq %rax, %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsiq (%rax), %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsmskl %eax, %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsmskl (%rax), %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsmskq %rax, %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsmskq (%rax), %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsrl %eax, %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsrl (%rax), %ecx
+# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - blsrq %rax, %rcx
+# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - blsrq (%rax), %rcx
# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - tzcntl %eax, %ecx
# CHECK-NEXT: 1.00 1.00 - - - - - 1.00 - - - - - - tzcntl (%rax), %ecx
# CHECK-NEXT: 1.00 1.00 - - - - - - - - - - - - tzcntq %rax, %rcx
More information about the llvm-commits
mailing list