brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 81cb317 Raw
65 lines · plain
1; RUN: llc -mtriple=hexagon -mcpu=hexagonv5 -hexagon-eif=0 -stop-after=if-converter < %s | FileCheck %s2; Check that the edge weights are updated correctly after if-conversion.3 4; CHECK: bb.3.if{{[0-9a-zA-Z.]*}}:5; CHECK: successors: %bb.2(0x0ccccccd), %bb.1(0x73333333)6@a = external global i327@d = external global i328 9; In the following CFG, A,B,C,D will be if-converted into a single block.10; Check if the edge weights on edges to E and F are maintained correctly.11;12;    A13;   / \14;  B   C15;   \ /16;    D17;   / \18;  E   F19;20define void @test1(i8 zeroext %la, i8 zeroext %lb) {21entry:22  %cmp0 = call i1 @pred()23  br i1 %cmp0, label %if.else2, label %if.then0, !prof !124 25if.else2:26  call void @bar(i32 2)27  br label %if.end228 29if.end2:30  call void @foo(i32 2)31  br label %return32 33if.end:34  %storemerge = phi i32 [ %and, %if.else ], [ %shl, %if.then ]35  store i32 %storemerge, ptr @a, align 436  %0 = load i32, ptr @d, align 437  %cmp2 = call i1 @pred()38  br i1 %cmp2, label %if.end2, label %if.else2, !prof !239 40if.then0:41  %cmp = icmp eq i8 %la, %lb42  br i1 %cmp, label %if.then, label %if.else, !prof !143 44if.then:45  %conv1 = zext i8 %la to i3246  %shl = shl nuw nsw i32 %conv1, 1647  br label %if.end48 49if.else:50  %and8 = and i8 %lb, %la51  %and = zext i8 %and8 to i3252  br label %if.end53 54return:55  call void @foo(i32 2)56  ret void57}58 59declare void @foo(i32)60declare void @bar(i32)61declare i1 @pred()62 63!1 = !{!"branch_weights", i32 80, i32 20}64!2 = !{!"branch_weights", i32 10, i32 90}65