1 ; RUN: llc < %s -mtriple=i686-- -stackrealign -O2 | FileCheck %s
4 ; Check that register allocator is able to handle that
5 ; a-lot-of-fixed-and-reserved-registers case. We do that by
6 ; emmiting lea before 4 cmpxchg8b operands generators.
8 define void @foo_alloca(i64* %a, i32 %off, i32 %n) {
9 %dummy = alloca i32, i32 %n
10 %addr = getelementptr inbounds i64, i64* %a, i32 %off
12 %res = cmpxchg i64* %addr, i64 0, i64 1 monotonic monotonic
16 ; CHECK-LABEL: foo_alloca
17 ; CHECK: leal {{\(%e..,%e..,.*\)}}, [[REGISTER:%e.i]]
18 ; CHECK-NEXT: xorl %eax, %eax
19 ; CHECK-NEXT: xorl %edx, %edx
20 ; CHECK-NEXT: xorl %ecx, %ecx
21 ; CHECK-NEXT: movl $1, %ebx
22 ; CHECK-NEXT: lock cmpxchg8b ([[REGISTER]])
24 ; If we don't use index register in the address mode -
25 ; check that we did not generate the lea.
26 define void @foo_alloca_direct_address(i64* %addr, i32 %n) {
27 %dummy = alloca i32, i32 %n
29 %res = cmpxchg i64* %addr, i64 0, i64 1 monotonic monotonic
33 ; CHECK-LABEL: foo_alloca_direct_address
34 ; CHECK-NOT: leal {{\(%e.*\)}}, [[REGISTER:%e.i]]
35 ; CHECK: lock cmpxchg8b ([[REGISTER]])