brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.1 KiB · 907c346 Raw
265 lines · plain
1; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s2 3; CHECK: Entry or anchor intrinsic cannot have a convergencectrl token operand.4; CHECK-NEXT: %t04_tok2 = call token5; CHECK: Loop intrinsic must have a convergencectrl token operand.6; CHECK-NEXT: %t04_tok3 = call token7define void @basic_syntax() {8  %t04_tok1 = call token @llvm.experimental.convergence.anchor()9  %t04_tok2 = call token @llvm.experimental.convergence.anchor() [ "convergencectrl"(token %t04_tok1) ]10  %t04_tok3 = call token @llvm.experimental.convergence.loop()11  ret void12}13 14; CHECK: Convergence control tokens can only be produced by calls to the convergence control intrinsics.15; CHECK-NEXT:  %t04_tok1 = call token @produce_token()16; CHECK-NEXT:  call void @f() [ "convergencectrl"(token %t04_tok1) ]17define void @wrong_token() {18  %t04_tok1 = call token @produce_token()19  call void @f() [ "convergencectrl"(token %t04_tok1) ]20  ret void21}22 23; CHECK: The 'convergencectrl' bundle requires exactly one token use.24; CHECK-NEXT:  call void @g()25define void @multiple_tokens() {26  %t06_tok1 = call token @llvm.experimental.convergence.anchor()27  %t06_tok2 = call token @llvm.experimental.convergence.anchor()28  call void @g() [ "convergencectrl"(token %t06_tok2, token %t06_tok1) ]29  ret void30}31 32; CHECK: The 'convergencectrl' bundle can occur at most once on a call33; CHECK-NEXT:  call void @g()34define void @multiple_bundles() {35  %t07_tok1 = call token @llvm.experimental.convergence.anchor()36  %t07_tok2 = call token @llvm.experimental.convergence.anchor()37  call void @g() [ "convergencectrl"(token %t07_tok2), "convergencectrl"(token %t07_tok1) ]38  ret void39}40 41; CHECK: Cannot mix controlled and uncontrolled convergence in the same function42; CHECK-NEXT  call void @f()43define void @mixed1() {44  call void @g() ; not convergent45  %t10_tok1 = call token @llvm.experimental.convergence.anchor()46  call void @f() [ "convergencectrl"(token %t10_tok1) ]47  call void @g()48  call void @f() ; uncontrolled convergent49  ret void50}51 52; CHECK: Cannot mix controlled and uncontrolled convergence in the same function53; CHECK:  %t20_tok1 = call token @llvm.experimental.convergence.anchor()54; CHECK: Cannot mix controlled and uncontrolled convergence in the same function55; CHECK:  call void @f() [ "convergencectrl"(token %t20_tok1) ]56define void @mixed2() {57  call void @g() ; not convergent58  call void @f() ; uncontrolled convergent59  call void @g()60  %t20_tok1 = call token @llvm.experimental.convergence.anchor()61  call void @f() [ "convergencectrl"(token %t20_tok1) ]62  ret void63}64 65; CHECK: Convergence region is not well-nested.66; CHECK:   %t30_tok267define void @region_nesting1() {68  %t30_tok1 = call token @llvm.experimental.convergence.anchor()69  %t30_tok2 = call token @llvm.experimental.convergence.anchor()70  call void @f() [ "convergencectrl"(token %t30_tok1) ]71  call void @f() [ "convergencectrl"(token %t30_tok2) ]72  ret void73}74 75; CHECK: Convergence region is not well-nested.76; CHECK:   %t40_tok277define void @region_nesting2(i1 %cond) {78A:79  %t40_tok1 = call token @llvm.experimental.convergence.anchor()80  %t40_tok2 = call token @llvm.experimental.convergence.anchor()81  br i1 %cond, label %B, label %C82 83B:84  call void @f() [ "convergencectrl"(token %t40_tok1) ]85  br label %C86 87C:88  call void @f() [ "convergencectrl"(token %t40_tok2) ]89  ret void90}91 92; CHECK: Convergence token used by an instruction other than llvm.experimental.convergence.loop in a cycle that does not contain the token's definition.93; CHECK:   token %t50_tok194define void @use_in_cycle() {95A:96  %t50_tok1 = call token @llvm.experimental.convergence.anchor()97  br label %B98 99B:100  call void @f() [ "convergencectrl"(token %t50_tok1) ]101  br label %B102}103 104; CHECK: Entry intrinsic cannot be preceded by a convergent operation in the same basic block.105; CHECK:   %t60_tok1106define void @entry_at_start(i32 %x, i32 %y) convergent {107  %z = add i32 %x, %y108  call void @f()109  %t60_tok1 = call token @llvm.experimental.convergence.entry()110  ret void111}112 113; CHECK: Entry intrinsic can occur only in a convergent function.114; CHECK:   %t60_tok2115define void @entry_in_convergent(i32 %x, i32 %y) {116  %t60_tok2 = call token @llvm.experimental.convergence.entry()117  ret void118}119 120; CHECK: Loop intrinsic cannot be preceded by a convergent operation in the same basic block.121; CHECK-NEXT: %h1122; CHECK-SAME: %t60_tok3123define void @loop_at_start(i32 %x, i32 %y) convergent {124A:125  %t60_tok3 = call token @llvm.experimental.convergence.entry()126  br label %B127B:128  %z = add i32 %x, %y129  ; This is not an error130  %h2 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t60_tok3) ]131  br label %C132C:133  call void @f()134  %h1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t60_tok3) ]135  ret void136}137 138; CHECK: Entry intrinsic can occur only in the entry block.139; CHECK:   %t60_tok4140define void @entry_at_entry(i32 %x, i32 %y) convergent {141A:142  %z = add i32 %x, %y143  br label %B144B:145  %t60_tok4 = call token @llvm.experimental.convergence.entry()146  ret void147}148 149; CHECK: Two static convergence token uses in a cycle that does not contain either token's definition.150; CHECK:   token %t70_tok1151; CHECK:   token %t70_tok2152define void @multiple_hearts() {153A:154  %t70_tok1 = call token @llvm.experimental.convergence.anchor()155  %t70_tok2 = call token @llvm.experimental.convergence.anchor()156  br label %B157 158B:159  %h2 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t70_tok2) ]160  %h1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t70_tok1) ]161  br label %B162}163 164; CHECK: Two static convergence token uses in a cycle that does not contain either token's definition.165; CHECK:   token %h0166; CHECK:   token %h0167define void @multiple_hearts_nested(i1 %cond1, i1 %cond2) {168A:169  %t70_tok3 = call token @llvm.experimental.convergence.anchor()170  br label %B171 172B:173  %h0 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t70_tok3) ]174  br i1 %cond1, label %C, label %B175 176C:177  %h1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %h0) ]178  %h2 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %h0) ]179  br i1 %cond2, label %C, label %B180}181 182; CHECK: Cycle heart must dominate all blocks in the cycle.183; CHECK: %h3 = call token184; CHECK:   label %C185define void @invalid_heart_nested(i1 %cond1, i1 %cond2) {186A:187  %t70_tok4 = call token @llvm.experimental.convergence.anchor()188  br label %B189 190B:191  br i1 %cond1, label %C, label %B192 193C:194  %h3 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %t70_tok4) ]195  br i1 %cond2, label %C, label %B196}197 198; CHECK: Cycle heart must dominate all blocks in the cycle.199; CHECK: %h4 = call token200; CHECK: label %C201define void @irreducible1(i1 %cond) {202A:203  %a = call token @llvm.experimental.convergence.anchor()204  br i1 %cond, label %B, label %C205 206B:207  %b = call token @llvm.experimental.convergence.anchor()208  br i1 %cond, label %C, label %D209 210C:211  %h4 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %a) ]212  br i1 %cond, label %B, label %E213 214D:215  call void @f() [ "convergencectrl"(token %b) ]216  br i1 %cond, label %B, label %F217 218E:219  call void @f() [ "convergencectrl"(token %h4) ]220  br i1 %cond, label %C, label %F221 222F:223  call void @f() [ "convergencectrl"(token %a) ]224  ret void225}226 227; Mirror image of @irreducible1228; CHECK: Cycle heart must dominate all blocks in the cycle.229; CHECK: %h5 = call token230; CHECK: label %B231define void @irreducible2(i1 %cond) {232A:233  %a = call token @llvm.experimental.convergence.anchor()234  br i1 %cond, label %B, label %C235 236B:237  %h5 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %a) ]238  br i1 %cond, label %C, label %D239 240C:241  %c = call token @llvm.experimental.convergence.anchor()242  br i1 %cond, label %B, label %E243 244D:245  call void @f() [ "convergencectrl"(token %h5) ]246  br i1 %cond, label %B, label %F247 248E:249  call void @f() [ "convergencectrl"(token %c) ]250  br i1 %cond, label %C, label %F251 252F:253  call void @f() [ "convergencectrl"(token %a) ]254  ret void255}256 257declare token @produce_token()258 259declare void @f() convergent260declare void @g()261 262declare token @llvm.experimental.convergence.entry()263declare token @llvm.experimental.convergence.anchor()264declare token @llvm.experimental.convergence.loop()265