Skip to content

Commit 0339fcc

Browse files
committed
[LICM] Extract debugify test (NFC)
Only one of the tests in the file wants to check debug info, so move it into a separate file. This allows update_test_checks to work.
1 parent 4ccfb10 commit 0339fcc

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt < %s -debugify -basic-aa -licm -S | FileCheck %s
3+
4+
%Ty = type { i32, i32 }
5+
@X2 = external global %Ty
6+
7+
; The GEP in dead1 is adding a zero offset, so the DIExpression can be kept as
8+
; a "register location".
9+
; The GEP in dead2 is adding a 4 bytes to the pointer, so the DIExpression is
10+
; turned into an "implicit location" using DW_OP_stack_value.
11+
define void @test11() {
12+
; CHECK-LABEL: @test11(
13+
; CHECK-NEXT: br label [[LOOP:%.*]], !dbg [[DBG12:![0-9]+]]
14+
; CHECK: Loop:
15+
; CHECK-NEXT: call void @llvm.dbg.value(metadata %Ty* @X2, metadata [[META9:![0-9]+]], metadata !DIExpression()), !dbg [[DBG13:![0-9]+]]
16+
; CHECK-NEXT: call void @llvm.dbg.value(metadata %Ty* @X2, metadata [[META11:![0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value)), !dbg [[DBG14:![0-9]+]]
17+
; CHECK-NEXT: br i1 false, label [[LOOP]], label [[OUT:%.*]], !dbg [[DBG15:![0-9]+]]
18+
; CHECK: Out:
19+
; CHECK-NEXT: ret void, !dbg [[DBG16:![0-9]+]]
20+
;
21+
br label %Loop
22+
Loop:
23+
%dead1 = getelementptr %Ty, %Ty* @X2, i64 0, i32 0
24+
%dead2 = getelementptr %Ty, %Ty* @X2, i64 0, i32 1
25+
br i1 false, label %Loop, label %Out
26+
Out:
27+
ret void
28+
}

llvm/test/Transforms/LICM/sinking.ll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -basic-aa -licm -S | FileCheck %s
3-
; RUN: opt < %s -debugify -basic-aa -licm -S | FileCheck %s -check-prefix=DEBUGIFY
43
; RUN: opt < %s -basic-aa -licm -S -enable-mssa-loop-dependency=true -verify-memoryssa | FileCheck %s
54

65

@@ -381,14 +380,6 @@ Loop:
381380
br i1 false, label %Loop, label %Out
382381
Out:
383382
ret void
384-
385-
; The GEP in dead1 is adding a zero offset, so the DIExpression can be kept as
386-
; a "register location".
387-
; The GEP in dead2 is adding a 4 bytes to the pointer, so the DIExpression is
388-
; turned into an "implicit location" using DW_OP_stack_value.
389-
; DEBUGIFY-LABEL: @test11(
390-
; DEBUGIFY: call void @llvm.dbg.value(metadata %Ty* @X2, metadata {{.*}}, metadata !DIExpression())
391-
; DEBUGIFY: call void @llvm.dbg.value(metadata %Ty* @X2, metadata {{.*}}, metadata !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value))
392383
}
393384

394385
@c = common global [1 x i32] zeroinitializer, align 4

0 commit comments

Comments
 (0)