[llvm] ff37529 - GCOVProfiling: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:50:56 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:50:37-05:00
New Revision: ff375292981d054c7a45c406c31e32413015260d
URL: https://github.com/llvm/llvm-project/commit/ff375292981d054c7a45c406c31e32413015260d
DIFF: https://github.com/llvm/llvm-project/commit/ff375292981d054c7a45c406c31e32413015260d.diff
LOG: GCOVProfiling: Convert tests to opaque pointers
function-numbering.ll was a special case where the checks are for a
new function which does have unnecessary GEPs with 0 indices.
Added:
Modified:
llvm/test/Transforms/GCOVProfiling/exit-block.ll
llvm/test/Transforms/GCOVProfiling/global-ctor.ll
llvm/test/Transforms/GCOVProfiling/linezero.ll
llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/GCOVProfiling/exit-block.ll b/llvm/test/Transforms/GCOVProfiling/exit-block.ll
index 30051a45cd6da..50c4dc4665c95 100644
--- a/llvm/test/Transforms/GCOVProfiling/exit-block.ll
+++ b/llvm/test/Transforms/GCOVProfiling/exit-block.ll
@@ -20,7 +20,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @test() #0 !dbg !4 {
entry:
tail call void (...) @f() #2, !dbg !14
- %0 = load i32, i32* @A, align 4, !dbg !15
+ %0 = load i32, ptr @A, align 4, !dbg !15
%tobool = icmp eq i32 %0, 0, !dbg !15
br i1 %tobool, label %if.end, label %if.then, !dbg !15
diff --git a/llvm/test/Transforms/GCOVProfiling/global-ctor.ll b/llvm/test/Transforms/GCOVProfiling/global-ctor.ll
index 4d4a9e2f81571..ee9b914908d57 100644
--- a/llvm/test/Transforms/GCOVProfiling/global-ctor.ll
+++ b/llvm/test/Transforms/GCOVProfiling/global-ctor.ll
@@ -4,7 +4,7 @@
; RUN: opt -S -passes=insert-gcov-profiling < %s | FileCheck %s
@var = dso_local global i32 0, align 4
- at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_a.cc, i8* null }]
+ at llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_a.cc, ptr null }]
define internal void @__cxx_global_var_init() section ".text.startup" !dbg !7 {
; CHECK: define internal void @__cxx_global_var_init()
@@ -12,7 +12,7 @@ define internal void @__cxx_global_var_init() section ".text.startup" !dbg !7 {
; CHECK: call i32 @_Z3foov()
entry:
%call = call i32 @_Z3foov(), !dbg !9
- store i32 %call, i32* @var, align 4, !dbg !9
+ store i32 %call, ptr @var, align 4, !dbg !9
ret void, !dbg !9
}
diff --git a/llvm/test/Transforms/GCOVProfiling/linezero.ll b/llvm/test/Transforms/GCOVProfiling/linezero.ll
index 93a4fd451062e..8bfeabdf906a1 100644
--- a/llvm/test/Transforms/GCOVProfiling/linezero.ll
+++ b/llvm/test/Transforms/GCOVProfiling/linezero.ll
@@ -12,45 +12,45 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @_Z4testv() #0 !dbg !15 {
entry:
%retval = alloca i32, align 4
- %__range = alloca %struct.vector*, align 8
+ %__range = alloca ptr, align 8
%ref.tmp = alloca %struct.vector, align 1
%undef.agg.tmp = alloca %struct.vector, align 1
- %__begin = alloca i8*, align 8
- %__end = alloca i8*, align 8
+ %__begin = alloca ptr, align 8
+ %__end = alloca ptr, align 8
%spec = alloca i8, align 1
- call void @llvm.dbg.declare(metadata %struct.vector** %__range, metadata !27, metadata !DIExpression()), !dbg !30
+ call void @llvm.dbg.declare(metadata ptr %__range, metadata !27, metadata !DIExpression()), !dbg !30
br label %0
; <label>:0 ; preds = %entry
call void @_Z13TagFieldSpecsv(), !dbg !31
- store %struct.vector* %ref.tmp, %struct.vector** %__range, align 8, !dbg !31
- call void @llvm.dbg.declare(metadata i8** %__begin, metadata !32, metadata !DIExpression()), !dbg !30
- %1 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31
- %call = call i8* @_ZN6vector5beginEv(%struct.vector* %1), !dbg !31
- store i8* %call, i8** %__begin, align 8, !dbg !31
- call void @llvm.dbg.declare(metadata i8** %__end, metadata !33, metadata !DIExpression()), !dbg !30
- %2 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31
- %call1 = call i8* @_ZN6vector3endEv(%struct.vector* %2), !dbg !31
- store i8* %call1, i8** %__end, align 8, !dbg !31
+ store ptr %ref.tmp, ptr %__range, align 8, !dbg !31
+ call void @llvm.dbg.declare(metadata ptr %__begin, metadata !32, metadata !DIExpression()), !dbg !30
+ %1 = load ptr, ptr %__range, align 8, !dbg !31
+ %call = call ptr @_ZN6vector5beginEv(ptr %1), !dbg !31
+ store ptr %call, ptr %__begin, align 8, !dbg !31
+ call void @llvm.dbg.declare(metadata ptr %__end, metadata !33, metadata !DIExpression()), !dbg !30
+ %2 = load ptr, ptr %__range, align 8, !dbg !31
+ %call1 = call ptr @_ZN6vector3endEv(ptr %2), !dbg !31
+ store ptr %call1, ptr %__end, align 8, !dbg !31
br label %for.cond, !dbg !31
for.cond: ; preds = %for.inc, %0
- %3 = load i8*, i8** %__begin, align 8, !dbg !34
- %4 = load i8*, i8** %__end, align 8, !dbg !34
- %cmp = icmp ne i8* %3, %4, !dbg !34
+ %3 = load ptr, ptr %__begin, align 8, !dbg !34
+ %4 = load ptr, ptr %__end, align 8, !dbg !34
+ %cmp = icmp ne ptr %3, %4, !dbg !34
br i1 %cmp, label %for.body, label %for.end, !dbg !34
for.body: ; preds = %for.cond
- call void @llvm.dbg.declare(metadata i8* %spec, metadata !37, metadata !DIExpression()), !dbg !31
- %5 = load i8*, i8** %__begin, align 8, !dbg !38
- %6 = load i8, i8* %5, align 1, !dbg !38
- store i8 %6, i8* %spec, align 1, !dbg !38
+ call void @llvm.dbg.declare(metadata ptr %spec, metadata !37, metadata !DIExpression()), !dbg !31
+ %5 = load ptr, ptr %__begin, align 8, !dbg !38
+ %6 = load i8, ptr %5, align 1, !dbg !38
+ store i8 %6, ptr %spec, align 1, !dbg !38
br label %for.inc, !dbg !38
for.inc: ; preds = %for.body
- %7 = load i8*, i8** %__begin, align 8, !dbg !40
- %incdec.ptr = getelementptr inbounds i8, i8* %7, i32 1, !dbg !40
- store i8* %incdec.ptr, i8** %__begin, align 8, !dbg !40
+ %7 = load ptr, ptr %__begin, align 8, !dbg !40
+ %incdec.ptr = getelementptr inbounds i8, ptr %7, i32 1, !dbg !40
+ store ptr %incdec.ptr, ptr %__begin, align 8, !dbg !40
br label %for.cond, !dbg !40
for.end: ; preds = %for.cond
@@ -58,7 +58,7 @@ for.end: ; preds = %for.cond
unreachable, !dbg !42
return: ; No predecessors!
- %8 = load i32, i32* %retval, !dbg !44
+ %8 = load i32, ptr %retval, !dbg !44
ret i32 %8, !dbg !44
}
@@ -67,9 +67,9 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
declare void @_Z13TagFieldSpecsv() #2
-declare i8* @_ZN6vector5beginEv(%struct.vector*) #2
+declare ptr @_ZN6vector5beginEv(ptr) #2
-declare i8* @_ZN6vector3endEv(%struct.vector*) #2
+declare ptr @_ZN6vector3endEv(ptr) #2
; Function Attrs: noreturn nounwind
declare void @llvm.trap() #3
diff --git a/llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll b/llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
index b672c79d39718..7f169e2d1ebc3 100644
--- a/llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
+++ b/llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
@@ -10,33 +10,33 @@
; CHECK-NEXT: load {{.*}} @__llvm_gcov_ctr
; CHECK-NOT: load {{.*}} @__llvm_gcov_ctr
-define dso_local i32 @cannot_split(i8* nocapture readonly %p) #0 !dbg !7 {
+define dso_local i32 @cannot_split(ptr nocapture readonly %p) #0 !dbg !7 {
entry:
- %targets = alloca <2 x i8*>, align 16
- store <2 x i8*> <i8* blockaddress(@cannot_split, %indirect), i8* blockaddress(@cannot_split, %end)>, <2 x i8*>* %targets, align 16, !dbg !9
+ %targets = alloca <2 x ptr>, align 16
+ store <2 x ptr> <ptr blockaddress(@cannot_split, %indirect), ptr blockaddress(@cannot_split, %end)>, ptr %targets, align 16, !dbg !9
br label %for.cond, !dbg !14
for.cond: ; preds = %for.cond, %entry
- %p.addr.0 = phi i8* [ %p, %entry ], [ %incdec.ptr, %for.cond ]
- %0 = load i8, i8* %p.addr.0, align 1, !dbg !15
+ %p.addr.0 = phi ptr [ %p, %entry ], [ %incdec.ptr, %for.cond ]
+ %0 = load i8, ptr %p.addr.0, align 1, !dbg !15
%cmp = icmp eq i8 %0, 7, !dbg !17
- %incdec.ptr = getelementptr inbounds i8, i8* %p.addr.0, i64 1, !dbg !18
+ %incdec.ptr = getelementptr inbounds i8, ptr %p.addr.0, i64 1, !dbg !18
br i1 %cmp, label %indirect.preheader, label %for.cond, !dbg !15, !llvm.loop !19
indirect.preheader: ; preds = %for.cond
- %1 = load i8, i8* %incdec.ptr, align 1, !dbg !21
+ %1 = load i8, ptr %incdec.ptr, align 1, !dbg !21
%idxprom = sext i8 %1 to i64, !dbg !21
- %arrayidx4 = getelementptr inbounds <2 x i8*>, <2 x i8*>* %targets, i64 0, i64 %idxprom, !dbg !21
- %2 = load i8*, i8** %arrayidx4, align 8, !dbg !21
+ %arrayidx4 = getelementptr inbounds <2 x ptr>, ptr %targets, i64 0, i64 %idxprom, !dbg !21
+ %2 = load ptr, ptr %arrayidx4, align 8, !dbg !21
br label %indirect
indirect: ; preds = %indirect.preheader, %indirect
- indirectbr i8* %2, [label %indirect, label %end]
+ indirectbr ptr %2, [label %indirect, label %end]
indirect2:
; For this test we do not want critical edges split. Adding a 2nd `indirectbr`
; does the trick.
- indirectbr i8* %2, [label %indirect, label %end]
+ indirectbr ptr %2, [label %indirect, label %end]
end: ; preds = %indirect
ret i32 0, !dbg !22
More information about the llvm-commits
mailing list