616 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs | FileCheck %s --check-prefix=X643; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mattr=+sse2 | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SSE24; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=slm -mattr=-sse2 | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM5; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=goldmont -mattr=-sse2 | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM6; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=knl -mattr=-sse2 | FileCheck %s --check-prefixes=X86,X86-GENERIC,X86-SLM7; RUN: llc < %s -mtriple=i686-- -verify-machineinstrs -mcpu=atom -mattr=-sse2 | FileCheck %s --check-prefixes=X86,X86-ATOM8 9; On x86, an atomic rmw operation that does not modify the value in memory10; (such as atomic add 0) can be replaced by an mfence followed by a mov.11; This is explained (with the motivation for such an optimization) in12; http://www.hpl.hp.com/techreports/2012/HPL-2012-68.pdf13 14define i8 @add8(ptr %p) #0 {15; X64-LABEL: add8:16; X64: # %bb.0:17; X64-NEXT: #MEMBARRIER18; X64-NEXT: movzbl (%rdi), %eax19; X64-NEXT: retq20;21; X86-GENERIC-LABEL: add8:22; X86-GENERIC: # %bb.0:23; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %eax24; X86-GENERIC-NEXT: #MEMBARRIER25; X86-GENERIC-NEXT: movzbl (%eax), %eax26; X86-GENERIC-NEXT: retl27;28; X86-ATOM-LABEL: add8:29; X86-ATOM: # %bb.0:30; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax31; X86-ATOM-NEXT: #MEMBARRIER32; X86-ATOM-NEXT: movzbl (%eax), %eax33; X86-ATOM-NEXT: nop34; X86-ATOM-NEXT: nop35; X86-ATOM-NEXT: nop36; X86-ATOM-NEXT: nop37; X86-ATOM-NEXT: retl38 %1 = atomicrmw add ptr %p, i8 0 syncscope("singlethread") monotonic39 ret i8 %140}41 42define i16 @or16(ptr %p) #0 {43; X64-LABEL: or16:44; X64: # %bb.0:45; X64-NEXT: #MEMBARRIER46; X64-NEXT: movzwl (%rdi), %eax47; X64-NEXT: retq48;49; X86-GENERIC-LABEL: or16:50; X86-GENERIC: # %bb.0:51; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %eax52; X86-GENERIC-NEXT: #MEMBARRIER53; X86-GENERIC-NEXT: movzwl (%eax), %eax54; X86-GENERIC-NEXT: retl55;56; X86-ATOM-LABEL: or16:57; X86-ATOM: # %bb.0:58; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax59; X86-ATOM-NEXT: #MEMBARRIER60; X86-ATOM-NEXT: movzwl (%eax), %eax61; X86-ATOM-NEXT: nop62; X86-ATOM-NEXT: nop63; X86-ATOM-NEXT: nop64; X86-ATOM-NEXT: nop65; X86-ATOM-NEXT: retl66 %1 = atomicrmw or ptr %p, i16 0 syncscope("singlethread") acquire67 ret i16 %168}69 70define i32 @xor32(ptr %p) #0 {71; X64-LABEL: xor32:72; X64: # %bb.0:73; X64-NEXT: #MEMBARRIER74; X64-NEXT: movl (%rdi), %eax75; X64-NEXT: retq76;77; X86-GENERIC-LABEL: xor32:78; X86-GENERIC: # %bb.0:79; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %eax80; X86-GENERIC-NEXT: #MEMBARRIER81; X86-GENERIC-NEXT: movl (%eax), %eax82; X86-GENERIC-NEXT: retl83;84; X86-ATOM-LABEL: xor32:85; X86-ATOM: # %bb.0:86; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax87; X86-ATOM-NEXT: #MEMBARRIER88; X86-ATOM-NEXT: movl (%eax), %eax89; X86-ATOM-NEXT: nop90; X86-ATOM-NEXT: nop91; X86-ATOM-NEXT: nop92; X86-ATOM-NEXT: nop93; X86-ATOM-NEXT: retl94 %1 = atomicrmw xor ptr %p, i32 0 syncscope("singlethread") release95 ret i32 %196}97 98define i64 @sub64(ptr %p) #0 {99; X64-LABEL: sub64:100; X64: # %bb.0:101; X64-NEXT: #MEMBARRIER102; X64-NEXT: movq (%rdi), %rax103; X64-NEXT: retq104;105; X86-LABEL: sub64:106; X86: # %bb.0:107; X86-NEXT: pushl %ebx108; X86-NEXT: pushl %esi109; X86-NEXT: movl {{[0-9]+}}(%esp), %esi110; X86-NEXT: movl (%esi), %eax111; X86-NEXT: movl 4(%esi), %edx112; X86-NEXT: .p2align 4113; X86-NEXT: .LBB3_1: # %atomicrmw.start114; X86-NEXT: # =>This Inner Loop Header: Depth=1115; X86-NEXT: movl %edx, %ecx116; X86-NEXT: movl %eax, %ebx117; X86-NEXT: lock cmpxchg8b (%esi)118; X86-NEXT: jne .LBB3_1119; X86-NEXT: # %bb.2: # %atomicrmw.end120; X86-NEXT: popl %esi121; X86-NEXT: popl %ebx122; X86-NEXT: retl123 %1 = atomicrmw sub ptr %p, i64 0 syncscope("singlethread") seq_cst124 ret i64 %1125}126 127define i128 @or128(ptr %p) #0 {128; X64-LABEL: or128:129; X64: # %bb.0:130; X64-NEXT: pushq %rax131; X64-NEXT: xorl %esi, %esi132; X64-NEXT: xorl %edx, %edx133; X64-NEXT: xorl %ecx, %ecx134; X64-NEXT: callq __atomic_fetch_or_16@PLT135; X64-NEXT: popq %rcx136; X64-NEXT: retq137;138; X86-GENERIC-LABEL: or128:139; X86-GENERIC: # %bb.0:140; X86-GENERIC-NEXT: pushl %ebp141; X86-GENERIC-NEXT: movl %esp, %ebp142; X86-GENERIC-NEXT: pushl %ebx143; X86-GENERIC-NEXT: pushl %edi144; X86-GENERIC-NEXT: pushl %esi145; X86-GENERIC-NEXT: andl $-16, %esp146; X86-GENERIC-NEXT: subl $48, %esp147; X86-GENERIC-NEXT: movl 12(%ebp), %edi148; X86-GENERIC-NEXT: movl 12(%edi), %ecx149; X86-GENERIC-NEXT: movl 8(%edi), %edx150; X86-GENERIC-NEXT: movl (%edi), %ebx151; X86-GENERIC-NEXT: movl 4(%edi), %esi152; X86-GENERIC-NEXT: .p2align 4153; X86-GENERIC-NEXT: .LBB4_1: # %atomicrmw.start154; X86-GENERIC-NEXT: # =>This Inner Loop Header: Depth=1155; X86-GENERIC-NEXT: movl %ebx, (%esp)156; X86-GENERIC-NEXT: movl %esi, {{[0-9]+}}(%esp)157; X86-GENERIC-NEXT: movl %edx, {{[0-9]+}}(%esp)158; X86-GENERIC-NEXT: movl %ecx, {{[0-9]+}}(%esp)159; X86-GENERIC-NEXT: movl %ecx, {{[0-9]+}}(%esp)160; X86-GENERIC-NEXT: movl %edx, {{[0-9]+}}(%esp)161; X86-GENERIC-NEXT: movl %esi, {{[0-9]+}}(%esp)162; X86-GENERIC-NEXT: movl %ebx, {{[0-9]+}}(%esp)163; X86-GENERIC-NEXT: pushl $0164; X86-GENERIC-NEXT: pushl $0165; X86-GENERIC-NEXT: leal {{[0-9]+}}(%esp), %eax166; X86-GENERIC-NEXT: pushl %eax167; X86-GENERIC-NEXT: leal {{[0-9]+}}(%esp), %eax168; X86-GENERIC-NEXT: pushl %eax169; X86-GENERIC-NEXT: pushl %edi170; X86-GENERIC-NEXT: pushl $16171; X86-GENERIC-NEXT: calll __atomic_compare_exchange@PLT172; X86-GENERIC-NEXT: addl $24, %esp173; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %ecx174; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %edx175; X86-GENERIC-NEXT: movl (%esp), %ebx176; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %esi177; X86-GENERIC-NEXT: testb %al, %al178; X86-GENERIC-NEXT: je .LBB4_1179; X86-GENERIC-NEXT: # %bb.2: # %atomicrmw.end180; X86-GENERIC-NEXT: movl 8(%ebp), %eax181; X86-GENERIC-NEXT: movl %ebx, (%eax)182; X86-GENERIC-NEXT: movl %esi, 4(%eax)183; X86-GENERIC-NEXT: movl %edx, 8(%eax)184; X86-GENERIC-NEXT: movl %ecx, 12(%eax)185; X86-GENERIC-NEXT: leal -12(%ebp), %esp186; X86-GENERIC-NEXT: popl %esi187; X86-GENERIC-NEXT: popl %edi188; X86-GENERIC-NEXT: popl %ebx189; X86-GENERIC-NEXT: popl %ebp190; X86-GENERIC-NEXT: retl $4191;192; X86-ATOM-LABEL: or128:193; X86-ATOM: # %bb.0:194; X86-ATOM-NEXT: pushl %ebp195; X86-ATOM-NEXT: movl %esp, %ebp196; X86-ATOM-NEXT: pushl %ebx197; X86-ATOM-NEXT: pushl %edi198; X86-ATOM-NEXT: pushl %esi199; X86-ATOM-NEXT: andl $-16, %esp200; X86-ATOM-NEXT: leal -{{[0-9]+}}(%esp), %esp201; X86-ATOM-NEXT: movl 12(%ebp), %edi202; X86-ATOM-NEXT: movl 12(%edi), %ecx203; X86-ATOM-NEXT: movl 8(%edi), %edx204; X86-ATOM-NEXT: movl (%edi), %esi205; X86-ATOM-NEXT: movl 4(%edi), %ebx206; X86-ATOM-NEXT: .p2align 4207; X86-ATOM-NEXT: .LBB4_1: # %atomicrmw.start208; X86-ATOM-NEXT: # =>This Inner Loop Header: Depth=1209; X86-ATOM-NEXT: movl %esi, (%esp)210; X86-ATOM-NEXT: movl %ebx, {{[0-9]+}}(%esp)211; X86-ATOM-NEXT: movl %edx, {{[0-9]+}}(%esp)212; X86-ATOM-NEXT: movl %ecx, {{[0-9]+}}(%esp)213; X86-ATOM-NEXT: movl %ecx, {{[0-9]+}}(%esp)214; X86-ATOM-NEXT: movl %edx, {{[0-9]+}}(%esp)215; X86-ATOM-NEXT: movl %ebx, {{[0-9]+}}(%esp)216; X86-ATOM-NEXT: movl %esi, {{[0-9]+}}(%esp)217; X86-ATOM-NEXT: pushl $0218; X86-ATOM-NEXT: pushl $0219; X86-ATOM-NEXT: leal {{[0-9]+}}(%esp), %eax220; X86-ATOM-NEXT: pushl %eax221; X86-ATOM-NEXT: leal {{[0-9]+}}(%esp), %eax222; X86-ATOM-NEXT: pushl %eax223; X86-ATOM-NEXT: pushl %edi224; X86-ATOM-NEXT: pushl $16225; X86-ATOM-NEXT: calll __atomic_compare_exchange@PLT226; X86-ATOM-NEXT: leal {{[0-9]+}}(%esp), %esp227; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx228; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %edx229; X86-ATOM-NEXT: testb %al, %al230; X86-ATOM-NEXT: movl (%esp), %esi231; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ebx232; X86-ATOM-NEXT: je .LBB4_1233; X86-ATOM-NEXT: # %bb.2: # %atomicrmw.end234; X86-ATOM-NEXT: movl 8(%ebp), %eax235; X86-ATOM-NEXT: movl %esi, (%eax)236; X86-ATOM-NEXT: movl %ebx, 4(%eax)237; X86-ATOM-NEXT: movl %edx, 8(%eax)238; X86-ATOM-NEXT: movl %ecx, 12(%eax)239; X86-ATOM-NEXT: leal -12(%ebp), %esp240; X86-ATOM-NEXT: popl %esi241; X86-ATOM-NEXT: popl %edi242; X86-ATOM-NEXT: popl %ebx243; X86-ATOM-NEXT: popl %ebp244; X86-ATOM-NEXT: retl $4245 %1 = atomicrmw or ptr %p, i128 0 syncscope("singlethread") monotonic246 ret i128 %1247}248 249; For 'and', the idempotent value is (-1)250define i32 @and32 (ptr %p) #0 {251; X64-LABEL: and32:252; X64: # %bb.0:253; X64-NEXT: #MEMBARRIER254; X64-NEXT: movl (%rdi), %eax255; X64-NEXT: retq256;257; X86-GENERIC-LABEL: and32:258; X86-GENERIC: # %bb.0:259; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %eax260; X86-GENERIC-NEXT: #MEMBARRIER261; X86-GENERIC-NEXT: movl (%eax), %eax262; X86-GENERIC-NEXT: retl263;264; X86-ATOM-LABEL: and32:265; X86-ATOM: # %bb.0:266; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %eax267; X86-ATOM-NEXT: #MEMBARRIER268; X86-ATOM-NEXT: movl (%eax), %eax269; X86-ATOM-NEXT: nop270; X86-ATOM-NEXT: nop271; X86-ATOM-NEXT: nop272; X86-ATOM-NEXT: nop273; X86-ATOM-NEXT: retl274 %1 = atomicrmw and ptr %p, i32 -1 syncscope("singlethread") acq_rel275 ret i32 %1276}277 278define void @or32_nouse_monotonic(ptr %p) #0 {279; X64-LABEL: or32_nouse_monotonic:280; X64: # %bb.0:281; X64-NEXT: #MEMBARRIER282; X64-NEXT: retq283;284; X86-GENERIC-LABEL: or32_nouse_monotonic:285; X86-GENERIC: # %bb.0:286; X86-GENERIC-NEXT: #MEMBARRIER287; X86-GENERIC-NEXT: retl288;289; X86-ATOM-LABEL: or32_nouse_monotonic:290; X86-ATOM: # %bb.0:291; X86-ATOM-NEXT: #MEMBARRIER292; X86-ATOM-NEXT: nop293; X86-ATOM-NEXT: nop294; X86-ATOM-NEXT: nop295; X86-ATOM-NEXT: nop296; X86-ATOM-NEXT: nop297; X86-ATOM-NEXT: nop298; X86-ATOM-NEXT: nop299; X86-ATOM-NEXT: nop300; X86-ATOM-NEXT: retl301 atomicrmw or ptr %p, i32 0 syncscope("singlethread") monotonic302 ret void303}304 305 306define void @or32_nouse_acquire(ptr %p) #0 {307; X64-LABEL: or32_nouse_acquire:308; X64: # %bb.0:309; X64-NEXT: #MEMBARRIER310; X64-NEXT: retq311;312; X86-GENERIC-LABEL: or32_nouse_acquire:313; X86-GENERIC: # %bb.0:314; X86-GENERIC-NEXT: #MEMBARRIER315; X86-GENERIC-NEXT: retl316;317; X86-ATOM-LABEL: or32_nouse_acquire:318; X86-ATOM: # %bb.0:319; X86-ATOM-NEXT: #MEMBARRIER320; X86-ATOM-NEXT: nop321; X86-ATOM-NEXT: nop322; X86-ATOM-NEXT: nop323; X86-ATOM-NEXT: nop324; X86-ATOM-NEXT: nop325; X86-ATOM-NEXT: nop326; X86-ATOM-NEXT: nop327; X86-ATOM-NEXT: nop328; X86-ATOM-NEXT: retl329 atomicrmw or ptr %p, i32 0 acquire330 ret void331}332 333define void @or32_nouse_release(ptr %p) #0 {334; X64-LABEL: or32_nouse_release:335; X64: # %bb.0:336; X64-NEXT: #MEMBARRIER337; X64-NEXT: retq338;339; X86-GENERIC-LABEL: or32_nouse_release:340; X86-GENERIC: # %bb.0:341; X86-GENERIC-NEXT: #MEMBARRIER342; X86-GENERIC-NEXT: retl343;344; X86-ATOM-LABEL: or32_nouse_release:345; X86-ATOM: # %bb.0:346; X86-ATOM-NEXT: #MEMBARRIER347; X86-ATOM-NEXT: nop348; X86-ATOM-NEXT: nop349; X86-ATOM-NEXT: nop350; X86-ATOM-NEXT: nop351; X86-ATOM-NEXT: nop352; X86-ATOM-NEXT: nop353; X86-ATOM-NEXT: nop354; X86-ATOM-NEXT: nop355; X86-ATOM-NEXT: retl356 atomicrmw or ptr %p, i32 0 syncscope("singlethread") release357 ret void358}359 360define void @or32_nouse_acq_rel(ptr %p) #0 {361; X64-LABEL: or32_nouse_acq_rel:362; X64: # %bb.0:363; X64-NEXT: #MEMBARRIER364; X64-NEXT: retq365;366; X86-GENERIC-LABEL: or32_nouse_acq_rel:367; X86-GENERIC: # %bb.0:368; X86-GENERIC-NEXT: #MEMBARRIER369; X86-GENERIC-NEXT: retl370;371; X86-ATOM-LABEL: or32_nouse_acq_rel:372; X86-ATOM: # %bb.0:373; X86-ATOM-NEXT: #MEMBARRIER374; X86-ATOM-NEXT: nop375; X86-ATOM-NEXT: nop376; X86-ATOM-NEXT: nop377; X86-ATOM-NEXT: nop378; X86-ATOM-NEXT: nop379; X86-ATOM-NEXT: nop380; X86-ATOM-NEXT: nop381; X86-ATOM-NEXT: nop382; X86-ATOM-NEXT: retl383 atomicrmw or ptr %p, i32 0 syncscope("singlethread") acq_rel384 ret void385}386 387define void @or32_nouse_seq_cst(ptr %p) #0 {388; X64-LABEL: or32_nouse_seq_cst:389; X64: # %bb.0:390; X64-NEXT: #MEMBARRIER391; X64-NEXT: retq392;393; X86-GENERIC-LABEL: or32_nouse_seq_cst:394; X86-GENERIC: # %bb.0:395; X86-GENERIC-NEXT: #MEMBARRIER396; X86-GENERIC-NEXT: retl397;398; X86-ATOM-LABEL: or32_nouse_seq_cst:399; X86-ATOM: # %bb.0:400; X86-ATOM-NEXT: #MEMBARRIER401; X86-ATOM-NEXT: nop402; X86-ATOM-NEXT: nop403; X86-ATOM-NEXT: nop404; X86-ATOM-NEXT: nop405; X86-ATOM-NEXT: nop406; X86-ATOM-NEXT: nop407; X86-ATOM-NEXT: nop408; X86-ATOM-NEXT: nop409; X86-ATOM-NEXT: retl410 atomicrmw or ptr %p, i32 0 syncscope("singlethread") seq_cst411 ret void412}413 414; TODO: The value isn't used on 32 bit, so the cmpxchg8b is unneeded415define void @or64_nouse_seq_cst(ptr %p) #0 {416; X64-LABEL: or64_nouse_seq_cst:417; X64: # %bb.0:418; X64-NEXT: #MEMBARRIER419; X64-NEXT: retq420;421; X86-LABEL: or64_nouse_seq_cst:422; X86: # %bb.0:423; X86-NEXT: pushl %ebx424; X86-NEXT: pushl %esi425; X86-NEXT: movl {{[0-9]+}}(%esp), %esi426; X86-NEXT: movl (%esi), %eax427; X86-NEXT: movl 4(%esi), %edx428; X86-NEXT: .p2align 4429; X86-NEXT: .LBB11_1: # %atomicrmw.start430; X86-NEXT: # =>This Inner Loop Header: Depth=1431; X86-NEXT: movl %edx, %ecx432; X86-NEXT: movl %eax, %ebx433; X86-NEXT: lock cmpxchg8b (%esi)434; X86-NEXT: jne .LBB11_1435; X86-NEXT: # %bb.2: # %atomicrmw.end436; X86-NEXT: popl %esi437; X86-NEXT: popl %ebx438; X86-NEXT: retl439 atomicrmw or ptr %p, i64 0 syncscope("singlethread") seq_cst440 ret void441}442 443; TODO: Don't need to lower as sync_and_fetch call444define void @or128_nouse_seq_cst(ptr %p) #0 {445; X64-LABEL: or128_nouse_seq_cst:446; X64: # %bb.0:447; X64-NEXT: pushq %rax448; X64-NEXT: xorl %esi, %esi449; X64-NEXT: xorl %edx, %edx450; X64-NEXT: movl $5, %ecx451; X64-NEXT: callq __atomic_fetch_or_16@PLT452; X64-NEXT: popq %rax453; X64-NEXT: retq454;455; X86-GENERIC-LABEL: or128_nouse_seq_cst:456; X86-GENERIC: # %bb.0:457; X86-GENERIC-NEXT: pushl %ebp458; X86-GENERIC-NEXT: movl %esp, %ebp459; X86-GENERIC-NEXT: pushl %ebx460; X86-GENERIC-NEXT: pushl %edi461; X86-GENERIC-NEXT: pushl %esi462; X86-GENERIC-NEXT: andl $-16, %esp463; X86-GENERIC-NEXT: subl $48, %esp464; X86-GENERIC-NEXT: movl 8(%ebp), %esi465; X86-GENERIC-NEXT: movl 12(%esi), %ecx466; X86-GENERIC-NEXT: movl 8(%esi), %edi467; X86-GENERIC-NEXT: movl (%esi), %edx468; X86-GENERIC-NEXT: movl 4(%esi), %ebx469; X86-GENERIC-NEXT: .p2align 4470; X86-GENERIC-NEXT: .LBB12_1: # %atomicrmw.start471; X86-GENERIC-NEXT: # =>This Inner Loop Header: Depth=1472; X86-GENERIC-NEXT: movl %edx, (%esp)473; X86-GENERIC-NEXT: movl %ebx, {{[0-9]+}}(%esp)474; X86-GENERIC-NEXT: movl %edi, {{[0-9]+}}(%esp)475; X86-GENERIC-NEXT: movl %ecx, {{[0-9]+}}(%esp)476; X86-GENERIC-NEXT: movl %ecx, {{[0-9]+}}(%esp)477; X86-GENERIC-NEXT: movl %edi, {{[0-9]+}}(%esp)478; X86-GENERIC-NEXT: movl %ebx, {{[0-9]+}}(%esp)479; X86-GENERIC-NEXT: movl %edx, {{[0-9]+}}(%esp)480; X86-GENERIC-NEXT: pushl $5481; X86-GENERIC-NEXT: pushl $5482; X86-GENERIC-NEXT: leal {{[0-9]+}}(%esp), %eax483; X86-GENERIC-NEXT: pushl %eax484; X86-GENERIC-NEXT: leal {{[0-9]+}}(%esp), %eax485; X86-GENERIC-NEXT: pushl %eax486; X86-GENERIC-NEXT: pushl %esi487; X86-GENERIC-NEXT: pushl $16488; X86-GENERIC-NEXT: calll __atomic_compare_exchange@PLT489; X86-GENERIC-NEXT: addl $24, %esp490; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %ecx491; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %edi492; X86-GENERIC-NEXT: movl (%esp), %edx493; X86-GENERIC-NEXT: movl {{[0-9]+}}(%esp), %ebx494; X86-GENERIC-NEXT: testb %al, %al495; X86-GENERIC-NEXT: je .LBB12_1496; X86-GENERIC-NEXT: # %bb.2: # %atomicrmw.end497; X86-GENERIC-NEXT: leal -12(%ebp), %esp498; X86-GENERIC-NEXT: popl %esi499; X86-GENERIC-NEXT: popl %edi500; X86-GENERIC-NEXT: popl %ebx501; X86-GENERIC-NEXT: popl %ebp502; X86-GENERIC-NEXT: retl503;504; X86-ATOM-LABEL: or128_nouse_seq_cst:505; X86-ATOM: # %bb.0:506; X86-ATOM-NEXT: pushl %ebp507; X86-ATOM-NEXT: movl %esp, %ebp508; X86-ATOM-NEXT: pushl %ebx509; X86-ATOM-NEXT: pushl %edi510; X86-ATOM-NEXT: pushl %esi511; X86-ATOM-NEXT: andl $-16, %esp512; X86-ATOM-NEXT: leal -{{[0-9]+}}(%esp), %esp513; X86-ATOM-NEXT: movl 8(%ebp), %esi514; X86-ATOM-NEXT: movl %esp, %ebx515; X86-ATOM-NEXT: movl 12(%esi), %ecx516; X86-ATOM-NEXT: movl 8(%esi), %edx517; X86-ATOM-NEXT: movl (%esi), %eax518; X86-ATOM-NEXT: movl 4(%esi), %edi519; X86-ATOM-NEXT: .p2align 4520; X86-ATOM-NEXT: .LBB12_1: # %atomicrmw.start521; X86-ATOM-NEXT: # =>This Inner Loop Header: Depth=1522; X86-ATOM-NEXT: movl %eax, (%esp)523; X86-ATOM-NEXT: movl %edi, {{[0-9]+}}(%esp)524; X86-ATOM-NEXT: movl %edx, {{[0-9]+}}(%esp)525; X86-ATOM-NEXT: movl %ecx, {{[0-9]+}}(%esp)526; X86-ATOM-NEXT: movl %ecx, {{[0-9]+}}(%esp)527; X86-ATOM-NEXT: movl %edx, {{[0-9]+}}(%esp)528; X86-ATOM-NEXT: movl %edi, {{[0-9]+}}(%esp)529; X86-ATOM-NEXT: movl %eax, {{[0-9]+}}(%esp)530; X86-ATOM-NEXT: pushl $5531; X86-ATOM-NEXT: pushl $5532; X86-ATOM-NEXT: leal {{[0-9]+}}(%esp), %eax533; X86-ATOM-NEXT: pushl %eax534; X86-ATOM-NEXT: pushl %ebx535; X86-ATOM-NEXT: pushl %esi536; X86-ATOM-NEXT: pushl $16537; X86-ATOM-NEXT: calll __atomic_compare_exchange@PLT538; X86-ATOM-NEXT: leal {{[0-9]+}}(%esp), %esp539; X86-ATOM-NEXT: testb %al, %al540; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %ecx541; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %edx542; X86-ATOM-NEXT: movl (%esp), %eax543; X86-ATOM-NEXT: movl {{[0-9]+}}(%esp), %edi544; X86-ATOM-NEXT: je .LBB12_1545; X86-ATOM-NEXT: # %bb.2: # %atomicrmw.end546; X86-ATOM-NEXT: leal -12(%ebp), %esp547; X86-ATOM-NEXT: popl %esi548; X86-ATOM-NEXT: popl %edi549; X86-ATOM-NEXT: popl %ebx550; X86-ATOM-NEXT: popl %ebp551; X86-ATOM-NEXT: retl552 atomicrmw or ptr %p, i128 0 syncscope("singlethread") seq_cst553 ret void554}555 556 557define void @or16_nouse_seq_cst(ptr %p) #0 {558; X64-LABEL: or16_nouse_seq_cst:559; X64: # %bb.0:560; X64-NEXT: #MEMBARRIER561; X64-NEXT: retq562;563; X86-GENERIC-LABEL: or16_nouse_seq_cst:564; X86-GENERIC: # %bb.0:565; X86-GENERIC-NEXT: #MEMBARRIER566; X86-GENERIC-NEXT: retl567;568; X86-ATOM-LABEL: or16_nouse_seq_cst:569; X86-ATOM: # %bb.0:570; X86-ATOM-NEXT: #MEMBARRIER571; X86-ATOM-NEXT: nop572; X86-ATOM-NEXT: nop573; X86-ATOM-NEXT: nop574; X86-ATOM-NEXT: nop575; X86-ATOM-NEXT: nop576; X86-ATOM-NEXT: nop577; X86-ATOM-NEXT: nop578; X86-ATOM-NEXT: nop579; X86-ATOM-NEXT: retl580 atomicrmw or ptr %p, i16 0 syncscope("singlethread") seq_cst581 ret void582}583 584define void @or8_nouse_seq_cst(ptr %p) #0 {585; X64-LABEL: or8_nouse_seq_cst:586; X64: # %bb.0:587; X64-NEXT: #MEMBARRIER588; X64-NEXT: retq589;590; X86-GENERIC-LABEL: or8_nouse_seq_cst:591; X86-GENERIC: # %bb.0:592; X86-GENERIC-NEXT: #MEMBARRIER593; X86-GENERIC-NEXT: retl594;595; X86-ATOM-LABEL: or8_nouse_seq_cst:596; X86-ATOM: # %bb.0:597; X86-ATOM-NEXT: #MEMBARRIER598; X86-ATOM-NEXT: nop599; X86-ATOM-NEXT: nop600; X86-ATOM-NEXT: nop601; X86-ATOM-NEXT: nop602; X86-ATOM-NEXT: nop603; X86-ATOM-NEXT: nop604; X86-ATOM-NEXT: nop605; X86-ATOM-NEXT: nop606; X86-ATOM-NEXT: retl607 atomicrmw or ptr %p, i8 0 syncscope("singlethread") seq_cst608 ret void609}610 611attributes #0 = { nounwind }612 613;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:614; X86-SLM: {{.*}}615; X86-SSE2: {{.*}}616