diff --git a/llvm/lib/Target/X86/X86ScheduleAtom.td b/llvm/lib/Target/X86/X86ScheduleAtom.td index 09a09185b3bcde..85e08b93a4a6cd 100644 --- a/llvm/lib/Target/X86/X86ScheduleAtom.td +++ b/llvm/lib/Target/X86/X86ScheduleAtom.td @@ -168,7 +168,7 @@ defm : X86WriteRes; // Loads, stores, and moves, not folded with other operations. //////////////////////////////////////////////////////////////////////////////// -def : WriteRes; +def : WriteRes { let Latency = 3; } def : WriteRes; def : WriteRes; def : WriteRes; diff --git a/llvm/lib/Target/X86/X86ScheduleZnver1.td b/llvm/lib/Target/X86/X86ScheduleZnver1.td index 78b32953cdf80e..d6ea83b52257d9 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver1.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver1.td @@ -177,7 +177,7 @@ def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; -def : WriteRes { let Latency = 8; } +def : WriteRes { let Latency = 4; } // Model the effect of clobbering the read-write mask operand of the GATHER operation. // Does not cost anything by itself, only has latency, matching that of the WriteLoad, diff --git a/llvm/lib/Target/X86/X86ScheduleZnver2.td b/llvm/lib/Target/X86/X86ScheduleZnver2.td index d6b0d2dd191a13..9ebedb76b9e378 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver2.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver2.td @@ -176,7 +176,7 @@ def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; -def : WriteRes { let Latency = 8; } +def : WriteRes { let Latency = 4; } // Model the effect of clobbering the read-write mask operand of the GATHER operation. // Does not cost anything by itself, only has latency, matching that of the WriteLoad, diff --git a/llvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s index 25011cd1aea89c..9a607181008512 100644 --- a/llvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s +++ b/llvm/test/tools/llvm-mca/X86/Atom/resources-sse1.s @@ -282,10 +282,10 @@ xorps (%rax), %xmm2 # CHECK-NEXT: 1 3 3.00 pmovmskb %mm0, %ecx # CHECK-NEXT: 1 4 1.00 pmulhuw %mm0, %mm2 # CHECK-NEXT: 1 4 1.00 * pmulhuw (%rax), %mm2 -# CHECK-NEXT: 1 1 1.00 * * prefetcht0 (%rax) -# CHECK-NEXT: 1 1 1.00 * * prefetcht1 (%rax) -# CHECK-NEXT: 1 1 1.00 * * prefetcht2 (%rax) -# CHECK-NEXT: 1 1 1.00 * * prefetchnta (%rax) +# CHECK-NEXT: 1 3 1.00 * * prefetcht0 (%rax) +# CHECK-NEXT: 1 3 1.00 * * prefetcht1 (%rax) +# CHECK-NEXT: 1 3 1.00 * * prefetcht2 (%rax) +# CHECK-NEXT: 1 3 1.00 * * prefetchnta (%rax) # CHECK-NEXT: 1 4 1.00 psadbw %mm0, %mm2 # CHECK-NEXT: 1 4 1.00 * psadbw (%rax), %mm2 # CHECK-NEXT: 1 1 1.00 pshufw $1, %mm0, %mm2 diff --git a/llvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s b/llvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s index 82d40dca00f7c8..65d785038f32c5 100644 --- a/llvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s +++ b/llvm/test/tools/llvm-mca/X86/Atom/resources-sse2.s @@ -415,7 +415,7 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: 1 1 1.00 * andnpd (%rax), %xmm2 # CHECK-NEXT: 1 1 0.50 andpd %xmm0, %xmm2 # CHECK-NEXT: 1 1 1.00 * andpd (%rax), %xmm2 -# CHECK-NEXT: 1 1 1.00 * * U clflush (%rax) +# CHECK-NEXT: 1 3 1.00 * * U clflush (%rax) # CHECK-NEXT: 3 6 5.00 cmpeqpd %xmm0, %xmm2 # CHECK-NEXT: 4 7 6.00 * cmpeqpd (%rax), %xmm2 # CHECK-NEXT: 1 5 1.00 cmpeqsd %xmm0, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/Atom/resources-x87.s b/llvm/test/tools/llvm-mca/X86/Atom/resources-x87.s index 07e8531e30e450..ead0c4268759ed 100644 --- a/llvm/test/tools/llvm-mca/X86/Atom/resources-x87.s +++ b/llvm/test/tools/llvm-mca/X86/Atom/resources-x87.s @@ -276,8 +276,8 @@ fyl2xp1 # CHECK-NEXT: 1 2 1.00 * U fisttpl (%ecx) # CHECK-NEXT: 1 2 1.00 * U fisttpll (%eax) # CHECK-NEXT: 1 1 1.00 U fld %st(0) -# CHECK-NEXT: 1 1 1.00 * U flds (%edx) -# CHECK-NEXT: 1 1 1.00 * U fldl (%ecx) +# CHECK-NEXT: 1 3 1.00 * U flds (%edx) +# CHECK-NEXT: 1 3 1.00 * U fldl (%ecx) # CHECK-NEXT: 1 4 2.00 * U fldt (%eax) # CHECK-NEXT: 1 5 2.50 * U fldcw (%eax) # CHECK-NEXT: 1 100 0.50 * U fldenv (%eax) diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-clflushopt.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-clflushopt.s index 733aec155ec490..4c16bafb6377d7 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-clflushopt.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-clflushopt.s @@ -12,7 +12,7 @@ clflushopt (%rax) # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.50 * * U clflushopt (%rax) +# CHECK-NEXT: 1 4 0.50 * * U clflushopt (%rax) # CHECK: Resources: # CHECK-NEXT: [0] - ZnAGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-clzero.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-clzero.s index 420942130645b2..70502433eefc73 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-clzero.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-clzero.s @@ -12,7 +12,7 @@ clzero # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.50 U clzero +# CHECK-NEXT: 1 4 0.50 U clzero # CHECK: Resources: # CHECK-NEXT: [0] - ZnAGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-prefetchw.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-prefetchw.s index 47a52fb06385a4..7f5ec3104f09d4 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-prefetchw.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-prefetchw.s @@ -13,8 +13,8 @@ prefetchw (%rax) # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.50 * * prefetch (%rax) -# CHECK-NEXT: 1 8 0.50 * * prefetchw (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetch (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetchw (%rax) # CHECK: Resources: # CHECK-NEXT: [0] - ZnAGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse1.s index 5616e648f43147..3bf248b044b85c 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse1.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse1.s @@ -282,10 +282,10 @@ xorps (%rax), %xmm2 # CHECK-NEXT: 1 1 1.00 pmovmskb %mm0, %ecx # CHECK-NEXT: 1 4 1.00 pmulhuw %mm0, %mm2 # CHECK-NEXT: 1 11 1.00 * pmulhuw (%rax), %mm2 -# CHECK-NEXT: 1 8 0.50 * * prefetcht0 (%rax) -# CHECK-NEXT: 1 8 0.50 * * prefetcht1 (%rax) -# CHECK-NEXT: 1 8 0.50 * * prefetcht2 (%rax) -# CHECK-NEXT: 1 8 0.50 * * prefetchnta (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetcht0 (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetcht1 (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetcht2 (%rax) +# CHECK-NEXT: 1 4 0.50 * * prefetchnta (%rax) # CHECK-NEXT: 1 3 1.00 psadbw %mm0, %mm2 # CHECK-NEXT: 1 10 1.00 * psadbw (%rax), %mm2 # CHECK-NEXT: 1 1 0.50 pshufw $1, %mm0, %mm2 diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse2.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse2.s index 1db51b7b651473..c6bfe9a12137b6 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse2.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-sse2.s @@ -415,7 +415,7 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: 1 8 0.50 * andnpd (%rax), %xmm2 # CHECK-NEXT: 1 1 0.25 andpd %xmm0, %xmm2 # CHECK-NEXT: 1 8 0.50 * andpd (%rax), %xmm2 -# CHECK-NEXT: 1 8 0.50 * * U clflush (%rax) +# CHECK-NEXT: 1 4 0.50 * * U clflush (%rax) # CHECK-NEXT: 1 1 0.50 cmpeqpd %xmm0, %xmm2 # CHECK-NEXT: 1 8 0.50 * cmpeqpd (%rax), %xmm2 # CHECK-NEXT: 1 1 0.50 cmpeqsd %xmm0, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-x86_64.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-x86_64.s index b190803318a10a..7eadac52bfb3a3 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-x86_64.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-x86_64.s @@ -1400,16 +1400,16 @@ xorq (%rax), %rdi # CHECK-NEXT: 2 5 0.50 * movzbw (%rax), %di # CHECK-NEXT: 1 1 0.25 movsbl %al, %edi # CHECK-NEXT: 1 1 0.25 movzbl %al, %edi -# CHECK-NEXT: 1 8 0.50 * movsbl (%rax), %edi -# CHECK-NEXT: 1 8 0.50 * movzbl (%rax), %edi +# CHECK-NEXT: 1 4 0.50 * movsbl (%rax), %edi +# CHECK-NEXT: 1 4 0.50 * movzbl (%rax), %edi # CHECK-NEXT: 1 1 0.25 movsbq %al, %rdi # CHECK-NEXT: 1 1 0.25 movzbq %al, %rdi # CHECK-NEXT: 2 5 0.50 * movsbq (%rax), %rdi # CHECK-NEXT: 2 5 0.50 * movzbq (%rax), %rdi # CHECK-NEXT: 1 1 0.25 movswl %ax, %edi # CHECK-NEXT: 1 1 0.25 movzwl %ax, %edi -# CHECK-NEXT: 1 8 0.50 * movswl (%rax), %edi -# CHECK-NEXT: 1 8 0.50 * movzwl (%rax), %edi +# CHECK-NEXT: 1 4 0.50 * movswl (%rax), %edi +# CHECK-NEXT: 1 4 0.50 * movzwl (%rax), %edi # CHECK-NEXT: 1 1 0.25 movswq %ax, %rdi # CHECK-NEXT: 1 1 0.25 movzwq %ax, %rdi # CHECK-NEXT: 2 5 0.50 * movswq (%rax), %rdi diff --git a/llvm/test/tools/llvm-mca/X86/Znver1/resources-x87.s b/llvm/test/tools/llvm-mca/X86/Znver1/resources-x87.s index 0c26a40849d62a..6cfa018e6dbcac 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver1/resources-x87.s +++ b/llvm/test/tools/llvm-mca/X86/Znver1/resources-x87.s @@ -276,8 +276,8 @@ fyl2xp1 # CHECK-NEXT: 1 12 0.50 * U fisttpl (%ecx) # CHECK-NEXT: 1 12 0.50 * U fisttpll (%eax) # CHECK-NEXT: 1 1 0.50 U fld %st(0) -# CHECK-NEXT: 1 8 0.50 * U flds (%edx) -# CHECK-NEXT: 1 8 0.50 * U fldl (%ecx) +# CHECK-NEXT: 1 4 0.50 * U flds (%edx) +# CHECK-NEXT: 1 4 0.50 * U fldl (%ecx) # CHECK-NEXT: 2 1 0.50 * U fldt (%eax) # CHECK-NEXT: 1 100 0.25 * U fldcw (%eax) # CHECK-NEXT: 1 100 0.25 * U fldenv (%eax) diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-clflushopt.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-clflushopt.s index 461c0109254e17..671381f78a953c 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-clflushopt.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-clflushopt.s @@ -12,7 +12,7 @@ clflushopt (%rax) # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.33 * * U clflushopt (%rax) +# CHECK-NEXT: 1 4 0.33 * * U clflushopt (%rax) # CHECK: Resources: # CHECK-NEXT: [0] - Zn2AGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-clzero.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-clzero.s index 83de8d3a691d64..12c4f757551b1a 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-clzero.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-clzero.s @@ -12,7 +12,7 @@ clzero # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.33 U clzero +# CHECK-NEXT: 1 4 0.33 U clzero # CHECK: Resources: # CHECK-NEXT: [0] - Zn2AGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-prefetchw.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-prefetchw.s index 2e240b3af8e839..b405f4c29e0f01 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-prefetchw.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-prefetchw.s @@ -13,8 +13,8 @@ prefetchw (%rax) # CHECK-NEXT: [6]: HasSideEffects (U) # CHECK: [1] [2] [3] [4] [5] [6] Instructions: -# CHECK-NEXT: 1 8 0.33 * * prefetch (%rax) -# CHECK-NEXT: 1 8 0.33 * * prefetchw (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetch (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetchw (%rax) # CHECK: Resources: # CHECK-NEXT: [0] - Zn2AGU0 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse1.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse1.s index 030b6521d628e3..64c3ae95ba0d4b 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse1.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse1.s @@ -282,10 +282,10 @@ xorps (%rax), %xmm2 # CHECK-NEXT: 1 1 1.00 pmovmskb %mm0, %ecx # CHECK-NEXT: 1 4 1.00 pmulhuw %mm0, %mm2 # CHECK-NEXT: 1 11 1.00 * pmulhuw (%rax), %mm2 -# CHECK-NEXT: 1 8 0.33 * * prefetcht0 (%rax) -# CHECK-NEXT: 1 8 0.33 * * prefetcht1 (%rax) -# CHECK-NEXT: 1 8 0.33 * * prefetcht2 (%rax) -# CHECK-NEXT: 1 8 0.33 * * prefetchnta (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetcht0 (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetcht1 (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetcht2 (%rax) +# CHECK-NEXT: 1 4 0.33 * * prefetchnta (%rax) # CHECK-NEXT: 1 3 1.00 psadbw %mm0, %mm2 # CHECK-NEXT: 1 10 1.00 * psadbw (%rax), %mm2 # CHECK-NEXT: 1 1 0.50 pshufw $1, %mm0, %mm2 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse2.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse2.s index a0535cfa0d02d0..9a465802f8b178 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse2.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-sse2.s @@ -415,7 +415,7 @@ xorpd (%rax), %xmm2 # CHECK-NEXT: 1 8 0.33 * andnpd (%rax), %xmm2 # CHECK-NEXT: 1 1 0.25 andpd %xmm0, %xmm2 # CHECK-NEXT: 1 8 0.33 * andpd (%rax), %xmm2 -# CHECK-NEXT: 1 8 0.33 * * U clflush (%rax) +# CHECK-NEXT: 1 4 0.33 * * U clflush (%rax) # CHECK-NEXT: 1 1 0.50 cmpeqpd %xmm0, %xmm2 # CHECK-NEXT: 1 8 0.50 * cmpeqpd (%rax), %xmm2 # CHECK-NEXT: 1 1 0.50 cmpeqsd %xmm0, %xmm2 diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-x86_64.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-x86_64.s index 7ccf6efb43e361..3cd41c176ce04f 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-x86_64.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-x86_64.s @@ -1202,16 +1202,16 @@ xorq (%rax), %rdi # CHECK-NEXT: 2 5 0.33 * movzbw (%rax), %di # CHECK-NEXT: 1 1 0.25 movsbl %al, %edi # CHECK-NEXT: 1 1 0.25 movzbl %al, %edi -# CHECK-NEXT: 1 8 0.33 * movsbl (%rax), %edi -# CHECK-NEXT: 1 8 0.33 * movzbl (%rax), %edi +# CHECK-NEXT: 1 4 0.33 * movsbl (%rax), %edi +# CHECK-NEXT: 1 4 0.33 * movzbl (%rax), %edi # CHECK-NEXT: 1 1 0.25 movsbq %al, %rdi # CHECK-NEXT: 1 1 0.25 movzbq %al, %rdi # CHECK-NEXT: 2 5 0.33 * movsbq (%rax), %rdi # CHECK-NEXT: 2 5 0.33 * movzbq (%rax), %rdi # CHECK-NEXT: 1 1 0.25 movswl %ax, %edi # CHECK-NEXT: 1 1 0.25 movzwl %ax, %edi -# CHECK-NEXT: 1 8 0.33 * movswl (%rax), %edi -# CHECK-NEXT: 1 8 0.33 * movzwl (%rax), %edi +# CHECK-NEXT: 1 4 0.33 * movswl (%rax), %edi +# CHECK-NEXT: 1 4 0.33 * movzwl (%rax), %edi # CHECK-NEXT: 1 1 0.25 movswq %ax, %rdi # CHECK-NEXT: 1 1 0.25 movzwq %ax, %rdi # CHECK-NEXT: 2 5 0.33 * movswq (%rax), %rdi diff --git a/llvm/test/tools/llvm-mca/X86/Znver2/resources-x87.s b/llvm/test/tools/llvm-mca/X86/Znver2/resources-x87.s index be542ecb2debcc..19871760400023 100644 --- a/llvm/test/tools/llvm-mca/X86/Znver2/resources-x87.s +++ b/llvm/test/tools/llvm-mca/X86/Znver2/resources-x87.s @@ -276,8 +276,8 @@ fyl2xp1 # CHECK-NEXT: 1 12 0.50 * U fisttpl (%ecx) # CHECK-NEXT: 1 12 0.50 * U fisttpll (%eax) # CHECK-NEXT: 1 1 0.50 U fld %st(0) -# CHECK-NEXT: 1 8 0.33 * U flds (%edx) -# CHECK-NEXT: 1 8 0.33 * U fldl (%ecx) +# CHECK-NEXT: 1 4 0.33 * U flds (%edx) +# CHECK-NEXT: 1 4 0.33 * U fldl (%ecx) # CHECK-NEXT: 2 1 0.50 * U fldt (%eax) # CHECK-NEXT: 1 100 0.25 * U fldcw (%eax) # CHECK-NEXT: 1 100 0.25 * U fldenv (%eax)