356 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 -mattr=+ptx50 | FileCheck %s --check-prefix=SM303; RUN: %if ptxas-sm_35 && ptxas-isa-5.0 %{ llc < %s -march=nvptx64 -mcpu=sm_35 -mattr=+ptx50 | %ptxas-verify -arch=sm_35 %}4; RUN: llc < %s -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 | FileCheck %s --check-prefix=SM705; RUN: %if ptxas-sm_70 && ptxas-isa-6.0 %{ llc < %s -march=nvptx64 -mcpu=sm_70 -mattr=+ptx60 | %ptxas-verify -arch=sm_70 %}6; RUN: llc < %s -march=nvptx64 -mcpu=sm_90 -mattr=+ptx87 | FileCheck %s --check-prefix=SM907; RUN: %if ptxas-sm_90 && ptxas-isa-8.7 %{ llc < %s -march=nvptx64 -mcpu=sm_90 -mattr=+ptx87 | %ptxas-verify -arch=sm_90 %}8 9define void @fence_acquire_sys() {10; SM30-LABEL: fence_acquire_sys(11; SM30: {12; SM30-EMPTY:13; SM30-EMPTY:14; SM30-NEXT: // %bb.0:15; SM30-NEXT: membar.sys;16; SM30-NEXT: ret;17;18; SM70-LABEL: fence_acquire_sys(19; SM70: {20; SM70-EMPTY:21; SM70-EMPTY:22; SM70-NEXT: // %bb.0:23; SM70-NEXT: fence.acq_rel.sys;24; SM70-NEXT: ret;25;26; SM90-LABEL: fence_acquire_sys(27; SM90: {28; SM90-EMPTY:29; SM90-EMPTY:30; SM90-NEXT: // %bb.0:31; SM90-NEXT: fence.acquire.sys;32; SM90-NEXT: ret;33 fence syncscope("") acquire34 ret void35}36 37 38define void @fence_acquire_cta() {39; SM30-LABEL: fence_acquire_cta(40; SM30: {41; SM30-EMPTY:42; SM30-EMPTY:43; SM30-NEXT: // %bb.0:44; SM30-NEXT: membar.cta;45; SM30-NEXT: ret;46;47; SM70-LABEL: fence_acquire_cta(48; SM70: {49; SM70-EMPTY:50; SM70-EMPTY:51; SM70-NEXT: // %bb.0:52; SM70-NEXT: fence.acq_rel.cta;53; SM70-NEXT: ret;54;55; SM90-LABEL: fence_acquire_cta(56; SM90: {57; SM90-EMPTY:58; SM90-EMPTY:59; SM90-NEXT: // %bb.0:60; SM90-NEXT: fence.acquire.cta;61; SM90-NEXT: ret;62 fence syncscope("block") acquire63 ret void64}65 66 67define void @fence_acquire_gpu() {68; SM30-LABEL: fence_acquire_gpu(69; SM30: {70; SM30-EMPTY:71; SM30-EMPTY:72; SM30-NEXT: // %bb.0:73; SM30-NEXT: membar.gl;74; SM30-NEXT: ret;75;76; SM70-LABEL: fence_acquire_gpu(77; SM70: {78; SM70-EMPTY:79; SM70-EMPTY:80; SM70-NEXT: // %bb.0:81; SM70-NEXT: fence.acq_rel.gpu;82; SM70-NEXT: ret;83;84; SM90-LABEL: fence_acquire_gpu(85; SM90: {86; SM90-EMPTY:87; SM90-EMPTY:88; SM90-NEXT: // %bb.0:89; SM90-NEXT: fence.acquire.gpu;90; SM90-NEXT: ret;91 fence syncscope("device") acquire92 ret void93}94 95 96define void @fence_release_sys() {97; SM30-LABEL: fence_release_sys(98; SM30: {99; SM30-EMPTY:100; SM30-EMPTY:101; SM30-NEXT: // %bb.0:102; SM30-NEXT: membar.sys;103; SM30-NEXT: ret;104;105; SM70-LABEL: fence_release_sys(106; SM70: {107; SM70-EMPTY:108; SM70-EMPTY:109; SM70-NEXT: // %bb.0:110; SM70-NEXT: fence.acq_rel.sys;111; SM70-NEXT: ret;112;113; SM90-LABEL: fence_release_sys(114; SM90: {115; SM90-EMPTY:116; SM90-EMPTY:117; SM90-NEXT: // %bb.0:118; SM90-NEXT: fence.release.sys;119; SM90-NEXT: ret;120 fence syncscope("") release121 ret void122}123 124 125define void @fence_release_cta() {126; SM30-LABEL: fence_release_cta(127; SM30: {128; SM30-EMPTY:129; SM30-EMPTY:130; SM30-NEXT: // %bb.0:131; SM30-NEXT: membar.cta;132; SM30-NEXT: ret;133;134; SM70-LABEL: fence_release_cta(135; SM70: {136; SM70-EMPTY:137; SM70-EMPTY:138; SM70-NEXT: // %bb.0:139; SM70-NEXT: fence.acq_rel.cta;140; SM70-NEXT: ret;141;142; SM90-LABEL: fence_release_cta(143; SM90: {144; SM90-EMPTY:145; SM90-EMPTY:146; SM90-NEXT: // %bb.0:147; SM90-NEXT: fence.release.cta;148; SM90-NEXT: ret;149 fence syncscope("block") release150 ret void151}152 153 154define void @fence_release_gpu() {155; SM30-LABEL: fence_release_gpu(156; SM30: {157; SM30-EMPTY:158; SM30-EMPTY:159; SM30-NEXT: // %bb.0:160; SM30-NEXT: membar.gl;161; SM30-NEXT: ret;162;163; SM70-LABEL: fence_release_gpu(164; SM70: {165; SM70-EMPTY:166; SM70-EMPTY:167; SM70-NEXT: // %bb.0:168; SM70-NEXT: fence.acq_rel.gpu;169; SM70-NEXT: ret;170;171; SM90-LABEL: fence_release_gpu(172; SM90: {173; SM90-EMPTY:174; SM90-EMPTY:175; SM90-NEXT: // %bb.0:176; SM90-NEXT: fence.release.gpu;177; SM90-NEXT: ret;178 fence syncscope("device") release179 ret void180}181 182 183define void @fence_acq_rel_sys() {184; SM30-LABEL: fence_acq_rel_sys(185; SM30: {186; SM30-EMPTY:187; SM30-EMPTY:188; SM30-NEXT: // %bb.0:189; SM30-NEXT: membar.sys;190; SM30-NEXT: ret;191;192; SM70-LABEL: fence_acq_rel_sys(193; SM70: {194; SM70-EMPTY:195; SM70-EMPTY:196; SM70-NEXT: // %bb.0:197; SM70-NEXT: fence.acq_rel.sys;198; SM70-NEXT: ret;199;200; SM90-LABEL: fence_acq_rel_sys(201; SM90: {202; SM90-EMPTY:203; SM90-EMPTY:204; SM90-NEXT: // %bb.0:205; SM90-NEXT: fence.acq_rel.sys;206; SM90-NEXT: ret;207 fence syncscope("") acq_rel208 ret void209}210 211 212define void @fence_acq_rel_cta() {213; SM30-LABEL: fence_acq_rel_cta(214; SM30: {215; SM30-EMPTY:216; SM30-EMPTY:217; SM30-NEXT: // %bb.0:218; SM30-NEXT: membar.cta;219; SM30-NEXT: ret;220;221; SM70-LABEL: fence_acq_rel_cta(222; SM70: {223; SM70-EMPTY:224; SM70-EMPTY:225; SM70-NEXT: // %bb.0:226; SM70-NEXT: fence.acq_rel.cta;227; SM70-NEXT: ret;228;229; SM90-LABEL: fence_acq_rel_cta(230; SM90: {231; SM90-EMPTY:232; SM90-EMPTY:233; SM90-NEXT: // %bb.0:234; SM90-NEXT: fence.acq_rel.cta;235; SM90-NEXT: ret;236 fence syncscope("block") acq_rel237 ret void238}239 240 241define void @fence_acq_rel_gpu() {242; SM30-LABEL: fence_acq_rel_gpu(243; SM30: {244; SM30-EMPTY:245; SM30-EMPTY:246; SM30-NEXT: // %bb.0:247; SM30-NEXT: membar.gl;248; SM30-NEXT: ret;249;250; SM70-LABEL: fence_acq_rel_gpu(251; SM70: {252; SM70-EMPTY:253; SM70-EMPTY:254; SM70-NEXT: // %bb.0:255; SM70-NEXT: fence.acq_rel.gpu;256; SM70-NEXT: ret;257;258; SM90-LABEL: fence_acq_rel_gpu(259; SM90: {260; SM90-EMPTY:261; SM90-EMPTY:262; SM90-NEXT: // %bb.0:263; SM90-NEXT: fence.acq_rel.gpu;264; SM90-NEXT: ret;265 fence syncscope("device") acq_rel266 ret void267}268 269 270define void @fence_seq_cst_sys() {271; SM30-LABEL: fence_seq_cst_sys(272; SM30: {273; SM30-EMPTY:274; SM30-EMPTY:275; SM30-NEXT: // %bb.0:276; SM30-NEXT: membar.sys;277; SM30-NEXT: ret;278;279; SM70-LABEL: fence_seq_cst_sys(280; SM70: {281; SM70-EMPTY:282; SM70-EMPTY:283; SM70-NEXT: // %bb.0:284; SM70-NEXT: fence.sc.sys;285; SM70-NEXT: ret;286;287; SM90-LABEL: fence_seq_cst_sys(288; SM90: {289; SM90-EMPTY:290; SM90-EMPTY:291; SM90-NEXT: // %bb.0:292; SM90-NEXT: fence.sc.sys;293; SM90-NEXT: ret;294 fence syncscope("") seq_cst295 ret void296}297 298 299define void @fence_seq_cst_cta() {300; SM30-LABEL: fence_seq_cst_cta(301; SM30: {302; SM30-EMPTY:303; SM30-EMPTY:304; SM30-NEXT: // %bb.0:305; SM30-NEXT: membar.cta;306; SM30-NEXT: ret;307;308; SM70-LABEL: fence_seq_cst_cta(309; SM70: {310; SM70-EMPTY:311; SM70-EMPTY:312; SM70-NEXT: // %bb.0:313; SM70-NEXT: fence.sc.cta;314; SM70-NEXT: ret;315;316; SM90-LABEL: fence_seq_cst_cta(317; SM90: {318; SM90-EMPTY:319; SM90-EMPTY:320; SM90-NEXT: // %bb.0:321; SM90-NEXT: fence.sc.cta;322; SM90-NEXT: ret;323 fence syncscope("block") seq_cst324 ret void325}326 327 328define void @fence_seq_cst_gpu() {329; SM30-LABEL: fence_seq_cst_gpu(330; SM30: {331; SM30-EMPTY:332; SM30-EMPTY:333; SM30-NEXT: // %bb.0:334; SM30-NEXT: membar.gl;335; SM30-NEXT: ret;336;337; SM70-LABEL: fence_seq_cst_gpu(338; SM70: {339; SM70-EMPTY:340; SM70-EMPTY:341; SM70-NEXT: // %bb.0:342; SM70-NEXT: fence.sc.gpu;343; SM70-NEXT: ret;344;345; SM90-LABEL: fence_seq_cst_gpu(346; SM90: {347; SM90-EMPTY:348; SM90-EMPTY:349; SM90-NEXT: // %bb.0:350; SM90-NEXT: fence.sc.gpu;351; SM90-NEXT: ret;352 fence syncscope("device") seq_cst353 ret void354}355 356