[llvm] r343921 - [X86] Regenerate LSR loop iteration test
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 6 07:26:38 PDT 2018
Author: rksimon
Date: Sat Oct 6 07:26:38 2018
New Revision: 343921
URL: http://llvm.org/viewvc/llvm-project?rev=343921&view=rev
Log:
[X86] Regenerate LSR loop iteration test
Modified:
llvm/trunk/test/CodeGen/X86/lsr-loop-exit-cond.ll
Modified: llvm/trunk/test/CodeGen/X86/lsr-loop-exit-cond.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/lsr-loop-exit-cond.ll?rev=343921&r1=343920&r2=343921&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/lsr-loop-exit-cond.ll (original)
+++ llvm/trunk/test/CodeGen/X86/lsr-loop-exit-cond.ll Sat Oct 6 07:26:38 2018
@@ -1,23 +1,178 @@
-; RUN: llc -mtriple=x86_64-darwin -mcpu=generic < %s | FileCheck %s
-; RUN: llc -mtriple=x86_64-darwin -mcpu=atom < %s | FileCheck -check-prefix=ATOM %s
-
-; CHECK-LABEL: t:
-; CHECK: movl (%r9,%rax,4), %e{{..}}
-; CHECK-NEXT: testq
-; CHECK-NEXT: jne
-
-; ATOM-LABEL: t:
-; ATOM: movl (%r9,%r{{.+}},4), %r{{..}}
-; ATOM-NEXT: xorl
-; ATOM-NEXT: testq
-; ATOM-NEXT: movl
-; ATOM-NEXT: jne
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-darwin -mcpu=generic | FileCheck %s -check-prefixes=CHECK,GENERIC
+; RUN: llc < %s -mtriple=x86_64-darwin -mcpu=atom | FileCheck %s -check-prefixes=CHECK,ATOM
@Te0 = external global [256 x i32] ; <[256 x i32]*> [#uses=5]
@Te1 = external global [256 x i32] ; <[256 x i32]*> [#uses=4]
@Te3 = external global [256 x i32] ; <[256 x i32]*> [#uses=2]
define void @t(i8* nocapture %in, i8* nocapture %out, i32* nocapture %rk, i32 %r) nounwind {
+; GENERIC-LABEL: t:
+; GENERIC: ## %bb.0: ## %entry
+; GENERIC-NEXT: pushq %rbp
+; GENERIC-NEXT: pushq %r14
+; GENERIC-NEXT: pushq %rbx
+; GENERIC-NEXT: ## kill: def $ecx killed $ecx def $rcx
+; GENERIC-NEXT: movl (%rdx), %eax
+; GENERIC-NEXT: movl 4(%rdx), %ebx
+; GENERIC-NEXT: decl %ecx
+; GENERIC-NEXT: leaq 20(%rdx), %r14
+; GENERIC-NEXT: movq _Te0@{{.*}}(%rip), %r9
+; GENERIC-NEXT: movq _Te1@{{.*}}(%rip), %r8
+; GENERIC-NEXT: movq _Te3@{{.*}}(%rip), %r10
+; GENERIC-NEXT: movq %rcx, %r11
+; GENERIC-NEXT: jmp LBB0_1
+; GENERIC-NEXT: .p2align 4, 0x90
+; GENERIC-NEXT: LBB0_2: ## %bb1
+; GENERIC-NEXT: ## in Loop: Header=BB0_1 Depth=1
+; GENERIC-NEXT: movl %edi, %ebx
+; GENERIC-NEXT: shrl $16, %ebx
+; GENERIC-NEXT: movzbl %bl, %ebx
+; GENERIC-NEXT: xorl (%r8,%rbx,4), %eax
+; GENERIC-NEXT: xorl -4(%r14), %eax
+; GENERIC-NEXT: shrl $24, %edi
+; GENERIC-NEXT: movzbl %bpl, %ebx
+; GENERIC-NEXT: movl (%r10,%rbx,4), %ebx
+; GENERIC-NEXT: xorl (%r9,%rdi,4), %ebx
+; GENERIC-NEXT: xorl (%r14), %ebx
+; GENERIC-NEXT: decq %r11
+; GENERIC-NEXT: addq $16, %r14
+; GENERIC-NEXT: LBB0_1: ## %bb
+; GENERIC-NEXT: ## =>This Inner Loop Header: Depth=1
+; GENERIC-NEXT: movzbl %al, %edi
+; GENERIC-NEXT: ## kill: def $eax killed $eax def $rax
+; GENERIC-NEXT: shrl $24, %eax
+; GENERIC-NEXT: movl %ebx, %ebp
+; GENERIC-NEXT: shrl $16, %ebp
+; GENERIC-NEXT: movzbl %bpl, %ebp
+; GENERIC-NEXT: movl (%r8,%rbp,4), %ebp
+; GENERIC-NEXT: xorl (%r9,%rax,4), %ebp
+; GENERIC-NEXT: xorl -12(%r14), %ebp
+; GENERIC-NEXT: shrl $24, %ebx
+; GENERIC-NEXT: movl (%r10,%rdi,4), %edi
+; GENERIC-NEXT: xorl (%r9,%rbx,4), %edi
+; GENERIC-NEXT: xorl -8(%r14), %edi
+; GENERIC-NEXT: movl %ebp, %eax
+; GENERIC-NEXT: shrl $24, %eax
+; GENERIC-NEXT: movl (%r9,%rax,4), %eax
+; GENERIC-NEXT: testq %r11, %r11
+; GENERIC-NEXT: jne LBB0_2
+; GENERIC-NEXT: ## %bb.3: ## %bb2
+; GENERIC-NEXT: shlq $4, %rcx
+; GENERIC-NEXT: andl $-16777216, %eax ## imm = 0xFF000000
+; GENERIC-NEXT: movl %edi, %ebx
+; GENERIC-NEXT: shrl $16, %ebx
+; GENERIC-NEXT: movzbl %bl, %ebx
+; GENERIC-NEXT: movzbl 2(%r8,%rbx,4), %ebx
+; GENERIC-NEXT: shll $16, %ebx
+; GENERIC-NEXT: orl %eax, %ebx
+; GENERIC-NEXT: xorl 16(%rdx,%rcx), %ebx
+; GENERIC-NEXT: shrl $8, %edi
+; GENERIC-NEXT: movzbl 3(%r9,%rdi,4), %eax
+; GENERIC-NEXT: shll $24, %eax
+; GENERIC-NEXT: movzbl %bpl, %edi
+; GENERIC-NEXT: movzbl 2(%r8,%rdi,4), %edi
+; GENERIC-NEXT: shll $16, %edi
+; GENERIC-NEXT: orl %eax, %edi
+; GENERIC-NEXT: xorl 20(%rdx,%rcx), %edi
+; GENERIC-NEXT: movl %ebx, %eax
+; GENERIC-NEXT: shrl $24, %eax
+; GENERIC-NEXT: movb %al, (%rsi)
+; GENERIC-NEXT: shrl $16, %ebx
+; GENERIC-NEXT: movb %bl, 1(%rsi)
+; GENERIC-NEXT: movl %edi, %eax
+; GENERIC-NEXT: shrl $24, %eax
+; GENERIC-NEXT: movb %al, 4(%rsi)
+; GENERIC-NEXT: shrl $16, %edi
+; GENERIC-NEXT: movb %dil, 5(%rsi)
+; GENERIC-NEXT: popq %rbx
+; GENERIC-NEXT: popq %r14
+; GENERIC-NEXT: popq %rbp
+; GENERIC-NEXT: retq
+;
+; ATOM-LABEL: t:
+; ATOM: ## %bb.0: ## %entry
+; ATOM-NEXT: pushq %rbp
+; ATOM-NEXT: pushq %r15
+; ATOM-NEXT: pushq %r14
+; ATOM-NEXT: pushq %rbx
+; ATOM-NEXT: ## kill: def $ecx killed $ecx def $rcx
+; ATOM-NEXT: movl 4(%rdx), %eax
+; ATOM-NEXT: movl (%rdx), %r15d
+; ATOM-NEXT: leaq 20(%rdx), %r14
+; ATOM-NEXT: movq _Te0@{{.*}}(%rip), %r9
+; ATOM-NEXT: movq _Te1@{{.*}}(%rip), %r8
+; ATOM-NEXT: movq _Te3@{{.*}}(%rip), %r10
+; ATOM-NEXT: decl %ecx
+; ATOM-NEXT: movq %rcx, %r11
+; ATOM-NEXT: jmp LBB0_1
+; ATOM-NEXT: .p2align 4, 0x90
+; ATOM-NEXT: LBB0_2: ## %bb1
+; ATOM-NEXT: ## in Loop: Header=BB0_1 Depth=1
+; ATOM-NEXT: shrl $16, %eax
+; ATOM-NEXT: shrl $24, %edi
+; ATOM-NEXT: decq %r11
+; ATOM-NEXT: movzbl %al, %ebp
+; ATOM-NEXT: movzbl %bl, %eax
+; ATOM-NEXT: movl (%r10,%rax,4), %eax
+; ATOM-NEXT: xorl (%r8,%rbp,4), %r15d
+; ATOM-NEXT: xorl -4(%r14), %r15d
+; ATOM-NEXT: xorl (%r9,%rdi,4), %eax
+; ATOM-NEXT: xorl (%r14), %eax
+; ATOM-NEXT: addq $16, %r14
+; ATOM-NEXT: LBB0_1: ## %bb
+; ATOM-NEXT: ## =>This Inner Loop Header: Depth=1
+; ATOM-NEXT: movl %eax, %edi
+; ATOM-NEXT: movl %r15d, %ebp
+; ATOM-NEXT: shrl $24, %eax
+; ATOM-NEXT: shrl $16, %edi
+; ATOM-NEXT: shrl $24, %ebp
+; ATOM-NEXT: movzbl %dil, %edi
+; ATOM-NEXT: movl (%r8,%rdi,4), %ebx
+; ATOM-NEXT: movzbl %r15b, %edi
+; ATOM-NEXT: movl (%r10,%rdi,4), %edi
+; ATOM-NEXT: xorl (%r9,%rbp,4), %ebx
+; ATOM-NEXT: xorl -12(%r14), %ebx
+; ATOM-NEXT: xorl (%r9,%rax,4), %edi
+; ATOM-NEXT: movl %ebx, %eax
+; ATOM-NEXT: shrl $24, %eax
+; ATOM-NEXT: movl (%r9,%rax,4), %r15d
+; ATOM-NEXT: xorl -8(%r14), %edi
+; ATOM-NEXT: testq %r11, %r11
+; ATOM-NEXT: movl %edi, %eax
+; ATOM-NEXT: jne LBB0_2
+; ATOM-NEXT: ## %bb.3: ## %bb2
+; ATOM-NEXT: shrl $16, %eax
+; ATOM-NEXT: shrl $8, %edi
+; ATOM-NEXT: movzbl %bl, %ebp
+; ATOM-NEXT: andl $-16777216, %r15d ## imm = 0xFF000000
+; ATOM-NEXT: shlq $4, %rcx
+; ATOM-NEXT: movzbl %al, %eax
+; ATOM-NEXT: movzbl 3(%r9,%rdi,4), %edi
+; ATOM-NEXT: movzbl 2(%r8,%rbp,4), %ebp
+; ATOM-NEXT: movzbl 2(%r8,%rax,4), %eax
+; ATOM-NEXT: shll $24, %edi
+; ATOM-NEXT: shll $16, %ebp
+; ATOM-NEXT: shll $16, %eax
+; ATOM-NEXT: orl %edi, %ebp
+; ATOM-NEXT: orl %r15d, %eax
+; ATOM-NEXT: xorl 20(%rdx,%rcx), %ebp
+; ATOM-NEXT: xorl 16(%rdx,%rcx), %eax
+; ATOM-NEXT: movl %eax, %edi
+; ATOM-NEXT: shrl $16, %eax
+; ATOM-NEXT: shrl $24, %edi
+; ATOM-NEXT: movb %dil, (%rsi)
+; ATOM-NEXT: movb %al, 1(%rsi)
+; ATOM-NEXT: movl %ebp, %eax
+; ATOM-NEXT: shrl $16, %ebp
+; ATOM-NEXT: shrl $24, %eax
+; ATOM-NEXT: movb %al, 4(%rsi)
+; ATOM-NEXT: movb %bpl, 5(%rsi)
+; ATOM-NEXT: popq %rbx
+; ATOM-NEXT: popq %r14
+; ATOM-NEXT: popq %r15
+; ATOM-NEXT: popq %rbp
+; ATOM-NEXT: retq
entry:
%0 = load i32, i32* %rk, align 4 ; <i32> [#uses=1]
%1 = getelementptr i32, i32* %rk, i64 1 ; <i32*> [#uses=1]
@@ -150,21 +305,56 @@ bb2: ; preds = %bb
; is equal to the stride.
; It must not fold (cmp (add iv, 1), 1) --> (cmp iv, 0).
-; CHECK-LABEL: f:
-; CHECK: %for.body
-; CHECK: incl [[IV:%e..]]
-; CHECK: cmpl $1, [[IV]]
-; CHECK: jne
-; CHECK: ret
-
-; ATOM-LABEL: f:
-; ATOM: %for.body
-; ATOM: incl [[IV:%e..]]
-; ATOM: cmpl $1, [[IV]]
-; ATOM: jne
-; ATOM: ret
-
define i32 @f(i32 %i, i32* nocapture %a) nounwind uwtable readonly ssp {
+; GENERIC-LABEL: f:
+; GENERIC: ## %bb.0: ## %entry
+; GENERIC-NEXT: xorl %eax, %eax
+; GENERIC-NEXT: cmpl $1, %edi
+; GENERIC-NEXT: je LBB1_3
+; GENERIC-NEXT: ## %bb.1: ## %for.body.lr.ph
+; GENERIC-NEXT: movslq %edi, %rax
+; GENERIC-NEXT: leaq (%rsi,%rax,4), %rcx
+; GENERIC-NEXT: xorl %eax, %eax
+; GENERIC-NEXT: xorl %edx, %edx
+; GENERIC-NEXT: .p2align 4, 0x90
+; GENERIC-NEXT: LBB1_2: ## %for.body
+; GENERIC-NEXT: ## =>This Inner Loop Header: Depth=1
+; GENERIC-NEXT: movl (%rcx), %esi
+; GENERIC-NEXT: cmpl %edx, %esi
+; GENERIC-NEXT: cmoval %esi, %edx
+; GENERIC-NEXT: cmoval %edi, %eax
+; GENERIC-NEXT: incl %edi
+; GENERIC-NEXT: addq $4, %rcx
+; GENERIC-NEXT: cmpl $1, %edi
+; GENERIC-NEXT: jne LBB1_2
+; GENERIC-NEXT: LBB1_3: ## %for.end
+; GENERIC-NEXT: retq
+;
+; ATOM-LABEL: f:
+; ATOM: ## %bb.0: ## %entry
+; ATOM-NEXT: xorl %eax, %eax
+; ATOM-NEXT: cmpl $1, %edi
+; ATOM-NEXT: je LBB1_3
+; ATOM-NEXT: ## %bb.1: ## %for.body.lr.ph
+; ATOM-NEXT: movslq %edi, %rax
+; ATOM-NEXT: xorl %edx, %edx
+; ATOM-NEXT: leaq (%rsi,%rax,4), %rcx
+; ATOM-NEXT: xorl %eax, %eax
+; ATOM-NEXT: .p2align 4, 0x90
+; ATOM-NEXT: LBB1_2: ## %for.body
+; ATOM-NEXT: ## =>This Inner Loop Header: Depth=1
+; ATOM-NEXT: movl (%rcx), %esi
+; ATOM-NEXT: cmpl %edx, %esi
+; ATOM-NEXT: cmoval %esi, %edx
+; ATOM-NEXT: cmoval %edi, %eax
+; ATOM-NEXT: incl %edi
+; ATOM-NEXT: leaq 4(%rcx), %rcx
+; ATOM-NEXT: cmpl $1, %edi
+; ATOM-NEXT: jne LBB1_2
+; ATOM-NEXT: LBB1_3: ## %for.end
+; ATOM-NEXT: nop
+; ATOM-NEXT: nop
+; ATOM-NEXT: retq
entry:
%cmp4 = icmp eq i32 %i, 1
br i1 %cmp4, label %for.end, label %for.body.lr.ph
More information about the llvm-commits
mailing list