• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -simple-loop-unswitch -S | FileCheck %s
2; RUN: opt < %s -simple-loop-unswitch -enable-mssa-loop-dependency=true -verify-memoryssa -S | FileCheck %s
3
4; This test checks if unswitched condition preserve make.implicit metadata.
5define i32 @test(i1 %cond) {
6; CHECK-LABEL: @test(
7entry:
8  br label %loop_begin
9; CHECK-NEXT:  entry:
10; CHECK-NEXT:    br i1 %{{.*}}, label %entry.split, label %loop_exit, !make.implicit !0
11;
12; CHECK:       entry.split:
13; CHECK-NEXT:    br label %loop_begin
14
15loop_begin:
16  br i1 %cond, label %continue, label %loop_exit, !make.implicit !0
17; CHECK:       loop_begin:
18; CHECK-NEXT:    br label %continue
19
20continue:
21  call void @some_func()
22  br label %loop_begin
23; CHECK:       continue:
24; CHECK-NEXT:    call
25; CHECK-NEXT:    br label %loop_begin
26
27loop_exit:
28  ret i32 0
29; CHECK:       loop_exit:
30; CHECK-NEXT:    ret
31}
32
33declare void @some_func()
34
35!0 = !{}
36