@@ -312,7 +312,7 @@ exit:
312312 ret i32 %sum
313313}
314314
315- define void @unnatural_cfg1 () {
315+ define void @unnatural_cfg1 (i1 %arg ) {
316316; Test that we can handle a loop with an inner unnatural loop at the end of
317317; a function. This is a gross CFG reduced out of the single source GCC.
318318; CHECK-LABEL: unnatural_cfg1
@@ -327,7 +327,7 @@ loop.header:
327327 br label %loop.body1
328328
329329loop.body1:
330- br i1 undef , label %loop.body3 , label %loop.body2
330+ br i1 %arg , label %loop.body3 , label %loop.body2
331331
332332loop.body2:
333333 %ptr = load ptr , ptr undef , align 4
@@ -341,14 +341,14 @@ loop.body3:
341341 br i1 %comp , label %loop.body4 , label %loop.body5
342342
343343loop.body4:
344- br i1 undef , label %loop.header , label %loop.body5
344+ br i1 %arg , label %loop.header , label %loop.body5
345345
346346loop.body5:
347347 %ptr2 = load ptr , ptr undef , align 4
348348 br label %loop.body3
349349}
350350
351- define void @unnatural_cfg2 (ptr %p0 , i32 %a0 ) {
351+ define void @unnatural_cfg2 (ptr %p0 , i32 %a0 , i1 %arg ) {
352352; Test that we can handle a loop with a nested natural loop *and* an unnatural
353353; loop. This was reduced from a crash on block placement when run over
354354; single-source GCC.
@@ -372,10 +372,10 @@ loop.header:
372372
373373loop.body1:
374374 %val0 = load ptr , ptr undef , align 4
375- br i1 undef , label %loop.body2 , label %loop.inner1.begin
375+ br i1 %arg , label %loop.body2 , label %loop.inner1.begin
376376
377377loop.body2:
378- br i1 undef , label %loop.body4 , label %loop.body3
378+ br i1 %arg , label %loop.body4 , label %loop.body3
379379
380380loop.body3:
381381 %ptr1 = getelementptr inbounds i32 , ptr %val0 , i32 0
@@ -467,7 +467,7 @@ exit:
467467 ret i32 %merge
468468}
469469
470- define void @fpcmp_unanalyzable_branch (i1 %cond , double %a0 ) {
470+ define void @fpcmp_unanalyzable_branch (i1 %cond , double %a0 , i1 %arg ) {
471471; This function's CFG contains an once-unanalyzable branch (une on floating
472472; points). As now it becomes analyzable, we should get best layout in which each
473473; edge in 'entry' -> 'entry.if.then_crit_edge' -> 'if.then' -> 'if.end' is
@@ -493,7 +493,7 @@ entry.if.then_crit_edge:
493493 br label %if.then
494494
495495lor.lhs.false:
496- br i1 undef , label %if.end , label %exit
496+ br i1 %arg , label %if.end , label %exit
497497
498498exit:
499499 %cmp.i = fcmp une double 0 .000000e+00 , %a0
@@ -516,7 +516,7 @@ declare i32 @f()
516516declare i32 @g ()
517517declare i32 @h (i32 %x )
518518
519- define i32 @test_global_cfg_break_profitability () {
519+ define i32 @test_global_cfg_break_profitability (i1 %arg ) {
520520; Check that our metrics for the profitability of a CFG break are global rather
521521; than local. A successor may be very hot, but if the current block isn't, it
522522; doesn't matter. Within this test the 'then' block is slightly warmer than the
@@ -530,7 +530,7 @@ define i32 @test_global_cfg_break_profitability() {
530530; CHECK: ret
531531
532532entry:
533- br i1 undef , label %then , label %else , !prof !2
533+ br i1 %arg , label %then , label %else , !prof !2
534534
535535then:
536536 %then.result = call i32 @f ()
@@ -600,7 +600,7 @@ cleanup:
600600 unreachable
601601}
602602
603- define void @test_unnatural_cfg_backwards_inner_loop () {
603+ define void @test_unnatural_cfg_backwards_inner_loop (i1 %arg ) {
604604; Test that when we encounter an unnatural CFG structure after having formed
605605; a chain for an inner loop which happened to be laid out backwards we don't
606606; attempt to merge onto the wrong end of the inner loop just because we find it
@@ -612,7 +612,7 @@ define void @test_unnatural_cfg_backwards_inner_loop() {
612612; CHECK: %loop3
613613
614614entry:
615- br i1 undef , label %loop2a , label %body
615+ br i1 %arg , label %loop2a , label %body
616616
617617body:
618618 br label %loop2a
@@ -692,7 +692,7 @@ exit:
692692 ret void
693693}
694694
695- define void @unanalyzable_branch_to_free_block (float %x ) {
695+ define void @unanalyzable_branch_to_free_block (float %x , i1 %arg ) {
696696; Ensure that we can handle unanalyzable branches where the destination block
697697; gets selected as the best free block in the CFG.
698698;
@@ -704,7 +704,7 @@ define void @unanalyzable_branch_to_free_block(float %x) {
704704; CHECK: %exit
705705
706706entry:
707- br i1 undef , label %a , label %b
707+ br i1 %arg , label %a , label %b
708708
709709a:
710710 call i32 @f ()
0 commit comments