Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
test/CodeGen/X86/lea-opt-cse4.ll
Show All 32 Lines | |||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: leal 1(%ecx,%edx), %esi | ; X86-NEXT: leal 1(%ecx,%edx), %esi | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: movl %esi, 12(%eax) | ; X86-NEXT: movl %esi, 12(%eax) | ||||
; X86-NEXT: leal 1(%ecx,%edx), %ecx | ; X86-NEXT: leal 1(%ecx,%edx), %ecx | ||||
; X86-NEXT: movl %ecx, 16(%eax) | ; X86-NEXT: movl %ecx, 16(%eax) | ||||
; X86-NEXT: popl %esi | ; X86-NEXT: popl %esi | ||||
; X86-NEXT: .Lcfi2: | |||||
; X86-NEXT: .cfi_def_cfa_offset 4 | |||||
; X86-NEXT: retl | ; X86-NEXT: retl | ||||
entry: | entry: | ||||
%h0 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 0 | %h0 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 0 | ||||
%0 = load i32, i32* %h0, align 8 | %0 = load i32, i32* %h0, align 8 | ||||
%h3 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 3 | %h3 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 3 | ||||
%h4 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 4 | %h4 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 4 | ||||
%1 = load i32, i32* %h4, align 8 | %1 = load i32, i32* %h4, align 8 | ||||
%add = add i32 %0 , 1 | %add = add i32 %0 , 1 | ||||
Show All 31 Lines | |||||
; X64-NEXT: addl %eax, %ecx | ; X64-NEXT: addl %eax, %ecx | ||||
; X64-NEXT: addl %eax, %ecx | ; X64-NEXT: addl %eax, %ecx | ||||
; X64-NEXT: movl %ecx, 16(%rdi) | ; X64-NEXT: movl %ecx, 16(%rdi) | ||||
; X64-NEXT: retq | ; X64-NEXT: retq | ||||
; | ; | ||||
; X86-LABEL: foo_loop: | ; X86-LABEL: foo_loop: | ||||
; X86: # BB#0: # %entry | ; X86: # BB#0: # %entry | ||||
; X86-NEXT: pushl %edi | ; X86-NEXT: pushl %edi | ||||
; X86-NEXT: .Lcfi2: | ; X86-NEXT: .Lcfi3: | ||||
; X86-NEXT: .cfi_def_cfa_offset 8 | ; X86-NEXT: .cfi_def_cfa_offset 8 | ||||
; X86-NEXT: pushl %esi | ; X86-NEXT: pushl %esi | ||||
; X86-NEXT: .Lcfi3: | |||||
; X86-NEXT: .cfi_def_cfa_offset 12 | |||||
; X86-NEXT: .Lcfi4: | ; X86-NEXT: .Lcfi4: | ||||
; X86-NEXT: .cfi_offset %esi, -12 | ; X86-NEXT: .cfi_def_cfa_offset 12 | ||||
; X86-NEXT: .Lcfi5: | ; X86-NEXT: .Lcfi5: | ||||
; X86-NEXT: .cfi_offset %esi, -12 | |||||
; X86-NEXT: .Lcfi6: | |||||
; X86-NEXT: .cfi_offset %edi, -8 | ; X86-NEXT: .cfi_offset %edi, -8 | ||||
; X86-NEXT: movl {{[0-9]+}}(%esp), %edx | ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx | ||||
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax | ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax | ||||
; X86-NEXT: .p2align 4, 0x90 | ; X86-NEXT: .p2align 4, 0x90 | ||||
; X86-NEXT: .LBB1_1: # %loop | ; X86-NEXT: .LBB1_1: # %loop | ||||
; X86-NEXT: # =>This Inner Loop Header: Depth=1 | ; X86-NEXT: # =>This Inner Loop Header: Depth=1 | ||||
; X86-NEXT: movl (%eax), %esi | ; X86-NEXT: movl (%eax), %esi | ||||
; X86-NEXT: movl 16(%eax), %ecx | ; X86-NEXT: movl 16(%eax), %ecx | ||||
; X86-NEXT: leal 1(%esi,%ecx), %edi | ; X86-NEXT: leal 1(%esi,%ecx), %edi | ||||
; X86-NEXT: movl %edi, 12(%eax) | ; X86-NEXT: movl %edi, 12(%eax) | ||||
; X86-NEXT: decl %edx | ; X86-NEXT: decl %edx | ||||
; X86-NEXT: jne .LBB1_1 | ; X86-NEXT: jne .LBB1_1 | ||||
; X86-NEXT: # BB#2: # %exit | ; X86-NEXT: # BB#2: # %exit | ||||
; X86-NEXT: addl %ecx, %esi | ; X86-NEXT: addl %ecx, %esi | ||||
; X86-NEXT: leal 1(%ecx,%esi), %edx | ; X86-NEXT: leal 1(%ecx,%esi), %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: addl %ecx, %edx | ; X86-NEXT: addl %ecx, %edx | ||||
; X86-NEXT: movl %edx, 16(%eax) | ; X86-NEXT: movl %edx, 16(%eax) | ||||
; X86-NEXT: popl %esi | ; X86-NEXT: popl %esi | ||||
; X86-NEXT: .Lcfi7: | |||||
; X86-NEXT: .cfi_def_cfa_offset 8 | |||||
; X86-NEXT: popl %edi | ; X86-NEXT: popl %edi | ||||
; X86-NEXT: .Lcfi8: | |||||
; X86-NEXT: .cfi_def_cfa_offset 4 | |||||
; X86-NEXT: retl | ; X86-NEXT: retl | ||||
entry: | entry: | ||||
br label %loop | br label %loop | ||||
loop: | loop: | ||||
%iter = phi i32 [%n ,%entry ] ,[ %iter.ctr ,%loop] | %iter = phi i32 [%n ,%entry ] ,[ %iter.ctr ,%loop] | ||||
%h0 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 0 | %h0 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 0 | ||||
%0 = load i32, i32* %h0, align 8 | %0 = load i32, i32* %h0, align 8 | ||||
Show All 21 Lines |