2016-07-26 05:11:45 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s
|
|
|
|
|
2012-02-29 01:58:00 +08:00
|
|
|
define i64 @test1(i32 %xx, i32 %test) nounwind {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
|
2018-05-02 03:26:15 +08:00
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %cl
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: andb $7, %cl
|
|
|
|
; CHECK-NEXT: movl %edx, %eax
|
|
|
|
; CHECK-NEXT: shll %cl, %eax
|
|
|
|
; CHECK-NEXT: shrl %edx
|
|
|
|
; CHECK-NEXT: xorb $31, %cl
|
|
|
|
; CHECK-NEXT: shrl %cl, %edx
|
|
|
|
; CHECK-NEXT: retl
|
2012-02-29 01:58:00 +08:00
|
|
|
%conv = zext i32 %xx to i64
|
|
|
|
%and = and i32 %test, 7
|
|
|
|
%sh_prom = zext i32 %and to i64
|
|
|
|
%shl = shl i64 %conv, %sh_prom
|
|
|
|
ret i64 %shl
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test2(i64 %xx, i32 %test) nounwind {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: pushl %esi
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
|
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %cl
|
|
|
|
; CHECK-NEXT: andb $7, %cl
|
|
|
|
; CHECK-NEXT: movl %esi, %eax
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: shll %cl, %eax
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: shldl %cl, %esi, %edx
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: popl %esi
|
|
|
|
; CHECK-NEXT: retl
|
2012-02-29 01:58:00 +08:00
|
|
|
%and = and i32 %test, 7
|
|
|
|
%sh_prom = zext i32 %and to i64
|
|
|
|
%shl = shl i64 %xx, %sh_prom
|
|
|
|
ret i64 %shl
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test3(i64 %xx, i32 %test) nounwind {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %cl
|
|
|
|
; CHECK-NEXT: andb $7, %cl
|
|
|
|
; CHECK-NEXT: shrdl %cl, %edx, %eax
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: shrl %cl, %edx
|
|
|
|
; CHECK-NEXT: retl
|
2012-02-29 01:58:00 +08:00
|
|
|
%and = and i32 %test, 7
|
|
|
|
%sh_prom = zext i32 %and to i64
|
|
|
|
%shr = lshr i64 %xx, %sh_prom
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test4(i64 %xx, i32 %test) nounwind {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
|
2016-08-01 03:50:45 +08:00
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %cl
|
|
|
|
; CHECK-NEXT: andb $7, %cl
|
|
|
|
; CHECK-NEXT: shrdl %cl, %edx, %eax
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: sarl %cl, %edx
|
|
|
|
; CHECK-NEXT: retl
|
2012-02-29 01:58:00 +08:00
|
|
|
%and = and i32 %test, 7
|
|
|
|
%sh_prom = zext i32 %and to i64
|
|
|
|
%shr = ashr i64 %xx, %sh_prom
|
|
|
|
ret i64 %shr
|
|
|
|
}
|
2013-01-27 19:19:11 +08:00
|
|
|
|
|
|
|
; PR14668
|
|
|
|
define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: pushl %ebp
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
|
|
|
; CHECK-NEXT: pushl %ebx
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 12
|
|
|
|
; CHECK-NEXT: pushl %edi
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; CHECK-NEXT: pushl %esi
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 20
|
|
|
|
; CHECK-NEXT: .cfi_offset %esi, -20
|
|
|
|
; CHECK-NEXT: .cfi_offset %edi, -16
|
|
|
|
; CHECK-NEXT: .cfi_offset %ebx, -12
|
|
|
|
; CHECK-NEXT: .cfi_offset %ebp, -8
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2018-09-20 02:59:08 +08:00
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %ch
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movb {{[0-9]+}}(%esp), %cl
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ebx
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
|
|
|
|
; CHECK-NEXT: movl %ebx, %edi
|
|
|
|
; CHECK-NEXT: shll %cl, %edi
|
|
|
|
; CHECK-NEXT: shldl %cl, %ebx, %esi
|
|
|
|
; CHECK-NEXT: testb $32, %cl
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ebp
|
|
|
|
; CHECK-NEXT: je .LBB4_2
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK-NEXT: # %bb.1:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl %edi, %esi
|
|
|
|
; CHECK-NEXT: xorl %edi, %edi
|
|
|
|
; CHECK-NEXT: .LBB4_2:
|
|
|
|
; CHECK-NEXT: movl %edx, %ebx
|
2018-09-20 02:59:08 +08:00
|
|
|
; CHECK-NEXT: movb %ch, %cl
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: shll %cl, %ebx
|
|
|
|
; CHECK-NEXT: shldl %cl, %edx, %ebp
|
2018-09-20 02:59:08 +08:00
|
|
|
; CHECK-NEXT: testb $32, %ch
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: je .LBB4_4
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK-NEXT: # %bb.3:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl %ebx, %ebp
|
|
|
|
; CHECK-NEXT: xorl %ebx, %ebx
|
|
|
|
; CHECK-NEXT: .LBB4_4:
|
|
|
|
; CHECK-NEXT: movl %ebp, 12(%eax)
|
|
|
|
; CHECK-NEXT: movl %ebx, 8(%eax)
|
|
|
|
; CHECK-NEXT: movl %esi, 4(%eax)
|
|
|
|
; CHECK-NEXT: movl %edi, (%eax)
|
|
|
|
; CHECK-NEXT: popl %esi
|
2018-04-24 18:32:08 +08:00
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: popl %edi
|
2018-04-24 18:32:08 +08:00
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 12
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: popl %ebx
|
2018-04-24 18:32:08 +08:00
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: popl %ebp
|
2018-04-24 18:32:08 +08:00
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 4
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: retl $4
|
2013-01-27 19:19:11 +08:00
|
|
|
%shl = shl <2 x i64> %A, %B
|
|
|
|
ret <2 x i64> %shl
|
|
|
|
}
|
2013-12-13 21:40:24 +08:00
|
|
|
|
|
|
|
; PR16108
|
|
|
|
define i32 @test6() {
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: pushl %ebp
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
|
|
|
; CHECK-NEXT: .cfi_offset %ebp, -8
|
|
|
|
; CHECK-NEXT: movl %esp, %ebp
|
|
|
|
; CHECK-NEXT: .cfi_def_cfa_register %ebp
|
|
|
|
; CHECK-NEXT: andl $-8, %esp
|
|
|
|
; CHECK-NEXT: subl $16, %esp
|
|
|
|
; CHECK-NEXT: movl $1, {{[0-9]+}}(%esp)
|
[DAG] Improve Aliasing of operations to static alloca
Re-recommiting after landing DAG extension-crash fix.
Recommiting after adding check to avoid miscomputing alias information
on addresses of the same base but different subindices.
Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.
Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.
Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.
The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.
Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand
Reviewed By: rnk
Subscribers: sdardis, nemanjai, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33345
llvm-svn: 308350
2017-07-19 04:06:24 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2018-06-30 01:24:07 +08:00
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
|
|
|
; CHECK-NEXT: orl $0, %eax
|
|
|
|
; CHECK-NEXT: je .LBB5_3
|
|
|
|
; CHECK-NEXT: # %bb.1: # %if.then
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl $1, %eax
|
2018-06-30 01:24:07 +08:00
|
|
|
; CHECK-NEXT: jmp .LBB5_2
|
|
|
|
; CHECK-NEXT: .LBB5_3: # %if.end
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
2018-06-30 01:24:07 +08:00
|
|
|
; CHECK-NEXT: .LBB5_2: # %if.then
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: movl %ebp, %esp
|
|
|
|
; CHECK-NEXT: popl %ebp
|
2018-04-24 18:32:08 +08:00
|
|
|
; CHECK-NEXT: .cfi_def_cfa %esp, 4
|
2016-07-26 05:11:45 +08:00
|
|
|
; CHECK-NEXT: retl
|
2013-12-13 21:40:24 +08:00
|
|
|
%x = alloca i32, align 4
|
|
|
|
%t = alloca i64, align 8
|
[DAG] Improve Aliasing of operations to static alloca
Re-recommiting after landing DAG extension-crash fix.
Recommiting after adding check to avoid miscomputing alias information
on addresses of the same base but different subindices.
Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.
Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.
Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.
The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.
Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand
Reviewed By: rnk
Subscribers: sdardis, nemanjai, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33345
llvm-svn: 308350
2017-07-19 04:06:24 +08:00
|
|
|
store volatile i32 1, i32* %x, align 4
|
|
|
|
%load = load volatile i32, i32* %x, align 4
|
2013-12-13 21:40:24 +08:00
|
|
|
%shl = shl i32 %load, 8
|
|
|
|
%add = add i32 %shl, -224
|
|
|
|
%sh_prom = zext i32 %add to i64
|
|
|
|
%shl1 = shl i64 1, %sh_prom
|
|
|
|
%cmp = icmp ne i64 %shl1, 4294967296
|
|
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
|
|
|
|
if.then: ; preds = %entry
|
|
|
|
ret i32 1
|
|
|
|
|
|
|
|
if.end: ; preds = %entry
|
|
|
|
ret i32 0
|
|
|
|
|
|
|
|
}
|