Skip to content

Commit 70ba119

Browse files
committed
add comments to test
1 parent ad8d389 commit 70ba119

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

llvm/test/DebugInfo/KeyInstructions/Generic/loop-unswitch.ll

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
21
; RUN: opt %s -S --passes="loop-mssa(simple-loop-unswitch<nontrivial>)" -o - \
32
; RUN: | FileCheck %s
43

@@ -27,26 +26,42 @@
2726

2827
; CHECK-LABEL: define i32 @partial_unswitch_true_successor_hoist_invariant(
2928
; CHECK-SAME: ptr [[PTR:%.*]], i32 [[N:%.*]]) !dbg [[DBG5:![0-9]+]] {
29+
30+
;; Instructions duplicated from loop.header need remapped atoms.
3031
; CHECK-NEXT: [[ENTRY:.*:]]
3132
; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i32, ptr [[PTR]], i64 1, !dbg [[DBG8:![0-9]+]]
3233
; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4, !dbg [[DBG9:![0-9]+]]
3334
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 100, !dbg [[DBG10:![0-9]+]]
3435
; CHECK-NEXT: br i1 [[TMP2]], label %[[ENTRY_SPLIT_US:.*]], label %[[ENTRY_SPLIT:.*]]
36+
37+
;; Same source location as entry's original br, with remapped atom group.
3538
; CHECK: [[ENTRY_SPLIT_US]]:
3639
; CHECK-NEXT: br label %[[LOOP_HEADER_US:.*]], !dbg [[DBG11:![0-9]+]]
40+
41+
;; Instructions duplicated from loop.header need remapped atoms.
3742
; CHECK: [[LOOP_HEADER_US]]:
3843
; CHECK-NEXT: [[IV_US:%.*]] = phi i32 [ 0, %[[ENTRY_SPLIT_US]] ], [ [[IV_NEXT_US:%.*]], %[[LOOP_LATCH_US:.*]] ], !dbg [[DBG12:![0-9]+]]
3944
; CHECK-NEXT: br label %[[NOCLOBBER_US:.*]], !dbg [[DBG13:![0-9]+]]
45+
46+
;; Instructions duplicated from noclobber need remapped atoms.
4047
; CHECK: [[NOCLOBBER_US]]:
4148
; CHECK-NEXT: br label %[[LOOP_LATCH_US]], !dbg [[DBG14:![0-9]+]]
49+
4250
; CHECK: [[LOOP_LATCH_US]]:
4351
; CHECK-NEXT: [[C_US:%.*]] = icmp ult i32 [[IV_US]], [[N]], !dbg [[DBG15:![0-9]+]]
4452
; CHECK-NEXT: [[IV_NEXT_US]] = add i32 [[IV_US]], 1, !dbg [[DBG16:![0-9]+]]
4553
; CHECK-NEXT: br i1 [[C_US]], label %[[LOOP_HEADER_US]], label %[[EXIT_SPLIT_US:.*]], !dbg [[DBG17:![0-9]+]]
54+
55+
;; Split from exit, this DILocation shouldn't have source atom info.
4656
; CHECK: [[EXIT_SPLIT_US]]:
4757
; CHECK-NEXT: br label %[[EXIT:.*]], !dbg [[DBG18:![0-9]+]]
58+
59+
;; Same source location as entry's original br, with remapped atom group.
4860
; CHECK: [[ENTRY_SPLIT]]:
4961
; CHECK-NEXT: br label %[[LOOP_HEADER:.*]], !dbg [[DBG19:![0-9]+]]
62+
63+
;; Original loop blocks - the atoms groups should be distinct from those
64+
;; on duplicated instructions in the blocks above.
5065
; CHECK: [[LOOP_HEADER]]:
5166
; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, %[[ENTRY_SPLIT]] ], [ [[IV_NEXT:%.*]], %[[LOOP_LATCH:.*]] ], !dbg [[DBG20:![0-9]+]]
5267
; CHECK-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[PTR]], i64 1, !dbg [[DBG21:![0-9]+]]
@@ -61,9 +76,14 @@
6176
; CHECK: [[LOOP_LATCH]]:
6277
; CHECK-NEXT: [[C:%.*]] = icmp ult i32 [[IV]], [[N]], !dbg [[DBG28:![0-9]+]]
6378
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1, !dbg [[DBG29:![0-9]+]]
64-
; CHECK-NEXT: br i1 [[C]], label %[[LOOP_HEADER]], label %[[EXIT_SPLIT:.*]], !dbg [[DBG30:![0-9]+]], !llvm.loop [[LOOP31:![0-9]+]]
79+
; CHECK-NEXT: br i1 [[C]], label %[[LOOP_HEADER]], label %[[EXIT_SPLIT:.*]], !dbg [[DBG30:![0-9]+]]
80+
81+
;; Split from exit, this DILocation shouldn't have source atom info.
6582
; CHECK: [[EXIT_SPLIT]]:
6683
; CHECK-NEXT: br label %[[EXIT]], !dbg [[DBG18]]
84+
85+
;; exit.split and exit.split.us take the source location from here but drop its
86+
;; source atom info.
6787
; CHECK: [[EXIT]]:
6888
; CHECK-NEXT: ret i32 10, !dbg [[DBG33:![0-9]+]]
6989

0 commit comments

Comments
 (0)