brintos

brintos / llvm-project-archived public Read only

0
0
Text · 785 B · 88750a1 Raw
35 lines · plain
1; RUN: opt -passes='loop(simple-loop-unswitch),verify<loops>' -S < %s | FileCheck %s2; RUN: opt -verify-memoryssa -passes='loop-mssa(simple-loop-unswitch),verify<loops>' -S < %s | FileCheck %s3 4declare void @incf()5declare void @decf()6 7define i32 @test2(i32 %c) {8; CHECK-LABEL: @test2(9  br label %loop_begin10 11; CHECK: !prof ![[MD0:[0-9]+]]12; CHECK: loop_begin:13; CHECK: !prof ![[MD1:[0-9]+]]14loop_begin:15 16  switch i32 %c, label %default [17      i32 1, label %inc18      i32 2, label %dec19  ], !prof !{!"branch_weights", i32 99, i32 1, i32 2}20 21inc:22  call void @incf()23  br label %loop_begin24 25dec:26  call void @decf()27  br label %loop_begin28 29default:30  ret i32 031}32 33; CHECK: ![[MD0]] = !{!"branch_weights", i32 99, i32 1, i32 2}34; CHECK: ![[MD1]] = !{!"branch_weights", i32 2, i32 1}35