1 # RUN: llc -x mir < %s | FileCheck %s
3 target triple = "x86_64-unknown-linux-gnu"
5 @x = external global i64
6 @i = external thread_local global i32
22 tracksRegLiveness: true
24 - { id: 0, class: gr64 }
25 - { id: 1, class: gr64 }
26 - { id: 2, class: gr64 }
27 - { id: 3, class: gr64 }
28 - { id: 4, class: gr32 }
31 %0:gr64 = MOV64rm $rip, 1, $noreg, @x, $noreg :: (load (s64))
32 %1:gr64 = OR64ri8 %0, 7, implicit-def dead $eflags
33 %2:gr64 = MOV64rm $rip, 1, $noreg, target-flags(x86-gottpoff) @i, $noreg :: (load (s64))
34 %3:gr64 = OR64rr %2, %1, implicit-def dead $eflags
35 %4:gr32 = MOV32rm killed %3, 1, $noreg, 0, $fs :: (load (s32))
36 ; CHECK-NOT: orq {{.*}}GOTTPOFF{{.*}}
38 ; What we actually expect:
39 ; CHECK: movq {{.*}}GOTTPOFF{{.*}}, %[[R:.*]]
40 ; CHECK-NEXT: orq %{{.*}}, %[[R]]
41 ; CHECK-NEXT: movl %fs:(%[[R]]),
43 ; CHECK-NOT: orq {{.*}}GOTTPOFF{{.*}}
52 tracksRegLiveness: true
54 - { id: 0, class: gr64 }
55 - { id: 1, class: gr64 }
56 - { id: 2, class: gr64 }
57 - { id: 3, class: gr64 }
58 - { id: 4, class: gr32 }
61 %0:gr64 = MOV64rm $rip, 1, $noreg, @x, $noreg :: (load (s64))
62 %1:gr64 = OR64ri8 %0, 7, implicit-def dead $eflags
63 %2:gr64 = MOV64rm $rip, 1, $noreg, target-flags(x86-gottpoff) @i, $noreg :: (load (s64))
64 %3:gr64 = AND64rr %2, %1, implicit-def dead $eflags
65 %4:gr32 = MOV32rm killed %3, 1, $noreg, 0, $fs :: (load (s32))
66 ; CHECK-NOT: andq {{.*}}GOTTPOFF{{.*}}
68 ; What we actually expect:
69 ; CHECK: movq {{.*}}GOTTPOFF{{.*}}, %[[R:.*]]
70 ; CHECK-NEXT: andq %{{.*}}, %[[R]]
71 ; CHECK-NEXT: movl %fs:(%[[R]]),
73 ; CHECK-NOT: andq {{.*}}GOTTPOFF{{.*}}