; RUN: llc < %s -o /dev/null
; PR 5942
-define i8* @foo() nounwind {
+define ptr @foo() nounwind {
entry:
- %0 = load i32, i32* undef, align 4, !dbg !0 ; <i32> [#uses=1]
- %1 = inttoptr i32 %0 to i8*, !dbg !0 ; <i8*> [#uses=1]
- ret i8* %1, !dbg !10
+ %0 = load i32, ptr undef, align 4, !dbg !0 ; <i32> [#uses=1]
+ %1 = inttoptr i32 %0 to ptr, !dbg !0 ; <ptr> [#uses=1]
+ ret ptr %1, !dbg !10
}
define void @foo() {
entry:
- call void @llvm.dbg.declare(metadata i32* undef, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
ret void
}
define void @Foo(i32 %a, i32 %b) {
entry:
- call void @llvm.dbg.declare(metadata i32* null, metadata !1, metadata !DIExpression()), !dbg !DILocation(scope: !6)
+ call void @llvm.dbg.declare(metadata ptr null, metadata !1, metadata !DIExpression()), !dbg !DILocation(scope: !6)
ret void
}
!llvm.dbg.cu = !{!2}
define i32 @_Z3barv() nounwind ssp !dbg !3 {
entry:
- %retval = alloca i32 ; <i32*> [#uses=2]
- %0 = alloca i32 ; <i32*> [#uses=2]
- %s1 = alloca %struct.S ; <%struct.S*> [#uses=1]
+ %retval = alloca i32 ; <ptr> [#uses=2]
+ %0 = alloca i32 ; <ptr> [#uses=2]
+ %s1 = alloca %struct.S ; <ptr> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.declare(metadata %struct.S* %s1, metadata !0, metadata !DIExpression()), !dbg !16
- %1 = call i32 @_ZN1S3fooEv(%struct.S* %s1) nounwind, !dbg !17 ; <i32> [#uses=1]
- store i32 %1, i32* %0, align 4, !dbg !17
- %2 = load i32, i32* %0, align 4, !dbg !17 ; <i32> [#uses=1]
- store i32 %2, i32* %retval, align 4, !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %s1, metadata !0, metadata !DIExpression()), !dbg !16
+ %1 = call i32 @_ZN1S3fooEv(ptr %s1) nounwind, !dbg !17 ; <i32> [#uses=1]
+ store i32 %1, ptr %0, align 4, !dbg !17
+ %2 = load i32, ptr %0, align 4, !dbg !17 ; <i32> [#uses=1]
+ store i32 %2, ptr %retval, align 4, !dbg !17
br label %return, !dbg !17
return: ; preds = %entry
- %retval1 = load i32, i32* %retval, !dbg !17 ; <i32> [#uses=1]
+ %retval1 = load i32, ptr %retval, !dbg !17 ; <i32> [#uses=1]
ret i32 %retval1, !dbg !16
}
-define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 !dbg !12 {
+define linkonce_odr i32 @_ZN1S3fooEv(ptr %this) nounwind ssp align 2 !dbg !12 {
entry:
- %this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1]
- %retval = alloca i32 ; <i32*> [#uses=1]
+ %this_addr = alloca ptr ; <ptr> [#uses=1]
+ %retval = alloca i32 ; <ptr> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !21
- store %struct.S* %this, %struct.S** %this_addr
+ call void @llvm.dbg.declare(metadata ptr %this_addr, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !21
+ store ptr %this, ptr %this_addr
br label %return, !dbg !21
return: ; preds = %entry
- %retval1 = load i32, i32* %retval, !dbg !21 ; <i32> [#uses=1]
+ %retval1 = load i32, ptr %retval, !dbg !21 ; <i32> [#uses=1]
ret i32 %retval1, !dbg !22
}
define i32 @main() ssp !dbg !2 {
entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=3]
- %b = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
- store i32 0, i32* %retval
- call void @llvm.dbg.declare(metadata %class.A* %b, metadata !0, metadata !DIExpression()), !dbg !14
- %call = call i32 @_ZN1B2fnEv(%class.A* %b), !dbg !15 ; <i32> [#uses=1]
- store i32 %call, i32* %retval, !dbg !15
- %0 = load i32, i32* %retval, !dbg !16 ; <i32> [#uses=1]
+ %retval = alloca i32, align 4 ; <ptr> [#uses=3]
+ %b = alloca %class.A, align 1 ; <ptr> [#uses=1]
+ store i32 0, ptr %retval
+ call void @llvm.dbg.declare(metadata ptr %b, metadata !0, metadata !DIExpression()), !dbg !14
+ %call = call i32 @_ZN1B2fnEv(ptr %b), !dbg !15 ; <i32> [#uses=1]
+ store i32 %call, ptr %retval, !dbg !15
+ %0 = load i32, ptr %retval, !dbg !16 ; <i32> [#uses=1]
ret i32 %0, !dbg !16
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
-define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 !dbg !10 {
+define linkonce_odr i32 @_ZN1B2fnEv(ptr %this) ssp align 2 !dbg !10 {
entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
- %a = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
- %i = alloca i32, align 4 ; <i32*> [#uses=2]
- store %class.A* %this, %class.A** %this.addr
- call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
- %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
- call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !DIExpression()), !dbg !27
- call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !DIExpression()), !dbg !29
- %call = call i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %a), !dbg !30 ; <i32> [#uses=1]
- store i32 %call, i32* %i, !dbg !30
- %tmp = load i32, i32* %i, !dbg !31 ; <i32> [#uses=1]
- store i32 %tmp, i32* %retval, !dbg !31
- %0 = load i32, i32* %retval, !dbg !32 ; <i32> [#uses=1]
+ %retval = alloca i32, align 4 ; <ptr> [#uses=2]
+ %this.addr = alloca ptr, align 8 ; <ptr> [#uses=2]
+ %a = alloca %class.A, align 1 ; <ptr> [#uses=1]
+ %i = alloca i32, align 4 ; <ptr> [#uses=2]
+ store ptr %this, ptr %this.addr
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
+ %this1 = load ptr, ptr %this.addr ; <ptr> [#uses=0]
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !19, metadata !DIExpression()), !dbg !27
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !28, metadata !DIExpression()), !dbg !29
+ %call = call i32 @_ZZN1B2fnEvEN1A3fooEv(ptr %a), !dbg !30 ; <i32> [#uses=1]
+ store i32 %call, ptr %i, !dbg !30
+ %tmp = load i32, ptr %i, !dbg !31 ; <i32> [#uses=1]
+ store i32 %tmp, ptr %retval, !dbg !31
+ %0 = load i32, ptr %retval, !dbg !32 ; <i32> [#uses=1]
ret i32 %0, !dbg !32
}
-define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 !dbg !23 {
+define internal i32 @_ZZN1B2fnEvEN1A3fooEv(ptr %this) ssp align 2 !dbg !23 {
entry:
- %retval = alloca i32, align 4 ; <i32*> [#uses=2]
- %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
- store %class.A* %this, %class.A** %this.addr
- call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression(DW_OP_deref)), !dbg !34
- %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
- store i32 42, i32* %retval, !dbg !35
- %0 = load i32, i32* %retval, !dbg !35 ; <i32> [#uses=1]
+ %retval = alloca i32, align 4 ; <ptr> [#uses=2]
+ %this.addr = alloca ptr, align 8 ; <ptr> [#uses=2]
+ store ptr %this, ptr %this.addr
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !33, metadata !DIExpression(DW_OP_deref)), !dbg !34
+ %this1 = load ptr, ptr %this.addr ; <ptr> [#uses=0]
+ store i32 42, ptr %retval, !dbg !35
+ %0 = load i32, ptr %retval, !dbg !35 ; <i32> [#uses=1]
ret i32 %0, !dbg !35
}
define i32 @foo() nounwind ssp !dbg !1 {
entry:
- %retval = alloca i32 ; <i32*> [#uses=2]
- %0 = alloca i32 ; <i32*> [#uses=2]
+ %retval = alloca i32 ; <ptr> [#uses=2]
+ %0 = alloca i32 ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- store i32 42, i32* %0, align 4, !dbg !0
- %1 = load i32, i32* %0, align 4, !dbg !0 ; <i32> [#uses=1]
- store i32 %1, i32* %retval, align 4, !dbg !0
+ store i32 42, ptr %0, align 4, !dbg !0
+ %1 = load i32, ptr %0, align 4, !dbg !0 ; <i32> [#uses=1]
+ store i32 %1, ptr %retval, align 4, !dbg !0
br label %return, !dbg !0
return: ; preds = %entry
- %retval1 = load i32, i32* %retval, !dbg !0 ; <i32> [#uses=1]
+ %retval1 = load i32, ptr %retval, !dbg !0 ; <i32> [#uses=1]
ret i32 %retval1, !dbg !7
}
; Function Attrs: nounwind
define void @_Z4fun4v() #0 !dbg !12 {
entry:
- %this.addr.i.i = alloca %struct.C*, align 8, !dbg !21
- %this.addr.i = alloca %struct.C*, align 8, !dbg !22
+ %this.addr.i.i = alloca ptr, align 8, !dbg !21
+ %this.addr.i = alloca ptr, align 8, !dbg !22
%agg.tmp.ensured = alloca %struct.C, align 1
%cleanup.cond = alloca i1
- %0 = load i8, i8* @b, align 1, !dbg !24
+ %0 = load i8, ptr @b, align 1, !dbg !24
%tobool = trunc i8 %0 to i1, !dbg !24
- store i1 false, i1* %cleanup.cond
+ store i1 false, ptr %cleanup.cond
br i1 %tobool, label %land.rhs, label %land.end, !dbg !24
land.rhs: ; preds = %entry
- store i1 true, i1* %cleanup.cond, !dbg !25
+ store i1 true, ptr %cleanup.cond, !dbg !25
br label %land.end
land.end: ; preds = %land.rhs, %entry
%1 = phi i1 [ false, %entry ], [ true, %land.rhs ]
- %cleanup.is_active = load i1, i1* %cleanup.cond, !dbg !27
+ %cleanup.is_active = load i1, ptr %cleanup.cond, !dbg !27
br i1 %cleanup.is_active, label %cleanup.action, label %cleanup.done, !dbg !27
cleanup.action: ; preds = %land.end
- store %struct.C* %agg.tmp.ensured, %struct.C** %this.addr.i, align 8, !dbg !22
- call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !129, metadata !DIExpression()), !dbg !31
- %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !22
- store %struct.C* %this1.i, %struct.C** %this.addr.i.i, align 8, !dbg !21
- call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i.i, metadata !132, metadata !DIExpression()), !dbg !33
- %this1.i.i = load %struct.C*, %struct.C** %this.addr.i.i, !dbg !21
+ store ptr %agg.tmp.ensured, ptr %this.addr.i, align 8, !dbg !22
+ call void @llvm.dbg.declare(metadata ptr %this.addr.i, metadata !129, metadata !DIExpression()), !dbg !31
+ %this1.i = load ptr, ptr %this.addr.i, !dbg !22
+ store ptr %this1.i, ptr %this.addr.i.i, align 8, !dbg !21
+ call void @llvm.dbg.declare(metadata ptr %this.addr.i.i, metadata !132, metadata !DIExpression()), !dbg !33
+ %this1.i.i = load ptr, ptr %this.addr.i.i, !dbg !21
br label %cleanup.done, !dbg !22
cleanup.done: ; preds = %cleanup.action, %land.end
}
; Function Attrs: alwaysinline nounwind
-define void @_ZN1CD1Ev(%struct.C* %this) unnamed_addr #1 align 2 !dbg !17 {
+define void @_ZN1CD1Ev(ptr %this) unnamed_addr #1 align 2 !dbg !17 {
entry:
- %this.addr.i = alloca %struct.C*, align 8, !dbg !37
- %this.addr = alloca %struct.C*, align 8
- store %struct.C* %this, %struct.C** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !29, metadata !DIExpression()), !dbg !38
- %this1 = load %struct.C*, %struct.C** %this.addr
- store %struct.C* %this1, %struct.C** %this.addr.i, align 8, !dbg !37
- call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !232, metadata !DIExpression()), !dbg !39
- %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !37
+ %this.addr.i = alloca ptr, align 8, !dbg !37
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !29, metadata !DIExpression()), !dbg !38
+ %this1 = load ptr, ptr %this.addr
+ store ptr %this1, ptr %this.addr.i, align 8, !dbg !37
+ call void @llvm.dbg.declare(metadata ptr %this.addr.i, metadata !232, metadata !DIExpression()), !dbg !39
+ %this1.i = load ptr, ptr %this.addr.i, !dbg !37
ret void, !dbg !37
}
; Function Attrs: alwaysinline nounwind
-define void @_ZN1CD2Ev(%struct.C* %this) unnamed_addr #1 align 2 !dbg !16 {
+define void @_ZN1CD2Ev(ptr %this) unnamed_addr #1 align 2 !dbg !16 {
entry:
- %this.addr = alloca %struct.C*, align 8
- store %struct.C* %this, %struct.C** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !32, metadata !DIExpression()), !dbg !40
- %this1 = load %struct.C*, %struct.C** %this.addr
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !32, metadata !DIExpression()), !dbg !40
+ %this1 = load ptr, ptr %this.addr
ret void, !dbg !41
}
; CHECK-LABEL: @f
define dso_local void @f() !dbg !10 {
entry:
- %0 = load i32, i32* @a, align 4, !dbg !17
+ %0 = load i32, ptr @a, align 4, !dbg !17
%tobool1 = icmp eq i32 %0, 0, !dbg !18
br i1 %tobool1, label %for.end, label %for.inc.lr.ph, !dbg !18
br i1 %tobool, label %for.cond.for.end_crit_edge, label %for.inc, !dbg !18, !llvm.loop !21
for.cond.for.end_crit_edge: ; preds = %for.inc
- store i32 %inc, i32* @a, align 4, !dbg !17
+ store i32 %inc, ptr @a, align 4, !dbg !17
br label %for.end, !dbg !18
for.end: ; preds = %entry, %for.cond.for.end_crit_edge
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_address_class (0x00000001)
-@y = global i8* null, align 8, !dbg !0
+@y = global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!5}
!llvm.module.flags = !{!8, !9}
entry:
%retval = alloca i32, align 4
%a = alloca [0 x i32], align 4
- store i32 0, i32* %retval
- call void @llvm.dbg.declare(metadata [0 x i32]* %a, metadata !6, metadata !DIExpression()), !dbg !11
+ store i32 0, ptr %retval
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !6, metadata !DIExpression()), !dbg !11
ret i32 0, !dbg !12
}
define void @_Z4funcv() #0 !dbg !17 {
entry:
%b = alloca i32, align 4
- call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !22), !dbg !23
- store i32 0, i32* %b, align 4, !dbg !23
+ call void @llvm.dbg.declare(metadata ptr %b, metadata !20, metadata !22), !dbg !23
+ store i32 0, ptr %b, align 4, !dbg !23
ret void, !dbg !24
}
; Verify that the call still has a debug location after GVN.
; CHECK: %call = tail call i32 @f2(i32 1) #{{[0-9]}}, !dbg
%call = tail call i32 @f2(i32 1) #0, !dbg !15
- store i32 %call, i32* @a, align 4, !dbg !15, !tbaa !24
- tail call void @llvm.dbg.value(metadata i32* @a, metadata !22, metadata !28) #0, !dbg !29
- %0 = load i32, i32* @b, align 4, !dbg !29, !tbaa !24
+ store i32 %call, ptr @a, align 4, !dbg !15, !tbaa !24
+ tail call void @llvm.dbg.value(metadata ptr @a, metadata !22, metadata !28) #0, !dbg !29
+ %0 = load i32, ptr @b, align 4, !dbg !29, !tbaa !24
%tobool.i = icmp eq i32 %0, 0, !dbg !29
br i1 %tobool.i, label %if.end.i, label %land.lhs.true.i.thread, !dbg !30
land.lhs.true.i.thread: ; preds = %entry
- store i32 1, i32* @a, align 4, !dbg !32, !tbaa !24
+ store i32 1, ptr @a, align 4, !dbg !32, !tbaa !24
br label %if.then.3.i, !dbg !33
; This instruction has no debug location -- in this
; particular case it was removed by a bug in SimplifyCFG.
if.end.i: ; preds = %entry
- %.pr = load i32, i32* @a, align 4
+ %.pr = load i32, ptr @a, align 4
; GVN is supposed to replace the load of %.pr with a direct reference to %call.
; CHECK: %tobool2.i = icmp eq i32 %call, 0, !dbg
%tobool2.i = icmp eq i32 %.pr, 0, !dbg !34
br i1 %tobool2.i, label %f1.exit, label %if.then.3.i, !dbg !34
if.then.3.i: ; preds = %if.end.i, %land.lhs.true.i.thread
- %call.i = tail call i32 bitcast (i32 (...)* @f4 to i32 ()*)() #0, !dbg !35
+ %call.i = tail call i32 @f4() #0, !dbg !35
br label %f1.exit, !dbg !35
f1.exit: ; preds = %if.then.3.i, %if.end.i
entry:
%a.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- store i32 %b, i32* %b.addr, align 4
- %0 = load i32, i32* %a.addr, align 4, !dbg !10
+ store i32 %a, ptr %a.addr, align 4
+ store i32 %b, ptr %b.addr, align 4
+ %0 = load i32, ptr %a.addr, align 4, !dbg !10
%tobool = icmp ne i32 %0, 0, !dbg !10
br i1 %tobool, label %land.rhs, label %land.end, !dbg !11
land.rhs: ; preds = %entry
- %1 = load i32, i32* %b.addr, align 4, !dbg !12
+ %1 = load i32, ptr %b.addr, align 4, !dbg !12
%tobool1 = icmp ne i32 %1, 0, !dbg !12
br label %land.end
define i32 @foo(i32 %a) #0 section "__TEXT,__foo" !dbg !4 {
entry:
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !13, metadata !DIExpression()), !dbg !14
- %0 = load i32, i32* %a.addr, align 4, !dbg !15
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !13, metadata !DIExpression()), !dbg !14
+ %0 = load i32, ptr %a.addr, align 4, !dbg !15
%add = add nsw i32 %0, 5, !dbg !15
ret i32 %add, !dbg !15
}
define i32 @bar(i32 %a) #0 !dbg !9 {
entry:
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !16, metadata !DIExpression()), !dbg !17
- %0 = load i32, i32* %a.addr, align 4, !dbg !18
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !16, metadata !DIExpression()), !dbg !17
+ %0 = load i32, ptr %a.addr, align 4, !dbg !18
%add = add nsw i32 %0, 5, !dbg !18
ret i32 %add, !dbg !18
}
; Function Attrs: nounwind ssp
define i32 @bar() #1 !dbg !8 {
entry:
- %0 = load i32, i32* @i, align 4, !dbg !11
+ %0 = load i32, ptr @i, align 4, !dbg !11
tail call void @llvm.dbg.value(metadata i32 %0, metadata !13, metadata !24), !dbg !25
tail call void @llvm.dbg.declare(metadata !5, metadata !18, metadata !24), !dbg !26
%1 = mul nsw i32 %0, %0, !dbg !27
- store i32 %1, i32* @i, align 4, !dbg !11
+ store i32 %1, ptr @i, align 4, !dbg !11
ret i32 %1, !dbg !28
}
; return x;
; }
-declare void @llvm.lifetime.start(i64, i8* nocapture)
-declare void @llvm.lifetime.end(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, ptr nocapture)
+declare void @llvm.lifetime.end(i64, ptr nocapture)
-declare void @foo(i32*)
+declare void @foo(ptr)
; CHECK: DW_AT_name {{.*}}"f0"
; CHECK: DW_AT_name {{.*}}"e"
tail call void @llvm.dbg.value(metadata i32 %c, metadata !11, metadata !DIExpression()), !dbg !29
tail call void @llvm.dbg.value(metadata i32 %d, metadata !12, metadata !DIExpression()), !dbg !30
tail call void @llvm.dbg.value(metadata i32 %e, metadata !13, metadata !DIExpression()), !dbg !31
- %0 = bitcast i32* %x to i8*, !dbg !32
- call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !32
+ call void @llvm.lifetime.start(i64 4, ptr %x) #4, !dbg !32
%add = add nsw i32 %b, %a, !dbg !33
%add1 = add nsw i32 %add, %c, !dbg !34
%add2 = add nsw i32 %add1, %d, !dbg !35
%add3 = add nsw i32 %add2, %e, !dbg !36
tail call void @llvm.dbg.value(metadata i32 %add3, metadata !14, metadata !DIExpression()), !dbg !37
- store i32 %add3, i32* %x, align 4, !dbg !37, !tbaa !38
- tail call void @llvm.dbg.value(metadata i32* %x, metadata !14, metadata !26), !dbg !37
- call void @foo(i32* nonnull %x) #4, !dbg !42
- call void @llvm.dbg.value(metadata i32* %x, metadata !14, metadata !26), !dbg !37
- %1 = load i32, i32* %x, align 4, !dbg !43, !tbaa !38
- call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !44
- ret i32 %1, !dbg !45
+ store i32 %add3, ptr %x, align 4, !dbg !37, !tbaa !38
+ tail call void @llvm.dbg.value(metadata ptr %x, metadata !14, metadata !26), !dbg !37
+ call void @foo(ptr nonnull %x) #4, !dbg !42
+ call void @llvm.dbg.value(metadata ptr %x, metadata !14, metadata !26), !dbg !37
+ %0 = load i32, ptr %x, align 4, !dbg !43, !tbaa !38
+ call void @llvm.lifetime.end(i64 4, ptr %x) #4, !dbg !44
+ ret i32 %0, !dbg !45
}
tail call void @llvm.dbg.value(metadata i32 %c, metadata !19, metadata !DIExpression()), !dbg !48
tail call void @llvm.dbg.value(metadata i32 %d, metadata !20, metadata !DIExpression()), !dbg !49
tail call void @llvm.dbg.value(metadata i32 %e, metadata !21, metadata !DIExpression()), !dbg !50
- %0 = bitcast i32* %x to i8*, !dbg !51
- call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !51
+ call void @llvm.lifetime.start(i64 4, ptr %x) #4, !dbg !51
%add = add nsw i32 %b, %a, !dbg !52
%add1 = add nsw i32 %add, %c, !dbg !53
%add2 = add nsw i32 %add1, %d, !dbg !54
%add3 = add nsw i32 %add2, %e, !dbg !55
tail call void @llvm.dbg.value(metadata i32 %add3, metadata !22, metadata !DIExpression()), !dbg !56
- store i32 %add3, i32* %x, align 16, !dbg !56, !tbaa !38
- tail call void @llvm.dbg.value(metadata i32* %x, metadata !22, metadata !26), !dbg !56
- call void @foo(i32* nonnull %x) #4, !dbg !57
- call void @llvm.dbg.value(metadata i32* %x, metadata !22, metadata !26), !dbg !56
- %1 = load i32, i32* %x, align 16, !dbg !58, !tbaa !38
- call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !59
- ret i32 %1, !dbg !60
+ store i32 %add3, ptr %x, align 16, !dbg !56, !tbaa !38
+ tail call void @llvm.dbg.value(metadata ptr %x, metadata !22, metadata !26), !dbg !56
+ call void @foo(ptr nonnull %x) #4, !dbg !57
+ call void @llvm.dbg.value(metadata ptr %x, metadata !22, metadata !26), !dbg !56
+ %0 = load i32, ptr %x, align 16, !dbg !58, !tbaa !38
+ call void @llvm.lifetime.end(i64 4, ptr %x) #4, !dbg !59
+ ret i32 %0, !dbg !60
}
declare void @llvm.dbg.value(metadata, metadata, metadata)
declare void @llvm.dbg.declare(metadata, metadata, metadata)
-declare void @foo(i32*)
+declare void @foo(ptr)
; void foo(int *);
;
%a.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%c = alloca i32, align 16
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !16), !dbg !17
- store i32 %b, i32* %b.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !18, metadata !16), !dbg !19
- call void @llvm.dbg.declare(metadata i32* %c, metadata !20, metadata !16), !dbg !21
- %0 = load i32, i32* %a.addr, align 4, !dbg !22
- %1 = load i32, i32* %b.addr, align 4, !dbg !23
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !15, metadata !16), !dbg !17
+ store i32 %b, ptr %b.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !18, metadata !16), !dbg !19
+ call void @llvm.dbg.declare(metadata ptr %c, metadata !20, metadata !16), !dbg !21
+ %0 = load i32, ptr %a.addr, align 4, !dbg !22
+ %1 = load i32, ptr %b.addr, align 4, !dbg !23
%add = add nsw i32 %0, %1, !dbg !24
- store i32 %add, i32* %c, align 16, !dbg !21
- call void @foo(i32* %c), !dbg !25
- %2 = load i32, i32* %c, align 16, !dbg !26
+ store i32 %add, ptr %c, align 16, !dbg !21
+ call void @foo(ptr %c), !dbg !25
+ %2 = load i32, ptr %c, align 16, !dbg !26
ret i32 %2, !dbg !27
}
; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_breg23 S7_64+32)
; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "c")
-define i32* @f3(i32 signext %a, i32 signext %b) !dbg !8 {
+define ptr @f3(i32 signext %a, i32 signext %b) !dbg !8 {
entry:
%a.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%c = alloca i32, align 16
- %w = alloca i32*, align 4
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !28, metadata !16), !dbg !29
- store i32 %b, i32* %b.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !30, metadata !16), !dbg !31
- call void @llvm.dbg.declare(metadata i32* %c, metadata !32, metadata !16), !dbg !33
- %0 = load i32, i32* %a.addr, align 4, !dbg !34
- %1 = load i32, i32* %b.addr, align 4, !dbg !35
+ %w = alloca ptr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !28, metadata !16), !dbg !29
+ store i32 %b, ptr %b.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !30, metadata !16), !dbg !31
+ call void @llvm.dbg.declare(metadata ptr %c, metadata !32, metadata !16), !dbg !33
+ %0 = load i32, ptr %a.addr, align 4, !dbg !34
+ %1 = load i32, ptr %b.addr, align 4, !dbg !35
%add = add nsw i32 %0, %1, !dbg !36
- store i32 %add, i32* %c, align 16, !dbg !33
- call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !DIExpression(DW_OP_deref)), !dbg !38
- %2 = load i32, i32* %c, align 16, !dbg !39
+ store i32 %add, ptr %c, align 16, !dbg !33
+ call void @llvm.dbg.declare(metadata ptr %w, metadata !37, metadata !DIExpression(DW_OP_deref)), !dbg !38
+ %2 = load i32, ptr %c, align 16, !dbg !39
%3 = alloca i8, i32 %2, !dbg !40
- %4 = bitcast i8* %3 to i32*, !dbg !40
- store i32* %4, i32** %w, align 4, !dbg !38
- call void @foo(i32* %c), !dbg !41
- %5 = load i32*, i32** %w, align 4, !dbg !42
- ret i32* %5, !dbg !43
+ store ptr %3, ptr %w, align 4, !dbg !38
+ call void @foo(ptr %c), !dbg !41
+ %4 = load ptr, ptr %w, align 4, !dbg !42
+ ret ptr %4, !dbg !43
}
!llvm.dbg.cu = !{!0}
; EXCEPT-TABLE-PIC: 0000 ff9b1501 0c012d00 002d133f 013f2a00 ......-..-.?.?*.
; EXCEPT-TABLE-PIC: 0010 00010000 00000000 ........
-@_ZTIi = external constant i8*
+@_ZTIi = external constant ptr
-define dso_local i32 @main() local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define dso_local i32 @main() local_unnamed_addr personality ptr @__gxx_personality_v0 {
entry:
- %exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind
- %0 = bitcast i8* %exception.i to i32*
- store i32 5, i32* %0, align 16
- invoke void @__cxa_throw(i8* %exception.i, i8* bitcast (i8** @_ZTIi to i8*), i8* null) noreturn
+ %exception.i = tail call ptr @__cxa_allocate_exception(i32 4) nounwind
+ store i32 5, ptr %exception.i, align 16
+ invoke void @__cxa_throw(ptr %exception.i, ptr @_ZTIi, ptr null) noreturn
to label %.noexc unwind label %return
.noexc:
unreachable
return:
- %1 = landingpad { i8*, i32 }
- catch i8* null
- %2 = extractvalue { i8*, i32 } %1, 0
- %3 = tail call i8* @__cxa_begin_catch(i8* %2) nounwind
+ %0 = landingpad { ptr, i32 }
+ catch ptr null
+ %1 = extractvalue { ptr, i32 } %0, 0
+ %2 = tail call ptr @__cxa_begin_catch(ptr %1) nounwind
tail call void @__cxa_end_catch()
ret i32 0
}
declare i32 @__gxx_personality_v0(...)
-declare i8* @__cxa_begin_catch(i8*) local_unnamed_addr
+declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr
declare void @__cxa_end_catch() local_unnamed_addr
-declare i8* @__cxa_allocate_exception(i32) local_unnamed_addr
+declare ptr @__cxa_allocate_exception(i32) local_unnamed_addr
-declare void @__cxa_throw(i8*, i8*, i8*) local_unnamed_addr
+declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr
; PIC-FP: .loc 1 2 3 prologue_end
; PIC-FP: lw $[[R2:[0-9]+]], %got($.str)($[[R1]])
- %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)), !dbg !10
+ %call = call i32 (ptr, ...) @printf(ptr @.str), !dbg !10
ret void, !dbg !11
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
attributes #0 = { nounwind }
define i32 @b(i32 %c) #0 !dbg !5 {
entry:
%c.addr = alloca i32, align 4
- store i32 %c, i32* %c.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !13, metadata !DIExpression()), !dbg !14
- %0 = load i32, i32* %c.addr, align 4, !dbg !14
+ store i32 %c, ptr %c.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %c.addr, metadata !13, metadata !DIExpression()), !dbg !14
+ %0 = load i32, ptr %c.addr, align 4, !dbg !14
%add = add nsw i32 %0, 1, !dbg !14
ret i32 %add, !dbg !14
}
define i32 @a(i32 %b) #0 {
entry:
%b.addr = alloca i32, align 4
- store i32 %b, i32* %b.addr, align 4
- %0 = load i32, i32* %b.addr, align 4
+ store i32 %b, ptr %b.addr, align 4
+ %0 = load i32, ptr %b.addr, align 4
%add = add nsw i32 %0, 1
ret i32 %add
}
define i32 @d(i32 %e) #0 !dbg !10 {
entry:
%e.addr = alloca i32, align 4
- store i32 %e, i32* %e.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %e.addr, metadata !15, metadata !DIExpression()), !dbg !16
- %0 = load i32, i32* %e.addr, align 4, !dbg !16
+ store i32 %e, ptr %e.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %e.addr, metadata !15, metadata !DIExpression()), !dbg !16
+ %0 = load i32, ptr %e.addr, align 4, !dbg !16
%add = add nsw i32 %0, 1, !dbg !16
ret i32 %add, !dbg !16
}
define void @use_dbg_declare() #0 !dbg !7 {
entry:
%o = alloca %struct.Foo, align 4
- call void @llvm.dbg.declare(metadata %struct.Foo* %o, metadata !10, metadata !15), !dbg !16
- call void @escape_foo(%struct.Foo* %o), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %o, metadata !10, metadata !15), !dbg !16
+ call void @escape_foo(ptr %o), !dbg !17
ret void, !dbg !18
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-declare void @escape_foo(%struct.Foo*)
+declare void @escape_foo(ptr)
attributes #0 = { noinline nounwind uwtable }
attributes #1 = { nounwind readnone speculatable }
call void @llvm.dbg.value(metadata i32 7, metadata !10, metadata !DIExpression()), !dbg !18
%call1 = call i32 (...) @f1() #3, !dbg !19
call void @llvm.dbg.value(metadata i32 %call1, metadata !10, metadata !DIExpression()), !dbg !19
- store i32 %call1, i32* %i, align 4, !dbg !19, !tbaa !20
- call void @llvm.dbg.value(metadata i32* %i, metadata !10, metadata !DIExpression(DW_OP_deref)), !dbg !24
- call void @f2(i32* %i) #3, !dbg !24
+ store i32 %call1, ptr %i, align 4, !dbg !19, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %i, metadata !10, metadata !DIExpression(DW_OP_deref)), !dbg !24
+ call void @f2(ptr %i) #3, !dbg !24
ret i32 0, !dbg !25
}
declare i32 @f1(...)
-declare void @f2(i32*)
+declare void @f2(ptr)
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
@GLOBAL = addrspace(1) externally_initialized global i32 0, align 4, !dbg !0
@SHARED = addrspace(3) externally_initialized global i32 undef, align 4, !dbg !6
-define void @test(float, float*, float*, i32) !dbg !17 {
+define void @test(float, ptr, ptr, i32) !dbg !17 {
%5 = alloca float, align 4
- %6 = alloca float*, align 8
- %7 = alloca float*, align 8
+ %6 = alloca ptr, align 8
+ %7 = alloca ptr, align 8
%8 = alloca i32, align 4
- store float %0, float* %5, align 4
- call void @llvm.dbg.declare(metadata float* %5, metadata !22, metadata !DIExpression()), !dbg !23
- store float* %1, float** %6, align 8
- call void @llvm.dbg.declare(metadata float** %6, metadata !24, metadata !DIExpression()), !dbg !25
- store float* %2, float** %7, align 8
- call void @llvm.dbg.declare(metadata float** %7, metadata !26, metadata !DIExpression()), !dbg !27
- store i32 %3, i32* %8, align 4
- call void @llvm.dbg.declare(metadata i32* %8, metadata !28, metadata !DIExpression()), !dbg !29
- %9 = load float, float* %5, align 4, !dbg !30
- %10 = load float*, float** %6, align 8, !dbg !31
- %11 = load i32, i32* %8, align 4, !dbg !32
+ store float %0, ptr %5, align 4
+ call void @llvm.dbg.declare(metadata ptr %5, metadata !22, metadata !DIExpression()), !dbg !23
+ store ptr %1, ptr %6, align 8
+ call void @llvm.dbg.declare(metadata ptr %6, metadata !24, metadata !DIExpression()), !dbg !25
+ store ptr %2, ptr %7, align 8
+ call void @llvm.dbg.declare(metadata ptr %7, metadata !26, metadata !DIExpression()), !dbg !27
+ store i32 %3, ptr %8, align 4
+ call void @llvm.dbg.declare(metadata ptr %8, metadata !28, metadata !DIExpression()), !dbg !29
+ %9 = load float, ptr %5, align 4, !dbg !30
+ %10 = load ptr, ptr %6, align 8, !dbg !31
+ %11 = load i32, ptr %8, align 4, !dbg !32
%12 = sext i32 %11 to i64, !dbg !31
- %13 = getelementptr inbounds float, float* %10, i64 %12, !dbg !31
- %14 = load float, float* %13, align 4, !dbg !31
+ %13 = getelementptr inbounds float, ptr %10, i64 %12, !dbg !31
+ %14 = load float, ptr %13, align 4, !dbg !31
%15 = fmul contract float %9, %14, !dbg !33
- %16 = load float*, float** %7, align 8, !dbg !34
- %17 = load i32, i32* %8, align 4, !dbg !35
+ %16 = load ptr, ptr %7, align 8, !dbg !34
+ %17 = load i32, ptr %8, align 4, !dbg !35
%18 = sext i32 %17 to i64, !dbg !34
- %19 = getelementptr inbounds float, float* %16, i64 %18, !dbg !34
- store float %15, float* %19, align 4, !dbg !36
- store i32 0, i32* addrspacecast (i32 addrspace(1)* @GLOBAL to i32*), align 4, !dbg !37
- store i32 0, i32* addrspacecast (i32 addrspace(3)* @SHARED to i32*), align 4, !dbg !38
+ %19 = getelementptr inbounds float, ptr %16, i64 %18, !dbg !34
+ store float %15, ptr %19, align 4, !dbg !36
+ store i32 0, ptr addrspacecast (ptr addrspace(1) @GLOBAL to ptr), align 4, !dbg !37
+ store i32 0, ptr addrspacecast (ptr addrspace(3) @SHARED to ptr), align 4, !dbg !38
ret void, !dbg !39
}
!7 = distinct !DIGlobalVariable(name: "SHARED", scope: !2, file: !8, line: 4, type: !9, isLocal: false, isDefinition: true)
!8 = !DIFile(filename: "test.cu", directory: "/tmp")
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!10 = !{void (float, float*, float*, i32)* @test, !"kernel", i32 1}
+!10 = !{ptr @test, !"kernel", i32 1}
!11 = !{i32 2, !"Dwarf Version", i32 2}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64-nvidia-cuda | %ptxas-verify %}
; // Bitcode in this test case is reduced version of compiled code below:
-;__device__ inline void res(float x, float y, float *res) { *res = x + y; }
+;__device__ inline void res(float x, float y, ptr res) { *res = x + y; }
;
-;__global__ void saxpy(int n, float a, float *x, float *y) {
+;__global__ void saxpy(int n, float a, ptr x, ptr y) {
; int i = blockIdx.x * blockDim.x + threadIdx.x;
; if (i < n)
; res(a * x[i], y[i], &y[i]);
; CHECK: }
; Function Attrs: nounwind
-define void @_Z5saxpyifPfS_(i32 %n, float %a, float* nocapture readonly %x, float* nocapture %y) local_unnamed_addr #0 !dbg !566 {
+define void @_Z5saxpyifPfS_(i32 %n, float %a, ptr nocapture readonly %x, ptr nocapture %y) local_unnamed_addr #0 !dbg !566 {
entry:
call void @llvm.dbg.value(metadata i32 %n, metadata !570, metadata !DIExpression()), !dbg !575
call void @llvm.dbg.value(metadata float %a, metadata !571, metadata !DIExpression()), !dbg !576
- call void @llvm.dbg.value(metadata float* %x, metadata !572, metadata !DIExpression()), !dbg !577
- call void @llvm.dbg.value(metadata float* %y, metadata !573, metadata !DIExpression()), !dbg !578
+ call void @llvm.dbg.value(metadata ptr %x, metadata !572, metadata !DIExpression()), !dbg !577
+ call void @llvm.dbg.value(metadata ptr %y, metadata !573, metadata !DIExpression()), !dbg !578
%0 = tail call i32 @llvm.nvvm.read.ptx.sreg.ctaid.x() #3, !dbg !579, !range !616
%1 = tail call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() #3, !dbg !617, !range !661
%mul = mul nuw nsw i32 %1, %0, !dbg !662
if.then: ; preds = %entry
%3 = zext i32 %add to i64, !dbg !697
- %arrayidx = getelementptr inbounds float, float* %x, i64 %3, !dbg !697
- %4 = load float, float* %arrayidx, align 4, !dbg !697, !tbaa !698
+ %arrayidx = getelementptr inbounds float, ptr %x, i64 %3, !dbg !697
+ %4 = load float, ptr %arrayidx, align 4, !dbg !697, !tbaa !698
%mul3 = fmul contract float %4, %a, !dbg !702
- %arrayidx5 = getelementptr inbounds float, float* %y, i64 %3, !dbg !703
- %5 = load float, float* %arrayidx5, align 4, !dbg !703, !tbaa !698
+ %arrayidx5 = getelementptr inbounds float, ptr %y, i64 %3, !dbg !703
+ %5 = load float, ptr %arrayidx5, align 4, !dbg !703, !tbaa !698
call void @llvm.dbg.value(metadata float %mul3, metadata !704, metadata !DIExpression()), !dbg !711
call void @llvm.dbg.value(metadata float %5, metadata !709, metadata !DIExpression()), !dbg !713
- call void @llvm.dbg.value(metadata float* %arrayidx5, metadata !710, metadata !DIExpression()), !dbg !714
+ call void @llvm.dbg.value(metadata ptr %arrayidx5, metadata !710, metadata !DIExpression()), !dbg !714
%add.i = fadd contract float %mul3, %5, !dbg !715
- store float %add.i, float* %arrayidx5, align 4, !dbg !716, !tbaa !698
+ store float %add.i, ptr %arrayidx5, align 4, !dbg !716, !tbaa !698
br label %if.end, !dbg !717
if.end: ; preds = %if.then, %entry
!552 = !DISubprogram(name: "tgammaf", linkageName: "_ZL7tgammaff", scope: !444, file: !444, line: 1592, type: !13, isLocal: true, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true)
!553 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !554, file: !445, line: 459)
!554 = !DISubprogram(name: "truncf", linkageName: "_ZL6truncff", scope: !462, file: !462, line: 662, type: !13, isLocal: true, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true)
-!555 = !{void (i32, float, float*, float*)* @_Z5saxpyifPfS_, !"kernel", i32 1}
+!555 = !{ptr @_Z5saxpyifPfS_, !"kernel", i32 1}
!556 = !{null, !"align", i32 8}
!557 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}
!558 = !{null, !"align", i32 16}
; CHECK: .param .b64 _ZN1A3fooEv_param_0
; CHECK: )
-%struct.A = type { i32 (...)**, i32 }
+%struct.A = type { ptr, i32 }
; CHECK: .visible .func (.param .b32 func_retval0) _Z3bari(
; CHECK: {
define i32 @_Z3bari(i32 %b) #0 !dbg !4 {
entry:
%b.addr = alloca i32, align 4
- store i32 %b, i32* %b.addr, align 4
+ store i32 %b, ptr %b.addr, align 4
call void @llvm.dbg.value(metadata i32 0, metadata !21, metadata !DIExpression()), !dbg !22
- %0 = load i32, i32* %b.addr, align 4, !dbg !23
+ %0 = load i32, ptr %b.addr, align 4, !dbg !23
call void @llvm.dbg.value(metadata i32 1, metadata !21, metadata !DIExpression()), !dbg !22
%add = add nsw i32 %0, 4, !dbg !23
ret i32 %add, !dbg !23
; CHECK: ret;
; CHECK: }
-define void @_Z3baz1A(%struct.A* %a) #2 !dbg !14 {
+define void @_Z3baz1A(ptr %a) #2 !dbg !14 {
entry:
%z = alloca i32, align 4
- call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !24, metadata !DIExpression(DW_OP_deref)), !dbg !25
- call void @llvm.dbg.declare(metadata i32* %z, metadata !26, metadata !DIExpression()), !dbg !27
- store i32 2, i32* %z, align 4, !dbg !27
- %var = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 1, !dbg !28
- %0 = load i32, i32* %var, align 4, !dbg !28
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !24, metadata !DIExpression(DW_OP_deref)), !dbg !25
+ call void @llvm.dbg.declare(metadata ptr %z, metadata !26, metadata !DIExpression()), !dbg !27
+ store i32 2, ptr %z, align 4, !dbg !27
+ %var = getelementptr inbounds %struct.A, ptr %a, i32 0, i32 1, !dbg !28
+ %0 = load i32, ptr %var, align 4, !dbg !28
%cmp = icmp sgt i32 %0, 2, !dbg !28
br i1 %cmp, label %if.then, label %if.end, !dbg !28
if.then: ; preds = %entry
- %1 = load i32, i32* %z, align 4, !dbg !30
+ %1 = load i32, ptr %z, align 4, !dbg !30
%inc = add nsw i32 %1, 1, !dbg !30
- store i32 %inc, i32* %z, align 4, !dbg !30
+ store i32 %inc, ptr %z, align 4, !dbg !30
br label %if.end, !dbg !30
if.end: ; preds = %if.then, %entry
- %call = call signext i8 @_ZN1A3fooEv(%struct.A* %a), !dbg !31
+ %call = call signext i8 @_ZN1A3fooEv(ptr %a), !dbg !31
%conv = sext i8 %call to i32, !dbg !31
%cmp1 = icmp eq i32 %conv, 97, !dbg !31
br i1 %cmp1, label %if.then2, label %if.end4, !dbg !31
if.then2: ; preds = %if.end
- %2 = load i32, i32* %z, align 4, !dbg !33
+ %2 = load i32, ptr %z, align 4, !dbg !33
%inc3 = add nsw i32 %2, 1, !dbg !33
- store i32 %inc3, i32* %z, align 4, !dbg !33
+ store i32 %inc3, ptr %z, align 4, !dbg !33
br label %if.end4, !dbg !33
if.end4: ; preds = %if.then2, %if.end
; CHECK-DAG: .file [[CU1]] "/llvm_cmake_gcc{{/|\\\\}}debug-loc-offset1.cc"
; CHECK-DAG: .file [[CU2]] "/llvm_cmake_gcc{{/|\\\\}}debug-loc-offset2.cc"
-declare signext i8 @_ZN1A3fooEv(%struct.A*) #2
+declare signext i8 @_ZN1A3fooEv(ptr) #2
attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
define i32 @main() #0 !dbg !8 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0, !dbg !12
}
; Function Attrs: noinline nounwind optnone uwtable mustprogress
define dso_local signext i32 @_Z3foov() !dbg !17 {
entry:
- %0 = load i32, i32* @_ZL3var, align 16, !dbg !21
+ %0 = load i32, ptr @_ZL3var, align 16, !dbg !21
ret i32 %0, !dbg !22
}
define dso_local i32 @main() #0 !dbg !7 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0, !dbg !11
}
define i32 @foo(i32 signext %value) {
entry:
%value.addr = alloca i32, align 4
- store i32 %value, i32* %value.addr, align 4
- %0 = load i32, i32* %value.addr, align 4
+ store i32 %value, ptr %value.addr, align 4
+ %0 = load i32, ptr %value.addr, align 4
ret i32 %0
}
%result = alloca i32, align 4
%v = alloca i32, align 4
%call = call i32 @init()
- store i32 %call, i32* %v, align 4
- %0 = load i32, i32* %v, align 4
+ store i32 %call, ptr %v, align 4
+ %0 = load i32, ptr %v, align 4
%call1 = call i32 @foo(i32 signext %0)
- store i32 %call1, i32* %result, align 4
- %1 = load i32, i32* %result, align 4
+ store i32 %call1, ptr %result, align 4
+ %1 = load i32, ptr %result, align 4
ret i32 %1
}
define i32 @foo(i32 signext %value) !dbg !12 {
entry:
%value.addr = alloca i32, align 4
- store i32 %value, i32* %value.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %value.addr, metadata !15, metadata !DIExpression()), !dbg !16
- %0 = load i32, i32* %value.addr, align 4, !dbg !17
+ store i32 %value, ptr %value.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %value.addr, metadata !15, metadata !DIExpression()), !dbg !16
+ %0 = load i32, ptr %value.addr, align 4, !dbg !17
ret i32 %0, !dbg !18
}
entry:
%result = alloca i32, align 4
%v = alloca i32, align 4
- call void @llvm.dbg.declare(metadata i32* %result, metadata !20, metadata !DIExpression()), !dbg !21
- call void @llvm.dbg.declare(metadata i32* %v, metadata !22, metadata !DIExpression()), !dbg !23
+ call void @llvm.dbg.declare(metadata ptr %result, metadata !20, metadata !DIExpression()), !dbg !21
+ call void @llvm.dbg.declare(metadata ptr %v, metadata !22, metadata !DIExpression()), !dbg !23
%call = call i32 @init(), !dbg !24
- store i32 %call, i32* %v, align 4, !dbg !23
- %0 = load i32, i32* %v, align 4, !dbg !25
+ store i32 %call, ptr %v, align 4, !dbg !23
+ %0 = load i32, ptr %v, align 4, !dbg !25
%call1 = call i32 @foo(i32 signext %0), !dbg !26
- store i32 %call1, i32* %result, align 4, !dbg !27
- %1 = load i32, i32* %result, align 4, !dbg !28
+ store i32 %call1, ptr %result, align 4, !dbg !27
+ %1 = load i32, ptr %result, align 4, !dbg !28
ret i32 %1, !dbg !29
}
define signext i32 @foo(fp128 %p) #0 !dbg !12 {
entry:
call void @llvm.dbg.value(metadata fp128 %p, metadata !17, metadata !DIExpression()), !dbg !18
- store volatile fp128 %p, fp128* @global, align 16, !dbg !19
+ store volatile fp128 %p, ptr @global, align 16, !dbg !19
tail call void @clobber(), !dbg !20
ret i32 123, !dbg !21
}
define signext i32 @main() #0 !dbg !4 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval
- %call = call signext i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0)), !dbg !12
+ store i32 0, ptr %retval
+ %call = call signext i32 (ptr, ...) @printf(ptr @.str), !dbg !12
ret i32 0, !dbg !13
}
-declare signext i32 @printf(i8*, ...) #1
+declare signext i32 @printf(ptr, ...) #1
attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
declare void @bar()
-define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i64 @foo(i64 %lhs, i64 %rhs) personality ptr @__gxx_personality_v0 {
invoke void @bar() to label %end unwind label %clean
end:
ret i64 0
clean:
- %tst = landingpad { i8*, i32 } cleanup
+ %tst = landingpad { ptr, i32 } cleanup
ret i64 42
}
@.str = private unnamed_addr constant [13 x i8] c"Total is %d\0A\00", align 2
-declare void @populate_array(i32*, i32) nounwind
+declare void @populate_array(ptr, i32) nounwind
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
-declare i32 @sum_array(i32*, i32) nounwind
+declare i32 @sum_array(ptr, i32) nounwind
define i32 @main() nounwind !dbg !14 {
entry:
%retval = alloca i32, align 4
%main_arr = alloca [100 x i32], align 4
%val = alloca i32, align 4
- store volatile i32 0, i32* %retval
- call void @llvm.dbg.declare(metadata [100 x i32]* %main_arr, metadata !17, metadata !DIExpression()), !dbg !22
- call void @llvm.dbg.declare(metadata i32* %val, metadata !23, metadata !DIExpression()), !dbg !24
- %arraydecay = getelementptr inbounds [100 x i32], [100 x i32]* %main_arr, i32 0, i32 0, !dbg !25
- call void @populate_array(i32* %arraydecay, i32 100), !dbg !25
- %arraydecay1 = getelementptr inbounds [100 x i32], [100 x i32]* %main_arr, i32 0, i32 0, !dbg !26
- %call = call i32 @sum_array(i32* %arraydecay1, i32 100), !dbg !26
- store i32 %call, i32* %val, align 4, !dbg !26
- %0 = load i32, i32* %val, align 4, !dbg !27
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 %0), !dbg !27
+ store volatile i32 0, ptr %retval
+ call void @llvm.dbg.declare(metadata ptr %main_arr, metadata !17, metadata !DIExpression()), !dbg !22
+ call void @llvm.dbg.declare(metadata ptr %val, metadata !23, metadata !DIExpression()), !dbg !24
+ call void @populate_array(ptr %main_arr, i32 100), !dbg !25
+ %call = call i32 @sum_array(ptr %main_arr, i32 100), !dbg !26
+ store i32 %call, ptr %val, align 4, !dbg !26
+ %0 = load i32, ptr %val, align 4, !dbg !27
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %0), !dbg !27
ret i32 0, !dbg !28
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!30}
;; WebAssembly does not currently support DW_TAG_GNU_call_site for stackified
;; registers. This just checks if the test runs without crashing.
-define i32 @call_indirect(i32 (i32, i32)* %callee) !dbg !11 {
+define i32 @call_indirect(ptr %callee) !dbg !11 {
%1 = call i32 %callee(i32 3, i32 5), !dbg !12
ret i32 %1, !dbg !13
}
define internal zeroext i8 @0(i32, i8 zeroext) !dbg !15 !type !20 {
%3 = alloca i32, align 4
%4 = alloca i8, align 1
- store i32 %0, i32* %3, align 4
- call void @llvm.dbg.declare(metadata i32* %3, metadata !21, metadata !22), !dbg !23
- store i8 %1, i8* %4, align 1
- call void @llvm.dbg.declare(metadata i8* %4, metadata !24, metadata !22), !dbg !25
- %5 = load i8, i8* %4, align 1, !dbg !26
+ store i32 %0, ptr %3, align 4
+ call void @llvm.dbg.declare(metadata ptr %3, metadata !21, metadata !22), !dbg !23
+ store i8 %1, ptr %4, align 1
+ call void @llvm.dbg.declare(metadata ptr %4, metadata !24, metadata !22), !dbg !25
+ %5 = load i8, ptr %4, align 1, !dbg !26
%6 = zext i8 %5 to i32, !dbg !26
- %7 = load i32, i32* %3, align 4, !dbg !27
+ %7 = load i32, ptr %3, align 4, !dbg !27
%8 = urem i32 %7, 15, !dbg !28
- %9 = getelementptr inbounds [15 x i8], [15 x i8]* @key, i32 0, i32 %8, !dbg !29
- %10 = load i8, i8* %9, align 1, !dbg !29
+ %9 = getelementptr inbounds [15 x i8], ptr @key, i32 0, i32 %8, !dbg !29
+ %10 = load i8, ptr %9, align 1, !dbg !29
%11 = zext i8 %10 to i32, !dbg !29
%12 = xor i32 %6, %11, !dbg !30
%13 = trunc i32 %12 to i8, !dbg !31
%t = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
- store i32 %n, i32* %n.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %n.addr, metadata !11, metadata !DIExpression()), !dbg !12
- call void @llvm.dbg.declare(metadata i32* %i, metadata !13, metadata !DIExpression()), !dbg !14
- call void @llvm.dbg.declare(metadata i32* %t, metadata !15, metadata !DIExpression()), !dbg !16
- call void @llvm.dbg.declare(metadata i32* %a, metadata !17, metadata !DIExpression()), !dbg !18
- store i32 0, i32* %a, align 4, !dbg !18
- call void @llvm.dbg.declare(metadata i32* %b, metadata !19, metadata !DIExpression()), !dbg !20
- store i32 1, i32* %b, align 4, !dbg !20
- store i32 0, i32* %i, align 4, !dbg !21
+ store i32 %n, ptr %n.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %n.addr, metadata !11, metadata !DIExpression()), !dbg !12
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !13, metadata !DIExpression()), !dbg !14
+ call void @llvm.dbg.declare(metadata ptr %t, metadata !15, metadata !DIExpression()), !dbg !16
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !17, metadata !DIExpression()), !dbg !18
+ store i32 0, ptr %a, align 4, !dbg !18
+ call void @llvm.dbg.declare(metadata ptr %b, metadata !19, metadata !DIExpression()), !dbg !20
+ store i32 1, ptr %b, align 4, !dbg !20
+ store i32 0, ptr %i, align 4, !dbg !21
br label %for.cond, !dbg !23
for.cond: ; preds = %for.inc, %entry
- %0 = load i32, i32* %i, align 4, !dbg !24
- %1 = load i32, i32* %n.addr, align 4, !dbg !26
+ %0 = load i32, ptr %i, align 4, !dbg !24
+ %1 = load i32, ptr %n.addr, align 4, !dbg !26
%cmp = icmp slt i32 %0, %1, !dbg !27
br i1 %cmp, label %for.body, label %for.end, !dbg !28
for.body: ; preds = %for.cond
- %2 = load i32, i32* %a, align 4, !dbg !29
- %3 = load i32, i32* %b, align 4, !dbg !31
+ %2 = load i32, ptr %a, align 4, !dbg !29
+ %3 = load i32, ptr %b, align 4, !dbg !31
%add = add nsw i32 %2, %3, !dbg !32
- store i32 %add, i32* %t, align 4, !dbg !33
- %4 = load i32, i32* %b, align 4, !dbg !34
- store i32 %4, i32* %a, align 4, !dbg !35
- %5 = load i32, i32* %t, align 4, !dbg !36
- store i32 %5, i32* %b, align 4, !dbg !37
+ store i32 %add, ptr %t, align 4, !dbg !33
+ %4 = load i32, ptr %b, align 4, !dbg !34
+ store i32 %4, ptr %a, align 4, !dbg !35
+ %5 = load i32, ptr %t, align 4, !dbg !36
+ store i32 %5, ptr %b, align 4, !dbg !37
br label %for.inc, !dbg !38
for.inc: ; preds = %for.body
- %6 = load i32, i32* %i, align 4, !dbg !39
+ %6 = load i32, ptr %i, align 4, !dbg !39
%inc = add nsw i32 %6, 1, !dbg !39
- store i32 %inc, i32* %i, align 4, !dbg !39
+ store i32 %inc, ptr %i, align 4, !dbg !39
br label %for.cond, !dbg !40, !llvm.loop !41
for.end: ; preds = %for.cond
- %7 = load i32, i32* %b, align 4, !dbg !43
+ %7 = load i32, ptr %b, align 4, !dbg !43
ret i32 %7, !dbg !44
}
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
- %0 = bitcast i32* %a to i8*, !dbg !18
call void @llvm.dbg.value(metadata i32 0, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 0, i32* %a, align 4, !dbg !19, !tbaa !20
- %1 = bitcast i32* %b to i8*, !dbg !18
- store i32 1, i32* %b, align 4, !dbg !24, !tbaa !20
+ store i32 0, ptr %a, align 4, !dbg !19, !tbaa !20
+ store i32 1, ptr %b, align 4, !dbg !24, !tbaa !20
%cmp4 = icmp sgt i32 %n, 0, !dbg !26
br i1 %cmp4, label %for.body.preheader, label %for.end, !dbg !29
for.body.preheader: ; preds = %entry
call void @llvm.dbg.value(metadata i32 0, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 1, i32* %a, align 4, !dbg !30, !tbaa !20
- call void @llvm.dbg.value(metadata i32* %a, metadata !15, metadata !DIExpression()), !dbg !19
- call void @swap(i32* nonnull %a, i32* nonnull %b) #5, !dbg !32
- %2 = load i32, i32* %b, align 4, !dbg !33, !tbaa !20
+ store i32 1, ptr %a, align 4, !dbg !30, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %a, metadata !15, metadata !DIExpression()), !dbg !19
+ call void @swap(ptr nonnull %a, ptr nonnull %b) #5, !dbg !32
+ %0 = load i32, ptr %b, align 4, !dbg !33, !tbaa !20
%exitcond9 = icmp eq i32 %n, 1, !dbg !26
br i1 %exitcond9, label %for.end, label %for.body.for.body_crit_edge, !dbg !29, !llvm.loop !34
for.body.for.body_crit_edge: ; preds = %for.body.preheader, %for.body.for.body_crit_edge
- %3 = phi i32 [ %4, %for.body.for.body_crit_edge ], [ %2, %for.body.preheader ]
+ %1 = phi i32 [ %2, %for.body.for.body_crit_edge ], [ %0, %for.body.preheader ]
%inc10 = phi i32 [ %inc, %for.body.for.body_crit_edge ], [ 1, %for.body.preheader ]
- %.pre = load i32, i32* %a, align 4, !dbg !30, !tbaa !20
+ %.pre = load i32, ptr %a, align 4, !dbg !30, !tbaa !20
call void @llvm.dbg.value(metadata i32 %.pre, metadata !15, metadata !DIExpression()), !dbg !19
- %add = add nsw i32 %.pre, %3, !dbg !30
+ %add = add nsw i32 %.pre, %1, !dbg !30
call void @llvm.dbg.value(metadata i32 %add, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 %add, i32* %a, align 4, !dbg !30, !tbaa !20
- call void @llvm.dbg.value(metadata i32* %a, metadata !15, metadata !DIExpression()), !dbg !19
- call void @swap(i32* nonnull %a, i32* nonnull %b) #5, !dbg !32
+ store i32 %add, ptr %a, align 4, !dbg !30, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %a, metadata !15, metadata !DIExpression()), !dbg !19
+ call void @swap(ptr nonnull %a, ptr nonnull %b) #5, !dbg !32
%inc = add nuw nsw i32 %inc10, 1, !dbg !36
- %4 = load i32, i32* %b, align 4, !dbg !33, !tbaa !20
+ %2 = load i32, ptr %b, align 4, !dbg !33, !tbaa !20
%exitcond = icmp eq i32 %inc, %n, !dbg !26
br i1 %exitcond, label %for.end, label %for.body.for.body_crit_edge, !dbg !29, !llvm.loop !34
for.end: ; preds = %for.body.for.body_crit_edge, %for.body.preheader, %entry
- %.lcssa = phi i32 [ 1, %entry ], [ %2, %for.body.preheader ], [ %4, %for.body.for.body_crit_edge ]
+ %.lcssa = phi i32 [ 1, %entry ], [ %0, %for.body.preheader ], [ %2, %for.body.for.body_crit_edge ]
ret i32 %.lcssa, !dbg !38
}
-declare void @swap(i32*, i32*) local_unnamed_addr #2
+declare void @swap(ptr, ptr) local_unnamed_addr #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.dbg.value(metadata i32 %n, metadata !12, metadata !DIExpression()), !dbg !17
- %0 = bitcast i32* %a to i8*, !dbg !18
call void @llvm.dbg.value(metadata i32 0, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 0, i32* %a, align 4, !dbg !19, !tbaa !20
- %1 = bitcast i32* %b to i8*, !dbg !18
+ store i32 0, ptr %a, align 4, !dbg !19, !tbaa !20
call void @llvm.dbg.value(metadata i32 1, metadata !16, metadata !DIExpression()), !dbg !24
- store i32 1, i32* %b, align 4, !dbg !24, !tbaa !20
+ store i32 1, ptr %b, align 4, !dbg !24, !tbaa !20
call void @llvm.dbg.value(metadata i32 0, metadata !13, metadata !DIExpression()), !dbg !25
%cmp4 = icmp sgt i32 %n, 0, !dbg !26
call void @llvm.dbg.value(metadata i32 1, metadata !16, metadata !DIExpression()), !dbg !24
call void @llvm.dbg.value(metadata i32 0, metadata !13, metadata !DIExpression()), !dbg !25
call void @llvm.dbg.value(metadata i32 0, metadata !15, metadata !DIExpression()), !dbg !19
call void @llvm.dbg.value(metadata i32 1, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 1, i32* %a, align 4, !dbg !30, !tbaa !20
- call void @llvm.dbg.value(metadata i32* %a, metadata !15, metadata !DIExpression()), !dbg !19
- call void @llvm.dbg.value(metadata i32* %b, metadata !16, metadata !DIExpression()), !dbg !24
- call void @swap(i32* nonnull %a, i32* nonnull %b) #5, !dbg !32
+ store i32 1, ptr %a, align 4, !dbg !30, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %a, metadata !15, metadata !DIExpression()), !dbg !19
+ call void @llvm.dbg.value(metadata ptr %b, metadata !16, metadata !DIExpression()), !dbg !24
+ call void @swap(ptr nonnull %a, ptr nonnull %b) #5, !dbg !32
call void @llvm.dbg.value(metadata i32 1, metadata !13, metadata !DIExpression()), !dbg !25
- %2 = load i32, i32* %b, align 4, !dbg !33, !tbaa !20
- call void @llvm.dbg.value(metadata i32 %2, metadata !16, metadata !DIExpression()), !dbg !24
+ %0 = load i32, ptr %b, align 4, !dbg !33, !tbaa !20
+ call void @llvm.dbg.value(metadata i32 %0, metadata !16, metadata !DIExpression()), !dbg !24
%exitcond9 = icmp eq i32 %n, 1, !dbg !26
br i1 %exitcond9, label %for.end, label %for.body.for.body_crit_edge, !dbg !29, !llvm.loop !34
for.body.for.body_crit_edge: ; preds = %for.body.preheader, %for.body.for.body_crit_edge
- %3 = phi i32 [ %4, %for.body.for.body_crit_edge ], [ %2, %for.body.preheader ]
+ %1 = phi i32 [ %2, %for.body.for.body_crit_edge ], [ %0, %for.body.preheader ]
%inc10 = phi i32 [ %inc, %for.body.for.body_crit_edge ], [ 1, %for.body.preheader ]
- %.pre = load i32, i32* %a, align 4, !dbg !30, !tbaa !20
+ %.pre = load i32, ptr %a, align 4, !dbg !30, !tbaa !20
call void @llvm.dbg.value(metadata i32 %inc10, metadata !13, metadata !DIExpression()), !dbg !25
call void @llvm.dbg.value(metadata i32 %.pre, metadata !15, metadata !DIExpression()), !dbg !19
- %add = add nsw i32 %.pre, %3, !dbg !30
+ %add = add nsw i32 %.pre, %1, !dbg !30
call void @llvm.dbg.value(metadata i32 %add, metadata !15, metadata !DIExpression()), !dbg !19
- store i32 %add, i32* %a, align 4, !dbg !30, !tbaa !20
- call void @llvm.dbg.value(metadata i32* %a, metadata !15, metadata !DIExpression()), !dbg !19
- call void @llvm.dbg.value(metadata i32* %b, metadata !16, metadata !DIExpression()), !dbg !24
- call void @swap(i32* nonnull %a, i32* nonnull %b) #5, !dbg !32
+ store i32 %add, ptr %a, align 4, !dbg !30, !tbaa !20
+ call void @llvm.dbg.value(metadata ptr %a, metadata !15, metadata !DIExpression()), !dbg !19
+ call void @llvm.dbg.value(metadata ptr %b, metadata !16, metadata !DIExpression()), !dbg !24
+ call void @swap(ptr nonnull %a, ptr nonnull %b) #5, !dbg !32
%inc = add nuw nsw i32 %inc10, 1, !dbg !36
call void @llvm.dbg.value(metadata i32 %inc, metadata !13, metadata !DIExpression()), !dbg !25
- %4 = load i32, i32* %b, align 4, !dbg !33, !tbaa !20
- call void @llvm.dbg.value(metadata i32 %4, metadata !16, metadata !DIExpression()), !dbg !24
+ %2 = load i32, ptr %b, align 4, !dbg !33, !tbaa !20
+ call void @llvm.dbg.value(metadata i32 %2, metadata !16, metadata !DIExpression()), !dbg !24
%exitcond = icmp eq i32 %inc, %n, !dbg !26
br i1 %exitcond, label %for.end, label %for.body.for.body_crit_edge, !dbg !29, !llvm.loop !34
for.end: ; preds = %for.body.for.body_crit_edge, %for.body.preheader, %entry
- %.lcssa = phi i32 [ 1, %entry ], [ %2, %for.body.preheader ], [ %4, %for.body.for.body_crit_edge ]
+ %.lcssa = phi i32 [ 1, %entry ], [ %0, %for.body.preheader ], [ %2, %for.body.for.body_crit_edge ]
ret i32 %.lcssa, !dbg !38
}
-declare void @swap(i32*, i32*) local_unnamed_addr #2
+declare void @swap(ptr, ptr) local_unnamed_addr #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #4
target triple = "x86_64-apple-macosx10.10.0"
-declare void @escape(i8**)
+declare void @escape(ptr)
; Function Attrs: sanitize_address
-define i8* @foo(i1 %cond) #0 !dbg !6 {
+define ptr @foo(i1 %cond) #0 !dbg !6 {
entry:
- %a1 = alloca i8*, !dbg !12
- call void @escape(i8** %a1), !dbg !13
+ %a1 = alloca ptr, !dbg !12
+ call void @escape(ptr %a1), !dbg !13
br i1 %cond, label %l1, label %l2, !dbg !14
l1: ; preds = %entry
- ret i8* null, !dbg !15
+ ret ptr null, !dbg !15
l2: ; preds = %entry
- call void @llvm.dbg.declare(metadata i8** %a1, metadata !11, metadata !DIExpression()), !dbg !16
- %p = load i8*, i8** %a1, !dbg !16
- ret i8* %p, !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %a1, metadata !11, metadata !DIExpression()), !dbg !16
+ %p = load ptr, ptr %a1, !dbg !16
+ ret ptr %p, !dbg !17
}
declare void @llvm.dbg.declare(metadata, metadata, metadata)
entry:
call void @llvm.dbg.value(metadata i32 7, metadata !11, metadata !DIExpression()), !dbg !13
tail call void @_Z2f1v(), !dbg !14
- %0 = load i8, i8* @b, align 1, !dbg !15, !tbaa !17, !range !21
+ %0 = load i8, ptr @b, align 1, !dbg !15, !tbaa !17, !range !21
%tobool.not = icmp eq i8 %0, 0, !dbg !15
br i1 %tobool.not, label %if.end, label %if.then, !dbg !22
; ranges are split correctly with sections. With basic block sections,
; the dbg value 157 (0x9d) gets split into one more range.
-define dso_local void @_ZL4ncatPcjz(i8* %0, i32 %1, ...) unnamed_addr align 32 !dbg !22 {
+define dso_local void @_ZL4ncatPcjz(ptr %0, i32 %1, ...) unnamed_addr align 32 !dbg !22 {
.critedge3:
call void @llvm.dbg.value(metadata i32 157, metadata !27, metadata !DIExpression()), !dbg !46
- call void @llvm.va_start(i8* nonnull undef), !dbg !47
+ call void @llvm.va_start(ptr nonnull undef), !dbg !47
br label %2
2: ; preds = %2, %.critedge3
br label %2
}
-declare void @llvm.va_start(i8*)
+declare void @llvm.va_start(ptr)
declare void @llvm.dbg.value(metadata, metadata, metadata)
;; We do not have the source to reproduce this as this was IR was obtained
;; using a reducer from a failing compile.
-define dso_local void @_ZL4ncatPcjz(i8* %0, i32 %1, ...) unnamed_addr align 32 !dbg !22 {
+define dso_local void @_ZL4ncatPcjz(ptr %0, i32 %1, ...) unnamed_addr align 32 !dbg !22 {
.critedge3:
call void @llvm.dbg.value(metadata i32 157, metadata !27, metadata !DIExpression()), !dbg !46
- call void @llvm.va_start(i8* nonnull undef), !dbg !47
+ call void @llvm.va_start(ptr nonnull undef), !dbg !47
br label %2
2: ; preds = %2, %.critedge3
br label %2
}
-declare void @llvm.va_start(i8*)
+declare void @llvm.va_start(ptr)
declare void @llvm.dbg.value(metadata, metadata, metadata)
entry:
call void @llvm.dbg.value(metadata i32 7, metadata !11, metadata !DIExpression()), !dbg !13
tail call void @_Z2f1v(), !dbg !14
- %0 = load i8, i8* @b, align 1, !dbg !15, !tbaa !17, !range !21
+ %0 = load i8, ptr @b, align 1, !dbg !15, !tbaa !17, !range !21
%tobool.not = icmp eq i8 %0, 0, !dbg !15
br i1 %tobool.not, label %if.end, label %if.then, !dbg !22
entry:
call void @llvm.dbg.value(metadata i32 7, metadata !11, metadata !DIExpression()), !dbg !13
tail call void @_Z2f1v(), !dbg !14
- %0 = load i8, i8* @b, align 1, !dbg !15, !tbaa !17, !range !21
+ %0 = load i8, ptr @b, align 1, !dbg !15, !tbaa !17, !range !21
%tobool.not = icmp eq i8 %0, 0, !dbg !15
br i1 %tobool.not, label %if.end, label %if.then, !dbg !22
call void @llvm.dbg.value(metadata i32 %call, metadata !11, metadata !DIExpression()), !dbg !15
call void @llvm.dbg.value(metadata i32 %call, metadata !13, metadata !DIExpression()), !dbg !15
tail call void @_Z2f1v(), !dbg !16
- store i32 %call, i32* @x, align 4, !dbg !17, !tbaa !18
+ store i32 %call, ptr @x, align 4, !dbg !17, !tbaa !18
ret void, !dbg !22
}
entry:
call void @llvm.dbg.value(metadata i32 7, metadata !11, metadata !DIExpression()), !dbg !13
tail call void @_Z2f1v(), !dbg !14
- %0 = load i8, i8* @b, align 1, !dbg !15, !tbaa !17, !range !21
+ %0 = load i8, ptr @b, align 1, !dbg !15, !tbaa !17, !range !21
%tobool.not = icmp eq i8 %0, 0, !dbg !15
br i1 %tobool.not, label %if.end, label %if.then, !dbg !22
define dso_local i32 @_Z3fooi(i32 %0) !dbg !7 !prof !34 !section_prefix !35 {
%2 = alloca i32, align 4
%3 = alloca i32, align 4
- store i32 %0, i32* %3, align 4
- call void @llvm.dbg.declare(metadata i32* %3, metadata !11, metadata !DIExpression()), !dbg !12
- %4 = load i32, i32* %3, align 4, !dbg !13
+ store i32 %0, ptr %3, align 4
+ call void @llvm.dbg.declare(metadata ptr %3, metadata !11, metadata !DIExpression()), !dbg !12
+ %4 = load i32, ptr %3, align 4, !dbg !13
%5 = icmp sgt i32 %4, 20, !dbg !15
br i1 %5, label %6, label %8, !dbg !16, !prof !36
6: ; preds = %1
%7 = call i32 @bar()
- store i32 %7, i32* %2, align 4, !dbg !17
+ store i32 %7, ptr %2, align 4, !dbg !17
br label %10, !dbg !17
8: ; preds = %1
%9 = call i32 @baz()
- store i32 %9, i32* %2, align 4, !dbg !18
+ store i32 %9, ptr %2, align 4, !dbg !18
br label %10, !dbg !18
10: ; preds = %8, %6
- %11 = load i32, i32* %2, align 4, !dbg !19
+ %11 = load i32, ptr %2, align 4, !dbg !19
ret i32 %11, !dbg !19
}
define dso_local x86_fp80 @powixf2() !dbg !1 {
entry:
%r = alloca x86_fp80, align 16
- call void @llvm.dbg.declare(metadata x86_fp80* %r, metadata !14, metadata !DIExpression()), !dbg !15
+ call void @llvm.dbg.declare(metadata ptr %r, metadata !14, metadata !DIExpression()), !dbg !15
br i1 undef, label %if.then, label %if.end, !dbg !16
if.then: ; preds = %entry
; CHECK: %mul = fmul x86_fp80
; CHECK: call void @llvm.dbg.value(metadata x86_fp80 %mul, metadata {{.*}}, metadata !DIExpression())
%mul = fmul x86_fp80 undef, undef, !dbg !18
- store x86_fp80 %mul, x86_fp80* %r, align 16, !dbg !18
+ store x86_fp80 %mul, ptr %r, align 16, !dbg !18
br label %if.end, !dbg !20
if.end: ; preds = %if.then, %entry
; CHECK-LABEL: if.end:
; CHECK: %r.0 = phi x86_fp80
; CHECK: call void @llvm.dbg.value(metadata x86_fp80 %r.0, metadata {{.*}}, metadata !DIExpression())
- %out = load x86_fp80, x86_fp80* %r, align 16, !dbg !21
+ %out = load x86_fp80, ptr %r, align 16, !dbg !21
ret x86_fp80 %out, !dbg !22
}
%struct.A = type { i8 }
-@p = global { i64, i64 } { i64 ptrtoint (void (%struct.A*)* @_ZN1A3fooEv to i64), i64 0 }, align 8, !dbg !0
+@p = global { i64, i64 } { i64 ptrtoint (ptr @_ZN1A3fooEv to i64), i64 0 }, align 8, !dbg !0
-declare void @_ZN1A3fooEv(%struct.A*)
+declare void @_ZN1A3fooEv(ptr)
!llvm.dbg.cu = !{!10}
!llvm.module.flags = !{!14, !15, !16}
; Function Attrs: uwtable
define dso_local void @_Z2f1v() local_unnamed_addr !dbg !7 {
entry:
- %0 = load i8, i8* @b, align 1, !dbg !10, !tbaa !14, !range !18
+ %0 = load i8, ptr @b, align 1, !dbg !10, !tbaa !14, !range !18
%tobool.i = icmp eq i8 %0, 0, !dbg !10
br i1 %tobool.i, label %if.else.i, label %if.then.i, !dbg !19
source_filename = "test/DebugInfo/X86/misched-dbg-value.ll"
-%struct.Record = type { %struct.Record*, i32, i32, i32, [31 x i8] }
+%struct.Record = type { ptr, i32, i32, i32, [31 x i8] }
@Version = global [4 x i8] c"1.1\00", align 1, !dbg !0
@IntGlob = common global i32 0, align 4, !dbg !7
@Char2Glob = common global i8 0, align 1, !dbg !15
@Array1Glob = common global [51 x i32] zeroinitializer, align 16, !dbg !17
@Array2Glob = common global [51 x [51 x i32]] zeroinitializer, align 16, !dbg !23
-@PtrGlb = common global %struct.Record* null, align 8, !dbg !28
-@PtrGlbNext = common global %struct.Record* null, align 8, !dbg !54
+@PtrGlb = common global ptr null, align 8, !dbg !28
+@PtrGlbNext = common global ptr null, align 8, !dbg !54
; Function Attrs: nounwind optsize
-define void @Proc8(i32* nocapture %Array1Par, [51 x i32]* nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) #0 !dbg !61 {
+define void @Proc8(ptr nocapture %Array1Par, ptr nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) #0 !dbg !61 {
entry:
- tail call void @llvm.dbg.value(metadata i32* %Array1Par, metadata !67, metadata !73), !dbg !74
- tail call void @llvm.dbg.value(metadata [51 x i32]* %Array2Par, metadata !68, metadata !73), !dbg !75
+ tail call void @llvm.dbg.value(metadata ptr %Array1Par, metadata !67, metadata !73), !dbg !74
+ tail call void @llvm.dbg.value(metadata ptr %Array2Par, metadata !68, metadata !73), !dbg !75
tail call void @llvm.dbg.value(metadata i32 %IntParI1, metadata !69, metadata !73), !dbg !76
tail call void @llvm.dbg.value(metadata i32 %IntParI2, metadata !70, metadata !73), !dbg !77
%add = add i32 %IntParI1, 5, !dbg !78
tail call void @llvm.dbg.value(metadata i32 %add, metadata !71, metadata !73), !dbg !78
%idxprom = sext i32 %add to i64, !dbg !79
- %arrayidx = getelementptr inbounds i32, i32* %Array1Par, i64 %idxprom, !dbg !79
- store i32 %IntParI2, i32* %arrayidx, align 4, !dbg !79
+ %arrayidx = getelementptr inbounds i32, ptr %Array1Par, i64 %idxprom, !dbg !79
+ store i32 %IntParI2, ptr %arrayidx, align 4, !dbg !79
%add3 = add nsw i32 %IntParI1, 6, !dbg !80
%idxprom4 = sext i32 %add3 to i64, !dbg !80
- %arrayidx5 = getelementptr inbounds i32, i32* %Array1Par, i64 %idxprom4, !dbg !80
- store i32 %IntParI2, i32* %arrayidx5, align 4, !dbg !80
+ %arrayidx5 = getelementptr inbounds i32, ptr %Array1Par, i64 %idxprom4, !dbg !80
+ store i32 %IntParI2, ptr %arrayidx5, align 4, !dbg !80
%add6 = add nsw i32 %IntParI1, 35, !dbg !81
%idxprom7 = sext i32 %add6 to i64, !dbg !81
- %arrayidx8 = getelementptr inbounds i32, i32* %Array1Par, i64 %idxprom7, !dbg !81
- store i32 %add, i32* %arrayidx8, align 4, !dbg !81
+ %arrayidx8 = getelementptr inbounds i32, ptr %Array1Par, i64 %idxprom7, !dbg !81
+ store i32 %add, ptr %arrayidx8, align 4, !dbg !81
tail call void @llvm.dbg.value(metadata i32 %add, metadata !72, metadata !73), !dbg !82
br label %for.body, !dbg !82
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ %idxprom, %entry ], [ %indvars.iv.next, %for.body ]
%IntIndex.046 = phi i32 [ %add, %entry ], [ %inc, %for.body ]
- %arrayidx13 = getelementptr inbounds [51 x i32], [51 x i32]* %Array2Par, i64 %idxprom, i64 %indvars.iv, !dbg !84
- store i32 %add, i32* %arrayidx13, align 4, !dbg !84
+ %arrayidx13 = getelementptr inbounds [51 x i32], ptr %Array2Par, i64 %idxprom, i64 %indvars.iv, !dbg !84
+ store i32 %add, ptr %arrayidx13, align 4, !dbg !84
%inc = add nsw i32 %IntIndex.046, 1, !dbg !82
tail call void @llvm.dbg.value(metadata i32 %inc, metadata !72, metadata !73), !dbg !82
%cmp = icmp sgt i32 %inc, %add3, !dbg !82
for.end: ; preds = %for.body
%sub = add nsw i32 %IntParI1, 4, !dbg !85
%idxprom14 = sext i32 %sub to i64, !dbg !85
- %arrayidx17 = getelementptr inbounds [51 x i32], [51 x i32]* %Array2Par, i64 %idxprom, i64 %idxprom14, !dbg !85
- %0 = load i32, i32* %arrayidx17, align 4, !dbg !85
+ %arrayidx17 = getelementptr inbounds [51 x i32], ptr %Array2Par, i64 %idxprom, i64 %idxprom14, !dbg !85
+ %0 = load i32, ptr %arrayidx17, align 4, !dbg !85
%inc18 = add nsw i32 %0, 1, !dbg !85
- store i32 %inc18, i32* %arrayidx17, align 4, !dbg !85
- %1 = load i32, i32* %arrayidx, align 4, !dbg !86
+ store i32 %inc18, ptr %arrayidx17, align 4, !dbg !85
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !86
%add22 = add nsw i32 %IntParI1, 25, !dbg !86
%idxprom23 = sext i32 %add22 to i64, !dbg !86
- %arrayidx25 = getelementptr inbounds [51 x i32], [51 x i32]* %Array2Par, i64 %idxprom23, i64 %idxprom, !dbg !86
- store i32 %1, i32* %arrayidx25, align 4, !dbg !86
- store i32 5, i32* @IntGlob, align 4, !dbg !87
+ %arrayidx25 = getelementptr inbounds [51 x i32], ptr %Array2Par, i64 %idxprom23, i64 %idxprom, !dbg !86
+ store i32 %1, ptr %arrayidx25, align 4, !dbg !86
+ store i32 5, ptr @IntGlob, align 4, !dbg !87
ret void, !dbg !88
}
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-%struct.S = type { %struct.S* }
+%struct.S = type { ptr }
define void @f() !dbg !4 {
%x = alloca %struct.S, align 8
; CHECK-NOT: DW_AT_decl_line
; CHECK: {{DW_TAG|NULL}}
- call void @llvm.dbg.declare(metadata %struct.S* %x, metadata !10, metadata !16), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !16), !dbg !17
ret void, !dbg !18
}
define void @MAIN_() !dbg !2 {
L.entry:
%b_350 = alloca i32, align 4
- call void @llvm.dbg.declare(metadata i32* %b_350, metadata !12, metadata !DIExpression()), !dbg !13
+ call void @llvm.dbg.declare(metadata ptr %b_350, metadata !12, metadata !DIExpression()), !dbg !13
call void @llvm.dbg.value(metadata i32 1, metadata !14, metadata !DIExpression()), !dbg !13
ret void, !dbg !17
}
entry:
%n = alloca %struct.S, align 1
%n2 = alloca i32, align 4
- call void @llvm.dbg.declare(metadata %struct.S* %n, metadata !22, metadata !DIExpression()), !dbg !24
- call void @llvm.dbg.declare(metadata i32* %n2, metadata !25, metadata !DIExpression()), !dbg !27
+ call void @llvm.dbg.declare(metadata ptr %n, metadata !22, metadata !DIExpression()), !dbg !24
+ call void @llvm.dbg.declare(metadata ptr %n2, metadata !25, metadata !DIExpression()), !dbg !27
ret void, !dbg !28
}
; Function Attrs: uwtable
define void @_Z2f2v() #0 {
entry:
- store i32 3, i32* @i, align 4, !dbg !11
+ store i32 3, ptr @i, align 4, !dbg !11
ret void
}
%struct.Inner = type { i32, i64 }
; Function Attrs: nounwind ssp uwtable
-define i32 @foo(%struct.Outer* byval(%struct.Outer) align 8 %outer) #0 !dbg !4 {
+define i32 @foo(ptr byval(%struct.Outer) align 8 %outer) #0 !dbg !4 {
entry:
- call void @llvm.dbg.declare(metadata %struct.Outer* %outer, metadata !25, metadata !DIExpression()), !dbg !26
- %i1.sroa.0.0..sroa_idx = getelementptr inbounds %struct.Outer, %struct.Outer* %outer, i64 0, i32 0, i64 1, i32 0, !dbg !27
- %i1.sroa.0.0.copyload = load i32, i32* %i1.sroa.0.0..sroa_idx, align 8, !dbg !27
+ call void @llvm.dbg.declare(metadata ptr %outer, metadata !25, metadata !DIExpression()), !dbg !26
+ %i1.sroa.0.0..sroa_idx = getelementptr inbounds %struct.Outer, ptr %outer, i64 0, i32 0, i64 1, i32 0, !dbg !27
+ %i1.sroa.0.0.copyload = load i32, ptr %i1.sroa.0.0..sroa_idx, align 8, !dbg !27
call void @llvm.dbg.value(metadata i32 %i1.sroa.0.0.copyload, metadata !28, metadata !29), !dbg !27
- %i1.sroa.2.0..sroa_raw_cast = bitcast %struct.Outer* %outer to i8*, !dbg !27
- %i1.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, i8* %i1.sroa.2.0..sroa_raw_cast, i64 20, !dbg !27
+ %i1.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, ptr %outer, i64 20, !dbg !27
ret i32 %i1.sroa.0.0.copyload, !dbg !32
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #2
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #2
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #2
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #2
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
; Function Attrs: nounwind uwtable
define i32 @bitpiece_spill() local_unnamed_addr #0 !dbg !7 {
entry:
- tail call void @llvm.dbg.declare(metadata %struct.IntPair* undef, metadata !12, metadata !17), !dbg !18
+ tail call void @llvm.dbg.declare(metadata ptr undef, metadata !12, metadata !17), !dbg !18
%call = tail call i32 @g() #3, !dbg !19
tail call void @llvm.dbg.value(metadata i32 %call, metadata !12, metadata !20), !dbg !18
tail call void @llvm.dbg.value(metadata i32 0, metadata !12, metadata !21), !dbg !18
source_filename = "test/DebugInfo/X86/pointer-type-size.ll"
-%struct.crass = type { i8* }
+%struct.crass = type { ptr }
@crass = common global %struct.crass zeroinitializer, align 8, !dbg !0
%struct.foo = type { i8 }
-define void @_Z3zedP3foo(%struct.foo* %x) uwtable !dbg !5 {
+define void @_Z3zedP3foo(ptr %x) uwtable !dbg !5 {
entry:
- %x.addr = alloca %struct.foo*, align 8
- store %struct.foo* %x, %struct.foo** %x.addr, align 8
- call void @llvm.dbg.declare(metadata %struct.foo** %x.addr, metadata !23, metadata !DIExpression()), !dbg !24
- %0 = load %struct.foo*, %struct.foo** %x.addr, align 8, !dbg !25
- call void @_ZN3foo3barEv(%struct.foo* %0), !dbg !25
+ %x.addr = alloca ptr, align 8
+ store ptr %x, ptr %x.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !23, metadata !DIExpression()), !dbg !24
+ %0 = load ptr, ptr %x.addr, align 8, !dbg !25
+ call void @_ZN3foo3barEv(ptr %0), !dbg !25
ret void, !dbg !27
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
-define linkonce_odr void @_ZN3foo3barEv(%struct.foo* %this) nounwind uwtable align 2 !dbg !20 {
+define linkonce_odr void @_ZN3foo3barEv(ptr %this) nounwind uwtable align 2 !dbg !20 {
entry:
- %this.addr = alloca %struct.foo*, align 8
- store %struct.foo* %this, %struct.foo** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %struct.foo** %this.addr, metadata !28, metadata !DIExpression()), !dbg !29
- %this1 = load %struct.foo*, %struct.foo** %this.addr
+ %this.addr = alloca ptr, align 8
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !28, metadata !DIExpression()), !dbg !29
+ %this1 = load ptr, ptr %this.addr
ret void, !dbg !30
}
target triple = "x86_64-unknown-linux-gnu"
%class.function = type { i8 }
-%class.BPLFunctionWriter = type { %struct.BPLModuleWriter* }
+%class.BPLFunctionWriter = type { ptr }
%struct.BPLModuleWriter = type { i8 }
%class.anon = type { i8 }
%class.anon.0 = type { i8 }
-@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
-@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
+@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (ptr), ptr @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"
+@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (ptr), ptr @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"
-define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 !dbg !5 {
+define void @_ZN17BPLFunctionWriter9writeExprEv(ptr %this) nounwind uwtable align 2 !dbg !5 {
entry:
- %this.addr = alloca %class.BPLFunctionWriter*, align 8
+ %this.addr = alloca ptr, align 8
%agg.tmp = alloca %class.function, align 1
%agg.tmp2 = alloca %class.anon, align 1
%agg.tmp4 = alloca %class.function, align 1
%agg.tmp5 = alloca %class.anon.0, align 1
- store %class.BPLFunctionWriter* %this, %class.BPLFunctionWriter** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %class.BPLFunctionWriter** %this.addr, metadata !133, metadata !DIExpression()), !dbg !135
- %this1 = load %class.BPLFunctionWriter*, %class.BPLFunctionWriter** %this.addr
- %MW = getelementptr inbounds %class.BPLFunctionWriter, %class.BPLFunctionWriter* %this1, i32 0, i32 0, !dbg !136
- %0 = load %struct.BPLModuleWriter*, %struct.BPLModuleWriter** %MW, align 8, !dbg !136
- call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(%class.function* %agg.tmp), !dbg !136
- call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(%struct.BPLModuleWriter* %0), !dbg !136
- %MW3 = getelementptr inbounds %class.BPLFunctionWriter, %class.BPLFunctionWriter* %this1, i32 0, i32 0, !dbg !138
- %1 = load %struct.BPLModuleWriter*, %struct.BPLModuleWriter** %MW3, align 8, !dbg !138
- call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(%class.function* %agg.tmp4), !dbg !138
- call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(%struct.BPLModuleWriter* %1), !dbg !138
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !133, metadata !DIExpression()), !dbg !135
+ %this1 = load ptr, ptr %this.addr
+ %0 = load ptr, ptr %this1, align 8, !dbg !136
+ call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(ptr %agg.tmp), !dbg !136
+ call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr %0), !dbg !136
+ %1 = load ptr, ptr %this1, align 8, !dbg !138
+ call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(ptr %agg.tmp4), !dbg !138
+ call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr %1), !dbg !138
ret void, !dbg !139
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
-declare void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(%struct.BPLModuleWriter*)
+declare void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr)
-define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(%class.function* %this) unnamed_addr nounwind uwtable align 2 {
+define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(ptr %this) unnamed_addr nounwind uwtable align 2 {
entry:
- %this.addr = alloca %class.function*, align 8
+ %this.addr = alloca ptr, align 8
%__f = alloca %class.anon.0, align 1
- store %class.function* %this, %class.function** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %class.function** %this.addr, metadata !140, metadata !DIExpression()), !dbg !142
- call void @llvm.dbg.declare(metadata %class.anon.0* %__f, metadata !143, metadata !DIExpression()), !dbg !144
- %this1 = load %class.function*, %class.function** %this.addr
- call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(%class.anon.0* %__f), !dbg !145
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !140, metadata !DIExpression()), !dbg !142
+ call void @llvm.dbg.declare(metadata ptr %__f, metadata !143, metadata !DIExpression()), !dbg !144
+ %this1 = load ptr, ptr %this.addr
+ call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(ptr %__f), !dbg !145
ret void, !dbg !147
}
-define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(%class.anon.0*) nounwind uwtable align 2 {
+define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(ptr) nounwind uwtable align 2 {
entry:
- %.addr = alloca %class.anon.0*, align 8
- store %class.anon.0* %0, %class.anon.0** %.addr, align 8
+ %.addr = alloca ptr, align 8
+ store ptr %0, ptr %.addr, align 8
ret void, !dbg !148
}
-define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(%class.function* %this) unnamed_addr nounwind uwtable align 2 {
+define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(ptr %this) unnamed_addr nounwind uwtable align 2 {
entry:
- %this.addr = alloca %class.function*, align 8
+ %this.addr = alloca ptr, align 8
%__f = alloca %class.anon, align 1
- store %class.function* %this, %class.function** %this.addr, align 8
- call void @llvm.dbg.declare(metadata %class.function** %this.addr, metadata !150, metadata !DIExpression()), !dbg !151
- call void @llvm.dbg.declare(metadata %class.anon* %__f, metadata !152, metadata !DIExpression()), !dbg !153
- %this1 = load %class.function*, %class.function** %this.addr
- call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(%class.anon* %__f), !dbg !154
+ store ptr %this, ptr %this.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !150, metadata !DIExpression()), !dbg !151
+ call void @llvm.dbg.declare(metadata ptr %__f, metadata !152, metadata !DIExpression()), !dbg !153
+ %this1 = load ptr, ptr %this.addr
+ call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(ptr %__f), !dbg !154
ret void, !dbg !156
}
-define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(%class.anon*) nounwind uwtable align 2 {
+define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(ptr) nounwind uwtable align 2 {
entry:
- %.addr = alloca %class.anon*, align 8
- store %class.anon* %0, %class.anon** %.addr, align 8
+ %.addr = alloca ptr, align 8
+ store ptr %0, ptr %.addr, align 8
ret void, !dbg !157
}
define i32 @main() nounwind uwtable !dbg !5 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
ret i32 0, !dbg !10
}
; CHECK: DBG_VALUE $rcx, $noreg, !8, !DIExpression(),
; INSTRREF: DBG_VALUE $ecx, $noreg, !8, !DIExpression(),
call void @llvm.dbg.value(metadata i1 %1, metadata !8, metadata !DIExpression()), !dbg !7
- %2 = getelementptr inbounds %TSb, %TSb* %0, i32 0, i32 0, !dbg !7
- store i1 %1, i1* %2, align 1, !dbg !7
- %3 = zext i1 %1 to i64, !dbg !7
- call void asm sideeffect "", "r"(i64 %3), !dbg !7
+ store i1 %1, ptr %0, align 1, !dbg !7
+ %2 = zext i1 %1 to i64, !dbg !7
+ call void asm sideeffect "", "r"(i64 %2), !dbg !7
ret void, !dbg !7
}
; INSTRREF-NEXT: DBG_INSTR_REF 1, 0, ![[FOO1]], !DIExpression()
; DBGVALUE-NEXT: DBG_VALUE [[REG1]], $noreg, ![[FOO1]], !DIExpression()
entry1:
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !20, metadata !DIExpression()), !dbg !23
- call void @llvm.dbg.value(metadata %struct.SS* null, metadata !22, metadata !DIExpression()), !dbg !24
- ret i32 ptrtoint (%struct.SS* @S to i32), !dbg !25
+ call void @llvm.dbg.value(metadata ptr @S, metadata !20, metadata !DIExpression()), !dbg !23
+ call void @llvm.dbg.value(metadata ptr null, metadata !22, metadata !DIExpression()), !dbg !24
+ ret i32 ptrtoint (ptr @S to i32), !dbg !25
}
; Verify that the def comes before the for foo2 and bar2.
; DBGVALUE-NEXT: DBG_VALUE [[REG2]], $noreg, ![[FOO2]], !DIExpression
; DBGVALUE-NEXT: DBG_VALUE [[REG2]], $noreg, ![[BAR2]], !DIExpression
entry2:
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !28, metadata !DIExpression()), !dbg !30
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !29, metadata !DIExpression()), !dbg !31
- ret i32 add (i32 ptrtoint (%struct.SS* @S to i32), i32 ptrtoint (%struct.SS* @S to i32)), !dbg !32
+ call void @llvm.dbg.value(metadata ptr @S, metadata !28, metadata !DIExpression()), !dbg !30
+ call void @llvm.dbg.value(metadata ptr @S, metadata !29, metadata !DIExpression()), !dbg !31
+ ret i32 add (i32 ptrtoint (ptr @S to i32), i32 ptrtoint (ptr @S to i32)), !dbg !32
}
; Verify that the def comes before the for foo3 and bar3.
; DBGVALUE-NEXT: DBG_VALUE [[REG3]], $noreg, ![[BAR3]], !DIExpression()
; DBGVALUE-NEXT: DBG_VALUE [[REG3]], $noreg, ![[FOO3]], !DIExpression()
entry3:
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !36, metadata !DIExpression()), !dbg !38
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !35, metadata !DIExpression()), !dbg !37
- ret i32 add (i32 ptrtoint (%struct.SS* @S to i32), i32 ptrtoint (%struct.SS* @S to i32)), !dbg !39
+ call void @llvm.dbg.value(metadata ptr @S, metadata !36, metadata !DIExpression()), !dbg !38
+ call void @llvm.dbg.value(metadata ptr @S, metadata !35, metadata !DIExpression()), !dbg !37
+ ret i32 add (i32 ptrtoint (ptr @S to i32), i32 ptrtoint (ptr @S to i32)), !dbg !39
}
; Verify that the def comes before the for bar4.
; INSTRREF-NEXT: DBG_INSTR_REF 1, 0, ![[BAR4]], !DIExpression()
; DBGVALUE-NEXT: DBG_VALUE [[REG4]], $noreg, ![[BAR4]], !DIExpression()
entry4:
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !42, metadata !DIExpression()), !dbg !44
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !43, metadata !DIExpression()), !dbg !45
- call void @llvm.dbg.value(metadata %struct.SS* null, metadata !42, metadata !DIExpression()), !dbg !44
- ret i32 ptrtoint (%struct.SS* @S to i32), !dbg !46
+ call void @llvm.dbg.value(metadata ptr @S, metadata !42, metadata !DIExpression()), !dbg !44
+ call void @llvm.dbg.value(metadata ptr @S, metadata !43, metadata !DIExpression()), !dbg !45
+ call void @llvm.dbg.value(metadata ptr null, metadata !42, metadata !DIExpression()), !dbg !44
+ ret i32 ptrtoint (ptr @S to i32), !dbg !46
}
; Verify that we do not get a DBG_VALUE that maps foo5 to @S here.
; CHECK-NOT: DBG_{{.*}} ![[FOO5]], !DIExpression()
; CHECK: RET
entry5:
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !49, metadata !DIExpression()), !dbg !51
- call void @llvm.dbg.value(metadata %struct.SS* @S, metadata !50, metadata !DIExpression()), !dbg !52
- call void @llvm.dbg.value(metadata %struct.SS* null, metadata !50, metadata !DIExpression()), !dbg !52
- ret i32 ptrtoint (%struct.SS* @S to i32), !dbg !53
+ call void @llvm.dbg.value(metadata ptr @S, metadata !49, metadata !DIExpression()), !dbg !51
+ call void @llvm.dbg.value(metadata ptr @S, metadata !50, metadata !DIExpression()), !dbg !52
+ call void @llvm.dbg.value(metadata ptr null, metadata !50, metadata !DIExpression()), !dbg !52
+ ret i32 ptrtoint (ptr @S to i32), !dbg !53
}
; Function Attrs: nounwind readnone speculatable
call void @llvm.dbg.value(metadata i32 9, metadata !15, metadata !DIExpression()), !dbg !26
call void @llvm.dbg.value(metadata i32 13, metadata !16, metadata !DIExpression()), !dbg !27
call void @llvm.dbg.value(metadata i32 0, metadata !17, metadata !DIExpression()), !dbg !28
- %0 = load i32, i32* @end, align 4, !dbg !29, !tbaa !31
+ %0 = load i32, ptr @end, align 4, !dbg !29, !tbaa !31
%cmp20 = icmp sgt i32 %0, 0, !dbg !35
br i1 %cmp20, label %for.body.lr.ph, label %for.cond.cleanup, !dbg !36
for.body.lr.ph: ; preds = %entry
- %1 = load i32, i32* @end, align 4, !tbaa !31
+ %1 = load i32, ptr @end, align 4, !tbaa !31
br label %for.body, !dbg !36
for.cond.cleanup: ; preds = %for.body, %entry
; DBGVALUE-NEXT: DBG_VALUE [[REG1]]
%x.0.lcssa = phi i32 [ 9, %entry ], [ %add, %for.body ]
call void @llvm.dbg.value(metadata i32 %x.0.lcssa, metadata !15, metadata !DIExpression()), !dbg !26
- %2 = bitcast [80 x i32]* %arr to i8*, !dbg !37
- call void @llvm.lifetime.start.p0i8(i64 320, i8* nonnull %2) #3, !dbg !37
- call void @llvm.dbg.declare(metadata [80 x i32]* %arr, metadata !19, metadata !DIExpression()), !dbg !38
+ call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %arr) #3, !dbg !37
+ call void @llvm.dbg.declare(metadata ptr %arr, metadata !19, metadata !DIExpression()), !dbg !38
call void @llvm.dbg.value(metadata i32 0, metadata !24, metadata !DIExpression()), !dbg !39
br label %for.body4, !dbg !40
br i1 %cmp, label %for.body, label %for.cond.cleanup, !dbg !36, !llvm.loop !45
for.cond.cleanup3: ; preds = %for.body4
- call void @llvm.lifetime.end.p0i8(i64 320, i8* nonnull %2) #3, !dbg !47
+ call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %arr) #3, !dbg !47
ret i32 %x.0.lcssa, !dbg !48
for.body4: ; preds = %for.body4, %for.cond.cleanup
%indvars.iv = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next, %for.body4 ]
call void @llvm.dbg.value(metadata i64 %indvars.iv, metadata !24, metadata !DIExpression()), !dbg !39
- %arrayidx = getelementptr inbounds [80 x i32], [80 x i32]* %arr, i64 0, i64 %indvars.iv, !dbg !49
- %3 = trunc i64 %indvars.iv to i32, !dbg !52
- %4 = add i32 %3, 3, !dbg !52
- store volatile i32 %4, i32* %arrayidx, align 4, !dbg !52, !tbaa !31
+ %arrayidx = getelementptr inbounds [80 x i32], ptr %arr, i64 0, i64 %indvars.iv, !dbg !49
+ %2 = trunc i64 %indvars.iv to i32, !dbg !52
+ %3 = add i32 %2, 3, !dbg !52
+ store volatile i32 %3, ptr %arrayidx, align 4, !dbg !52, !tbaa !31
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !53
call void @llvm.dbg.value(metadata i32 undef, metadata !24, metadata !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)), !dbg !39
%exitcond = icmp eq i64 %indvars.iv.next, 64, !dbg !54
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
call void @llvm.dbg.value(metadata i32 9, metadata !15, metadata !DIExpression()), !dbg !26
call void @llvm.dbg.value(metadata i32 13, metadata !16, metadata !DIExpression()), !dbg !27
call void @llvm.dbg.value(metadata i32 0, metadata !17, metadata !DIExpression()), !dbg !28
- %0 = load i32, i32* @end, align 4, !dbg !29, !tbaa !31
+ %0 = load i32, ptr @end, align 4, !dbg !29, !tbaa !31
%cmp20 = icmp sgt i32 %0, 0, !dbg !35
br i1 %cmp20, label %for.body.lr.ph, label %for.cond.cleanup, !dbg !36
for.body.lr.ph: ; preds = %entry
- %1 = load i32, i32* @end, align 4, !tbaa !31
+ %1 = load i32, ptr @end, align 4, !tbaa !31
br label %for.body, !dbg !36
for.cond.cleanup: ; preds = %for.body, %entry
; DBGVALUE-NEXT: DBG_VALUE [[REG1]]
%x.0.lcssa = phi i32 [ 9, %entry ], [ %add, %for.body ]
call void @llvm.dbg.value(metadata i32 %x.0.lcssa, metadata !15, metadata !DIExpression()), !dbg !26
- %2 = bitcast [80 x i32]* %arr to i8*, !dbg !37
- call void @llvm.lifetime.start.p0i8(i64 320, i8* nonnull %2) #3, !dbg !37
- call void @llvm.dbg.declare(metadata [80 x i32]* %arr, metadata !19, metadata !DIExpression()), !dbg !38
+ call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %arr) #3, !dbg !37
+ call void @llvm.dbg.declare(metadata ptr %arr, metadata !19, metadata !DIExpression()), !dbg !38
call void @llvm.dbg.value(metadata i32 0, metadata !24, metadata !DIExpression()), !dbg !39
br label %for.body4, !dbg !40
br i1 %cmp, label %for.body, label %for.cond.cleanup, !dbg !36, !llvm.loop !45
for.cond.cleanup3: ; preds = %for.body4
- call void @llvm.lifetime.end.p0i8(i64 320, i8* nonnull %2) #3, !dbg !47
+ call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %arr) #3, !dbg !47
ret i32 %x.0.lcssa, !dbg !48
for.body4: ; preds = %for.body4, %for.cond.cleanup
%indvars.iv = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next, %for.body4 ]
call void @llvm.dbg.value(metadata i64 %indvars.iv, metadata !24, metadata !DIExpression()), !dbg !39
- %arrayidx = getelementptr inbounds [80 x i32], [80 x i32]* %arr, i64 0, i64 %indvars.iv, !dbg !49
- %3 = trunc i64 %indvars.iv to i32, !dbg !52
- %4 = add i32 %3, 3, !dbg !52
- store volatile i32 %4, i32* %arrayidx, align 4, !dbg !52, !tbaa !31
+ %arrayidx = getelementptr inbounds [80 x i32], ptr %arr, i64 0, i64 %indvars.iv, !dbg !49
+ %2 = trunc i64 %indvars.iv to i32, !dbg !52
+ %3 = add i32 %2, 3, !dbg !52
+ store volatile i32 %3, ptr %arrayidx, align 4, !dbg !52, !tbaa !31
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !53
call void @llvm.dbg.value(metadata i32 undef, metadata !24, metadata !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)), !dbg !39
%exitcond = icmp eq i64 %indvars.iv.next, 64, !dbg !54
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
call void @llvm.dbg.value(metadata i64 9, metadata !17, metadata !DIExpression()), !dbg !28
call void @llvm.dbg.value(metadata i64 13, metadata !18, metadata !DIExpression()), !dbg !29
call void @llvm.dbg.value(metadata i64 0, metadata !19, metadata !DIExpression()), !dbg !30
- %0 = load i64, i64* @end, align 8, !dbg !31
+ %0 = load i64, ptr @end, align 8, !dbg !31
%cmp20 = icmp sgt i64 %0, 0, !dbg !37
br i1 %cmp20, label %for.body.lr.ph, label %for.cond.cleanup, !dbg !38
for.body.lr.ph: ; preds = %entry
- %1 = load i64, i64* @end, align 8
+ %1 = load i64, ptr @end, align 8
br label %for.body, !dbg !38
for.cond.cleanup.loopexit: ; preds = %for.body
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%x.0.lcssa.off0 = phi i32 [ 9, %entry ], [ %extract.t, %for.cond.cleanup.loopexit ]
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression()), !dbg !28
- %2 = bitcast [80 x i64]* %arr to i8*, !dbg !39
call void @llvm.dbg.value(metadata i64 0, metadata !26, metadata !DIExpression()), !dbg !41
br label %for.body4, !dbg !42
call void @llvm.dbg.value(metadata i64 %q.019, metadata !26, metadata !DIExpression()), !dbg !41
%add5 = add nuw nsw i64 %q.019, 3, !dbg !51
%idxprom = trunc i64 %q.019 to i32, !dbg !54
- %arrayidx = getelementptr inbounds [80 x i64], [80 x i64]* %arr, i32 0, i32 %idxprom, !dbg !54
- store volatile i64 %add5, i64* %arrayidx, align 8, !dbg !55
+ %arrayidx = getelementptr inbounds [80 x i64], ptr %arr, i32 0, i32 %idxprom, !dbg !54
+ store volatile i64 %add5, ptr %arrayidx, align 8, !dbg !55
%inc7 = add nuw nsw i64 %q.019, 1, !dbg !56
call void @llvm.dbg.value(metadata i64 %inc7, metadata !26, metadata !DIExpression()), !dbg !41
%cmp2 = icmp ult i64 %inc7, 64, !dbg !57
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-linux-gnu"
-define i8 @f(i32* %foo) local_unnamed_addr !dbg !6 {
+define i8 @f(ptr %foo) local_unnamed_addr !dbg !6 {
entry:
- %bar = getelementptr i32, i32* %foo, i32 4
- %baz = bitcast i32* %bar to i8*
- %quux = load i8, i8* %baz
+ %bar = getelementptr i32, ptr %foo, i32 4
+ %quux = load i8, ptr %bar
br label %next
next: ; preds = %entry
- tail call void @llvm.dbg.value(metadata i8* %baz, metadata !15, metadata !DIExpression()), !dbg !30
+ tail call void @llvm.dbg.value(metadata ptr %bar, metadata !15, metadata !DIExpression()), !dbg !30
%xyzzy = add i8 %quux, 123
br label %fin
fin: ; preds = %next
- %trains = getelementptr i32, i32* %foo, i32 3
- %planes = bitcast i32* %trains to i8*
- %cars = load i8, i8* %planes
+ %trains = getelementptr i32, ptr %foo, i32 3
+ %cars = load i8, ptr %trains
%ret = add i8 %xyzzy, %cars
ret i8 %ret
}
%struct.S0 = type opaque
; Function Attrs: noinline nounwind ssp uwtable
-define void @f(%struct.S3* nocapture readonly %a3) local_unnamed_addr #0 !dbg !6 {
+define void @f(ptr nocapture readonly %a3) local_unnamed_addr #0 !dbg !6 {
entry:
- tail call void @llvm.dbg.value(metadata %struct.S3* %a3, metadata !15, metadata !DIExpression()), !dbg !30
- %packed = getelementptr inbounds %struct.S3, %struct.S3* %a3, i64 0, i32 0, !dbg !31
- %0 = load i64, i64* %packed, align 8, !dbg !31
+ tail call void @llvm.dbg.value(metadata ptr %a3, metadata !15, metadata !DIExpression()), !dbg !30
+ %0 = load i64, ptr %a3, align 8, !dbg !31
%add = add i64 %0, 4096, !dbg !37
- %1 = inttoptr i64 %add to %struct.S4*, !dbg !38
- tail call void @llvm.dbg.value(metadata %struct.S4* %1, metadata !16, metadata !DIExpression()), !dbg !39
- tail call void @llvm.dbg.value(metadata %struct.S4* %1, metadata !17, metadata !DIExpression()), !dbg !40
- %b1 = bitcast %struct.S4* %1 to %struct.S0**, !dbg !41
- %2 = load %struct.S0*, %struct.S0** %b1, align 8, !dbg !41
- tail call void @llvm.dbg.value(metadata %struct.S0* %2, metadata !24, metadata !DIExpression()), !dbg !45
- %call = tail call i32 (%struct.S0*, ...) bitcast (i32 (...)* @use to i32 (%struct.S0*, ...)*)(%struct.S0* %2) #3, !dbg !46
+ %1 = inttoptr i64 %add to ptr, !dbg !38
+ tail call void @llvm.dbg.value(metadata ptr %1, metadata !16, metadata !DIExpression()), !dbg !39
+ tail call void @llvm.dbg.value(metadata ptr %1, metadata !17, metadata !DIExpression()), !dbg !40
+ %2 = load ptr, ptr %1, align 8, !dbg !41
+ tail call void @llvm.dbg.value(metadata ptr %2, metadata !24, metadata !DIExpression()), !dbg !45
+ %call = tail call i32 (ptr, ...) @use(ptr %2) #3, !dbg !46
ret void, !dbg !47
}
%bar.2 = alloca %rec789, align 1
call void @llvm.dbg.value(metadata %rec789 %bar, metadata !17, metadata !DIExpression()), !dbg !18
%1 = extractvalue %rec789 %bar, 0
- %.repack = getelementptr inbounds %rec789, %rec789* %bar.2, i16 0, i32 0, i16 0
%.elt = extractvalue [5 x i16] %1, 0
- store i16 %.elt, i16* %.repack, align 1
+ store i16 %.elt, ptr %bar.2, align 1
ret void, !dbg !19
}
; DBGVALUE-NEXT: DBG_VALUE %[[REG]]
; Function Attrs: nofree norecurse nounwind uwtable writeonly
-define dso_local i32 @foo(i32 %a, i32* nocapture %b) local_unnamed_addr !dbg !7 {
+define dso_local i32 @foo(i32 %a, ptr nocapture %b) local_unnamed_addr !dbg !7 {
entry:
%add = add nsw i32 %a, 512, !dbg !18
call void @llvm.dbg.value(metadata i32 %add, metadata !16, metadata !DIExpression()), !dbg !17
br i1 %cmp, label %if.end, label %if.then, !dbg !18
if.then: ; preds = %entry
- store i32 %a, i32* %b, align 4, !dbg !18
+ store i32 %a, ptr %b, align 4, !dbg !18
br label %if.end, !dbg !18
if.end: ; preds = %entry, %if.then
target datalayout = "e-m:e-p:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
-%M_Const_struct = type { [7 x i8], [1 x i8], [4 x i8], [4 x i8], i8* (i64)*, i8*, void ()*, i8*, [8 x i8], [14 x i8], [2 x i8] }
-%M_Main_struct = type { i8*, [32 x i8], i8*, [24 x i8], i8*, [8 x i8], i8* (i64)*, i64, [8 x i8], i8* ()*, i8*, [8 x i8], i8* ()*, [8 x i8] }
+%M_Const_struct = type { [7 x i8], [1 x i8], [4 x i8], [4 x i8], ptr, ptr, ptr, ptr, [8 x i8], [14 x i8], [2 x i8] }
+%M_Main_struct = type { ptr, [32 x i8], ptr, [24 x i8], ptr, [8 x i8], ptr, i64, [8 x i8], ptr, ptr, [8 x i8], ptr, [8 x i8] }
-@M_Const = internal constant %M_Const_struct { [7 x i8] c"Main_M3", [1 x i8] zeroinitializer, [4 x i8] c"Test", [4 x i8] zeroinitializer, i8* (i64)* @Main_M3, i8* getelementptr inbounds (%M_Const_struct, %M_Const_struct* @M_Const, i32 0, i32 0, i32 0), void ()* @Main__Test, i8* getelementptr inbounds (i8, i8* getelementptr inbounds (%M_Const_struct, %M_Const_struct* @M_Const, i32 0, i32 0, i32 0), i64 8), [8 x i8] zeroinitializer, [14 x i8] c"../src/Main.m3", [2 x i8] zeroinitializer }, align 8
-@M_Main = internal global %M_Main_struct { i8* getelementptr inbounds (i8, i8* getelementptr inbounds (%M_Const_struct, %M_Const_struct* @M_Const, i32 0, i32 0, i32 0), i64 56), [32 x i8] zeroinitializer, i8* getelementptr inbounds (i8, i8* getelementptr inbounds (%M_Const_struct, %M_Const_struct* @M_Const, i32 0, i32 0, i32 0), i64 16), [24 x i8] zeroinitializer, i8* getelementptr inbounds (i8, i8* bitcast (%M_Main_struct* @M_Main to i8*), i64 104), [8 x i8] zeroinitializer, i8* (i64)* @Main_M3, i64 3, [8 x i8] zeroinitializer, i8* ()* @Main_I3, i8* getelementptr inbounds (i8, i8* bitcast (%M_Main_struct* @M_Main to i8*), i64 128), [8 x i8] zeroinitializer, i8* ()* @RTHooks_I3, [8 x i8] zeroinitializer }, align 8
+@M_Const = internal constant %M_Const_struct { [7 x i8] c"Main_M3", [1 x i8] zeroinitializer, [4 x i8] c"Test", [4 x i8] zeroinitializer, ptr @Main_M3, ptr @M_Const, ptr @Main__Test, ptr getelementptr inbounds (i8, ptr @M_Const, i64 8), [8 x i8] zeroinitializer, [14 x i8] c"../src/Main.m3", [2 x i8] zeroinitializer }, align 8
+@M_Main = internal global %M_Main_struct { ptr getelementptr inbounds (i8, ptr @M_Const, i64 56), [32 x i8] zeroinitializer, ptr getelementptr inbounds (i8, ptr @M_Const, i64 16), [24 x i8] zeroinitializer, ptr getelementptr inbounds (i8, ptr @M_Main, i64 104), [8 x i8] zeroinitializer, ptr @Main_M3, i64 3, [8 x i8] zeroinitializer, ptr @Main_I3, ptr getelementptr inbounds (i8, ptr @M_Main, i64 128), [8 x i8] zeroinitializer, ptr @RTHooks_I3, [8 x i8] zeroinitializer }, align 8
@m3_jmpbuf_size = external global i64, align 8
-declare i8* @Main_I3()
+declare ptr @Main_I3()
-declare i8* @RTHooks_I3()
+declare ptr @RTHooks_I3()
; Function Attrs: uwtable
define void @Main__Test() #0 !dbg !5 {
br label %second, !dbg !21
second: ; preds = %entry
- call void @llvm.dbg.declare(metadata i64* %as, metadata !22, metadata !DIExpression()), !dbg !25
- call void @llvm.dbg.declare(metadata i64* %bs, metadata !26, metadata !DIExpression()), !dbg !25
- store i64 36028797018972298, i64* %as, align 8, !dbg !28
- store i64 197, i64* %bs, align 8, !dbg !29
+ call void @llvm.dbg.declare(metadata ptr %as, metadata !22, metadata !DIExpression()), !dbg !25
+ call void @llvm.dbg.declare(metadata ptr %bs, metadata !26, metadata !DIExpression()), !dbg !25
+ store i64 36028797018972298, ptr %as, align 8, !dbg !28
+ store i64 197, ptr %bs, align 8, !dbg !29
ret void, !dbg !21
}
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-declare i8* @alloca()
+declare ptr @alloca()
; Function Attrs: uwtable
-define i8* @Main_M3(i64 %mode) #0 !dbg !30 {
+define ptr @Main_M3(i64 %mode) #0 !dbg !30 {
entry:
%mode1 = alloca i64, align 8
- store i64 %mode, i64* %mode1, align 8
+ store i64 %mode, ptr %mode1, align 8
br label %second, !dbg !36
second: ; preds = %entry
- call void @llvm.dbg.declare(metadata i64* %mode1, metadata !37, metadata !DIExpression()), !dbg !38
- %v.3 = load i64, i64* %mode1, align 8, !dbg !38
+ call void @llvm.dbg.declare(metadata ptr %mode1, metadata !37, metadata !DIExpression()), !dbg !38
+ %v.3 = load i64, ptr %mode1, align 8, !dbg !38
%icmp = icmp eq i64 %v.3, 0, !dbg !38
br i1 %icmp, label %if_1, label %else_1, !dbg !38
br label %if_1, !dbg !36
if_1: ; preds = %else_1, %second
- ret i8* bitcast (%M_Main_struct* @M_Main to i8*), !dbg !36
+ ret ptr @M_Main, !dbg !36
}
attributes #0 = { uwtable "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
; fbreg -8
; CHECK-NEXT: DW_AT_location {{.*}} (DW_OP_fbreg -8)
; CHECK-NEXT: DW_AT_name {{.*}} "dipsy"
-define void @tinkywinky(i8* %dipsy) !dbg !6 {
+define void @tinkywinky(ptr %dipsy) !dbg !6 {
entry:
- %dipsy.addr = alloca i8*
- store i8* %dipsy, i8** %dipsy.addr
- call void @llvm.dbg.declare(metadata i8** %dipsy.addr, metadata !12, metadata
+ %dipsy.addr = alloca ptr
+ store ptr %dipsy, ptr %dipsy.addr
+ call void @llvm.dbg.declare(metadata ptr %dipsy.addr, metadata !12, metadata
!13), !dbg !14
ret void, !dbg !15
}
%struct.string = type { i32 }
; Function Attrs: uwtable
-define void @_Z10get_stringv(%struct.string* noalias sret(%struct.string) %agg.result) #0 !dbg !7 {
+define void @_Z10get_stringv(ptr noalias sret(%struct.string) %agg.result) #0 !dbg !7 {
entry:
%nrvo = alloca i1, align 1
- store i1 false, i1* %nrvo, align 1, !dbg !24
- call void @llvm.dbg.declare(metadata %struct.string* %agg.result, metadata !23, metadata !DIExpression()), !dbg !25
- call void @_ZN6stringC1Ei(%struct.string* %agg.result, i32 3), !dbg !26
+ store i1 false, ptr %nrvo, align 1, !dbg !24
+ call void @llvm.dbg.declare(metadata ptr %agg.result, metadata !23, metadata !DIExpression()), !dbg !25
+ call void @_ZN6stringC1Ei(ptr %agg.result, i32 3), !dbg !26
call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"() #3, !dbg !27, !srcloc !28
- store i1 true, i1* %nrvo, align 1, !dbg !29
- %nrvo.val = load i1, i1* %nrvo, align 1, !dbg !30
+ store i1 true, ptr %nrvo, align 1, !dbg !29
+ %nrvo.val = load i1, ptr %nrvo, align 1, !dbg !30
br i1 %nrvo.val, label %nrvo.skipdtor, label %nrvo.unused, !dbg !30
nrvo.unused: ; preds = %entry
- call void @_ZN6stringD1Ev(%struct.string* %agg.result), !dbg !30
+ call void @_ZN6stringD1Ev(ptr %agg.result), !dbg !30
br label %nrvo.skipdtor, !dbg !30
nrvo.skipdtor: ; preds = %nrvo.unused, %entry
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-declare void @_ZN6stringC1Ei(%struct.string*, i32) unnamed_addr
+declare void @_ZN6stringC1Ei(ptr, i32) unnamed_addr
-declare void @_ZN6stringD1Ev(%struct.string*) unnamed_addr
+declare void @_ZN6stringD1Ev(ptr) unnamed_addr
attributes #0 = { uwtable }
attributes #1 = { nounwind readnone speculatable }
%struct.NonTrivial = type { i32 }
; Function Attrs: nounwind uwtable
-define i32 @_Z3foo10NonTrivial(%struct.NonTrivial* nocapture readonly %nt) local_unnamed_addr #0 !dbg !7 {
+define i32 @_Z3foo10NonTrivial(ptr nocapture readonly %nt) local_unnamed_addr #0 !dbg !7 {
entry:
- tail call void @llvm.dbg.declare(metadata %struct.NonTrivial* %nt, metadata !20, metadata !DIExpression()), !dbg !21
+ tail call void @llvm.dbg.declare(metadata ptr %nt, metadata !20, metadata !DIExpression()), !dbg !21
tail call void asm sideeffect "", "~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"() #2, !dbg !22, !srcloc !23
- %i = getelementptr inbounds %struct.NonTrivial, %struct.NonTrivial* %nt, i64 0, i32 0, !dbg !24
- %0 = load i32, i32* %i, align 4, !dbg !24, !tbaa !25
+ %0 = load i32, ptr %nt, align 4, !dbg !24, !tbaa !25
ret i32 %0, !dbg !30
}
define void @_Z3foo2t1(i32 %t.coerce) #3 !dbg !20 {
entry:
%t.i = alloca %struct.t1, align 4
- call void @llvm.dbg.declare(metadata %struct.t1* %t.i, metadata !15, metadata !16), !dbg !21
+ call void @llvm.dbg.declare(metadata ptr %t.i, metadata !15, metadata !16), !dbg !21
%t = alloca %struct.t1, align 4
%agg.tmp = alloca %struct.t1, align 4
- %coerce.dive = getelementptr inbounds %struct.t1, %struct.t1* %t, i32 0, i32 0
- store i32 %t.coerce, i32* %coerce.dive, align 4
- call void @llvm.dbg.declare(metadata %struct.t1* %t, metadata !23, metadata !16), !dbg !24
- %0 = bitcast %struct.t1* %agg.tmp to i8*, !dbg !25
- %1 = bitcast %struct.t1* %t to i8*, !dbg !25
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 %1, i64 4, i1 false), !dbg !25
- %coerce.dive1 = getelementptr inbounds %struct.t1, %struct.t1* %agg.tmp, i32 0, i32 0, !dbg !26
- %2 = load i32, i32* %coerce.dive1, align 4, !dbg !26
- %coerce.dive.i = getelementptr inbounds %struct.t1, %struct.t1* %t.i, i32 0, i32 0
- store i32 %2, i32* %coerce.dive.i, align 4
+ store i32 %t.coerce, ptr %t, align 4
+ call void @llvm.dbg.declare(metadata ptr %t, metadata !23, metadata !16), !dbg !24
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %t, i64 4, i1 false), !dbg !25
+ %0 = load i32, ptr %agg.tmp, align 4, !dbg !26
+ store i32 %0, ptr %t.i, align 4
call void @_Z1fv(), !dbg !27
ret void, !dbg !28
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #4
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #4
; Function Attrs: noinline uwtable
define void @_Z3bar2t1(i32 %t.coerce) #3 !dbg !29 {
entry:
%t.i = alloca %struct.t1, align 4
- call void @llvm.dbg.declare(metadata %struct.t1* %t.i, metadata !15, metadata !16), !dbg !30
+ call void @llvm.dbg.declare(metadata ptr %t.i, metadata !15, metadata !16), !dbg !30
%t = alloca %struct.t1, align 4
%agg.tmp = alloca %struct.t1, align 4
- %coerce.dive = getelementptr inbounds %struct.t1, %struct.t1* %t, i32 0, i32 0
- store i32 %t.coerce, i32* %coerce.dive, align 4
- call void @llvm.dbg.declare(metadata %struct.t1* %t, metadata !32, metadata !16), !dbg !33
- %0 = bitcast %struct.t1* %agg.tmp to i8*, !dbg !34
- %1 = bitcast %struct.t1* %t to i8*, !dbg !34
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 %1, i64 4, i1 false), !dbg !34
- %coerce.dive1 = getelementptr inbounds %struct.t1, %struct.t1* %agg.tmp, i32 0, i32 0, !dbg !35
- %2 = load i32, i32* %coerce.dive1, align 4, !dbg !35
- %coerce.dive.i = getelementptr inbounds %struct.t1, %struct.t1* %t.i, i32 0, i32 0
- store i32 %2, i32* %coerce.dive.i, align 4
+ store i32 %t.coerce, ptr %t, align 4
+ call void @llvm.dbg.declare(metadata ptr %t, metadata !32, metadata !16), !dbg !33
+ call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %t, i64 4, i1 false), !dbg !34
+ %0 = load i32, ptr %agg.tmp, align 4, !dbg !35
+ store i32 %0, ptr %t.i, align 4
call void @_Z1fv(), !dbg !36
ret void, !dbg !37
}
define dso_local void @_Z2f3v() !dbg !7 {
entry:
%x = alloca i32, align 4
- call void @llvm.dbg.declare(metadata i32* %x, metadata !10, metadata !DIExpression()), !dbg !13
+ call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !DIExpression()), !dbg !13
%call = call i32 @_Z2f2v(), !dbg !14
- store i32 %call, i32* %x, align 4, !dbg !13
- %0 = load i32, i32* %x, align 4, !dbg !13
+ store i32 %call, ptr %x, align 4, !dbg !13
+ %0 = load i32, ptr %x, align 4, !dbg !13
%tobool = icmp ne i32 %0, 0, !dbg !13
br i1 %tobool, label %if.then, label %if.end, !dbg !15
@main.myBar = private unnamed_addr constant %struct.bar { i32 3, i32 4 }, align 4
; Function Attrs: noinline nounwind ssp uwtable
-define void @doSomething(%struct.bar* nocapture readonly %b) #0 !dbg !4 {
+define void @doSomething(ptr nocapture readonly %b) #0 !dbg !4 {
entry:
- tail call void @llvm.dbg.value(metadata %struct.bar* %b, metadata !15, metadata !DIExpression()), !dbg !25
- %a1 = getelementptr inbounds %struct.bar, %struct.bar* %b, i64 0, i32 0, !dbg !26
- %0 = load i32, i32* %a1, align 4, !dbg !26, !tbaa !27
+ tail call void @llvm.dbg.value(metadata ptr %b, metadata !15, metadata !DIExpression()), !dbg !25
+ %0 = load i32, ptr %b, align 4, !dbg !26, !tbaa !27
tail call void @llvm.dbg.value(metadata i32 %0, metadata !16, metadata !DIExpression()), !dbg !26
- %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) #4, !dbg !32
+ %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %0) #4, !dbg !32
ret void, !dbg !33
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind
-declare i32 @printf(i8* nocapture readonly, ...) #2
+declare i32 @printf(ptr nocapture readonly, ...) #2
; Function Attrs: nounwind ssp uwtable
define i32 @main() #3 !dbg !17 {
entry:
%myBar = alloca i64, align 8, !dbg !34
- %tmpcast = bitcast i64* %myBar to %struct.bar*, !dbg !34
- tail call void @llvm.dbg.declare(metadata %struct.bar* %tmpcast, metadata !21, metadata !DIExpression()), !dbg !34
- store i64 17179869187, i64* %myBar, align 8, !dbg !34
- call void @doSomething(%struct.bar* %tmpcast), !dbg !35
+ tail call void @llvm.dbg.declare(metadata ptr %myBar, metadata !21, metadata !DIExpression()), !dbg !34
+ store i64 17179869187, ptr %myBar, align 8, !dbg !34
+ call void @doSomething(ptr %myBar), !dbg !35
ret i32 0, !dbg !36
}
entry:
%value.addr = alloca float, align 4
%tempValue = alloca %"union.PR15637::Value", align 4
- store float %value, float* %value.addr, align 4
- call void @llvm.dbg.declare(metadata float* %value.addr, metadata !22, metadata !23), !dbg !24
- call void @llvm.dbg.declare(metadata %"union.PR15637::Value"* %tempValue, metadata !25, metadata !23), !dbg !26
+ store float %value, ptr %value.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %value.addr, metadata !22, metadata !23), !dbg !24
+ call void @llvm.dbg.declare(metadata ptr %tempValue, metadata !25, metadata !23), !dbg !26
ret void, !dbg !27
}
define void @f() !dbg !12 {
entry:
- %0 = load i32, i32* @g, align 4, !dbg !22
+ %0 = load i32, ptr @g, align 4, !dbg !22
%1 = zext i32 %0 to i64, !dbg !22
%vla = alloca i32, i64 %1, align 16, !dbg !22
- call void @llvm.dbg.declare(metadata i32* %vla, metadata !16, metadata !DIExpression()), !dbg !22
+ call void @llvm.dbg.declare(metadata ptr %vla, metadata !16, metadata !DIExpression()), !dbg !22
call void @llvm.dbg.value(metadata i32 2, metadata !21, metadata !DIExpression()), !dbg !22
- %call = call i32 (i32*, ...) bitcast (i32 (...)* @use to i32 (i32*, ...)*)(i32* nonnull %vla), !dbg !22
+ %call = call i32 (ptr, ...) @use(ptr nonnull %vla), !dbg !22
ret void, !dbg !22
}
%5 = mul nuw i64 %4, %2, !dbg !40
%6 = mul nuw i64 %5, %3, !dbg !40
%vla = alloca i32, i64 %6, align 16, !dbg !40
- call void @llvm.dbg.declare(metadata i32* %vla, metadata !25, metadata !DIExpression()), !dbg !40
+ call void @llvm.dbg.declare(metadata ptr %vla, metadata !25, metadata !DIExpression()), !dbg !40
%vla4 = alloca i32, i64 %6, align 16, !dbg !40
- call void @llvm.dbg.declare(metadata i32* %vla4, metadata !13, metadata !DIExpression()), !dbg !40
+ call void @llvm.dbg.declare(metadata ptr %vla4, metadata !13, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i32 %i, metadata !29, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i32 %j, metadata !31, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i32 %k, metadata !33, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i32 %j, metadata !20, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i32 %k, metadata !22, metadata !DIExpression()), !dbg !40
call void @llvm.dbg.value(metadata i64 %3, metadata !24, metadata !DIExpression()), !dbg !40
- %call = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @use to i32 (i32*, i32*, ...)*)(i32* nonnull %vla, i32* nonnull %vla4) #1, !dbg !40
+ %call = call i32 (ptr, ptr, ...) @use(ptr nonnull %vla, ptr nonnull %vla4) #1, !dbg !40
ret void, !dbg !40
}
define i32 @vla(i32 %n) nounwind ssp uwtable !dbg !4 {
entry:
%n.addr = alloca i32, align 4
- %saved_stack = alloca i8*
+ %saved_stack = alloca ptr
%cleanup.dest.slot = alloca i32
- store i32 %n, i32* %n.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %n.addr, metadata !15, metadata !DIExpression()), !dbg !16
- %0 = load i32, i32* %n.addr, align 4, !dbg !17
+ store i32 %n, ptr %n.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %n.addr, metadata !15, metadata !DIExpression()), !dbg !16
+ %0 = load i32, ptr %n.addr, align 4, !dbg !17
%1 = zext i32 %0 to i64, !dbg !17
- %2 = call i8* @llvm.stacksave(), !dbg !17
- store i8* %2, i8** %saved_stack, !dbg !17
+ %2 = call ptr @llvm.stacksave(), !dbg !17
+ store ptr %2, ptr %saved_stack, !dbg !17
%vla = alloca i32, i64 %1, align 16, !dbg !17
- call void @llvm.dbg.declare(metadata i32* %vla, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !17
- %arrayidx = getelementptr inbounds i32, i32* %vla, i64 0, !dbg !22
- store i32 42, i32* %arrayidx, align 4, !dbg !22
- %3 = load i32, i32* %n.addr, align 4, !dbg !23
+ call void @llvm.dbg.declare(metadata ptr %vla, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !17
+ store i32 42, ptr %vla, align 4, !dbg !22
+ %3 = load i32, ptr %n.addr, align 4, !dbg !23
%sub = sub nsw i32 %3, 1, !dbg !23
%idxprom = sext i32 %sub to i64, !dbg !23
- %arrayidx1 = getelementptr inbounds i32, i32* %vla, i64 %idxprom, !dbg !23
- %4 = load i32, i32* %arrayidx1, align 4, !dbg !23
- store i32 1, i32* %cleanup.dest.slot
- %5 = load i8*, i8** %saved_stack, !dbg !24
- call void @llvm.stackrestore(i8* %5), !dbg !24
+ %arrayidx1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom, !dbg !23
+ %4 = load i32, ptr %arrayidx1, align 4, !dbg !23
+ store i32 1, ptr %cleanup.dest.slot
+ %5 = load ptr, ptr %saved_stack, !dbg !24
+ call void @llvm.stackrestore(ptr %5), !dbg !24
ret i32 %4, !dbg !23
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
; Function Attrs: nounwind
-declare i8* @llvm.stacksave() nounwind
+declare ptr @llvm.stacksave() nounwind
; Function Attrs: nounwind
-declare void @llvm.stackrestore(i8*) nounwind
+declare void @llvm.stackrestore(ptr) nounwind
; Function Attrs: nounwind ssp uwtable
-define i32 @main(i32 %argc, i8** %argv) nounwind ssp uwtable !dbg !9 {
+define i32 @main(i32 %argc, ptr %argv) nounwind ssp uwtable !dbg !9 {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
- %argv.addr = alloca i8**, align 8
- store i32 0, i32* %retval
- store i32 %argc, i32* %argc.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !25, metadata !DIExpression()), !dbg !26
- store i8** %argv, i8*** %argv.addr, align 8
- call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !27, metadata !DIExpression()), !dbg !26
- %0 = load i32, i32* %argc.addr, align 4, !dbg !28
+ %argv.addr = alloca ptr, align 8
+ store i32 0, ptr %retval
+ store i32 %argc, ptr %argc.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %argc.addr, metadata !25, metadata !DIExpression()), !dbg !26
+ store ptr %argv, ptr %argv.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %argv.addr, metadata !27, metadata !DIExpression()), !dbg !26
+ %0 = load i32, ptr %argc.addr, align 4, !dbg !28
%call = call i32 @vla(i32 %0), !dbg !28
ret i32 %call, !dbg !28
}
%class.A = type { i8 }
; Function Attrs: noinline nounwind optnone
-define x86_thiscallcc zeroext i1 @"\01?m_fn1@B@@AAE_NXZ"(%class.B* %this) #0 align 2 !dbg !9 {
+define x86_thiscallcc zeroext i1 @"\01?m_fn1@B@@AAE_NXZ"(ptr %this) #0 align 2 !dbg !9 {
entry:
%retval = alloca i1, align 1
- %this.addr = alloca %class.B*, align 4
- store %class.B* %this, %class.B** %this.addr, align 4
- call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !22, metadata !DIExpression()), !dbg !24
- %this1 = load %class.B*, %class.B** %this.addr, align 4
+ %this.addr = alloca ptr, align 4
+ store ptr %this, ptr %this.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !22, metadata !DIExpression()), !dbg !24
+ %this1 = load ptr, ptr %this.addr, align 4
call void @llvm.trap(), !dbg !25
unreachable, !dbg !25
return: ; No predecessors!
- %0 = load i1, i1* %retval, align 1, !dbg !25
+ %0 = load i1, ptr %retval, align 1, !dbg !25
ret i1 %0, !dbg !25
}
%class.a = type { i8 }
; Function Attrs: nounwind readnone uwtable
-define i32 @_ZN1a1bEv(%class.a* nocapture readnone) local_unnamed_addr #0 align 2 !dbg !8 {
- tail call void @llvm.dbg.value(metadata %class.a* %0, metadata !17, metadata !DIExpression()), !dbg !19
+define i32 @_ZN1a1bEv(ptr nocapture readnone) local_unnamed_addr #0 align 2 !dbg !8 {
+ tail call void @llvm.dbg.value(metadata ptr %0, metadata !17, metadata !DIExpression()), !dbg !19
br label %2, !dbg !20
; <label>:2: ; preds = %2, %1
; code generator will attempt to fuse the two instructions into a zextload.
; CHECK-LABEL: @test
-; CHECK: [[LOADVAL:%[0-9]+]] = load i32, i32* %ptr, align 4, !dbg [[DEBUGLOC:![0-9]+]]
+; CHECK: [[LOADVAL:%[0-9]+]] = load i32, ptr %ptr, align 4, !dbg [[DEBUGLOC:![0-9]+]]
; CHECK-NEXT: zext i32 [[LOADVAL]] to i64
; CHECK: [[DEBUGLOC]] = !DILocation(line: 3
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define i64 @test(i32* %ptr, i32 %cond) !dbg !5 {
+define i64 @test(ptr %ptr, i32 %cond) !dbg !5 {
entry:
- %0 = load i32, i32* %ptr, align 4, !dbg !7
+ %0 = load i32, ptr %ptr, align 4, !dbg !7
switch i32 %cond, label %sw.epilog [
i32 3, label %sw.bb
i32 4, label %sw.bb1
define i32 @main() #0 !dbg !8 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0, !dbg !12
}
define i32 @main() #0 !dbg !8 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0, !dbg !12
}
define i32 @main() #0 section "explicit_main_sec" !dbg !14 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
%call = call i32 @bar(), !dbg !15
ret i32 %call, !dbg !16
}
fence acquire, !dbg !9
fence release, !dbg !9
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
ret i32 0, !dbg !9
}
@g1 = dso_local global i32 0, align 4, !dbg !0
; Function Attrs: noinline nounwind optnone uwtable
-define dso_local i32 @foo(%struct.t1* %arg) #0 !dbg !16 {
+define dso_local i32 @foo(ptr %arg) #0 !dbg !16 {
entry:
- %arg.addr = alloca %struct.t1*, align 8
- store %struct.t1* %arg, %struct.t1** %arg.addr, align 8
- call void @llvm.dbg.declare(metadata %struct.t1** %arg.addr, metadata !23, metadata !DIExpression()), !dbg !24
- %0 = load %struct.t1*, %struct.t1** %arg.addr, align 8, !dbg !25
- %a = getelementptr inbounds %struct.t1, %struct.t1* %0, i32 0, i32 0, !dbg !26
- %1 = load i32, i32* %a, align 4, !dbg !26
+ %arg.addr = alloca ptr, align 8
+ store ptr %arg, ptr %arg.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %arg.addr, metadata !23, metadata !DIExpression()), !dbg !24
+ %0 = load ptr, ptr %arg.addr, align 8, !dbg !25
+ %1 = load i32, ptr %0, align 4, !dbg !26
ret i32 %1, !dbg !27
}
; Compilation flag:
; clang -target x86_64 -g -S -emit-llvm t.c
-@g = dso_local global i32*** null, align 8, !dbg !0
+@g = dso_local global ptr null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!13, !14, !15, !16, !17}
; RUN: opt -instcombine -S -o - < %s | FileCheck %s
-; CHECK-LABEL: %4 = load i32, i32* %i1_311
-; CHECK: call void @llvm.dbg.value(metadata i32 %4
+; CHECK-LABEL: %3 = load i32, ptr %i1_311
+; CHECK: call void @llvm.dbg.value(metadata i32 %3
; Next instruction should not be duplicate dbg.value intrinsic.
; CHECK-NEXT: @f90io_sc_i_ldw
define void @MAIN_() local_unnamed_addr !dbg !2 {
L.entry:
- call void (i8*, ...) bitcast (void (...)* @fort_init to void (i8*, ...)*)(i8* bitcast (i32* @.C283_MAIN_ to i8*)), !dbg !16
+ call void (ptr, ...) @fort_init(ptr @.C283_MAIN_), !dbg !16
%0 = call fastcc i32 @main_mfun(), !dbg !18
- store i32 %0, i32* bitcast (%struct.BSS1* @.BSS1 to i32*), align 32, !dbg !18
- call void (i8*, i8*, i64, ...) bitcast (void (...)* @f90io_src_info03a to void (i8*, i8*, i64, ...)*)(i8* bitcast (i32* @.C302_MAIN_ to i8*), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.C300_MAIN_, i64 0, i64 0), i64 22), !dbg !23
- %1 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @f90io_print_init to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* bitcast (i32* @.C303_MAIN_ to i8*), i8* null, i8* bitcast (i32* @.C283_MAIN_ to i8*), i8* bitcast (i32* @.C283_MAIN_ to i8*)), !dbg !23
+ store i32 %0, ptr @.BSS1, align 32, !dbg !18
+ call void (ptr, ptr, i64, ...) @f90io_src_info03a(ptr @.C302_MAIN_, ptr @.C300_MAIN_, i64 22), !dbg !23
+ %1 = call i32 (ptr, ptr, ptr, ptr, ...) @f90io_print_init(ptr @.C303_MAIN_, ptr null, ptr @.C283_MAIN_, ptr @.C283_MAIN_), !dbg !23
call void @llvm.dbg.value(metadata i32 %1, metadata !24, metadata !DIExpression()), !dbg !25
- %2 = load i32, i32* bitcast (%struct.BSS1* @.BSS1 to i32*), align 32, !dbg !23
- %3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @f90io_sc_i_ldw to i32 (i32, i32, ...)*)(i32 %2, i32 25), !dbg !23
+ %2 = load i32, ptr @.BSS1, align 32, !dbg !23
+ %3 = call i32 (i32, i32, ...) @f90io_sc_i_ldw(i32 %2, i32 25), !dbg !23
call void @llvm.dbg.value(metadata i32 %3, metadata !24, metadata !DIExpression()), !dbg !25
%4 = call i32 (...) @f90io_ldw_end(), !dbg !23
call void @llvm.dbg.value(metadata i32 %4, metadata !24, metadata !DIExpression()), !dbg !25
define internal fastcc signext i32 @main_mfun() unnamed_addr !dbg !27 {
L.entry:
%i1_311 = alloca i32, align 4
- call void @llvm.dbg.declare(metadata i64* undef, metadata !31, metadata !DIExpression()), !dbg !33
- call void @llvm.dbg.declare(metadata i32* %i1_311, metadata !35, metadata !DIExpression()), !dbg !33
- store i32 5, i32* %i1_311, align 4, !dbg !36
- %0 = bitcast i32* %i1_311 to i64*, !dbg !41
- %1 = call fastcc float @main_fun(i64* %0), !dbg !41
- %2 = fptosi float %1 to i32, !dbg !41
- call void (i8*, i8*, i64, ...) bitcast (void (...)* @f90io_src_info03a to void (i8*, i8*, i64, ...)*)(i8* bitcast (i32* @.C313_main_mfun to i8*), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.C300_main_mfun, i32 0, i32 0), i64 22), !dbg !42
- %3 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @f90io_print_init to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* bitcast (i32* @.C302_main_mfun to i8*), i8* null, i8* bitcast (i32* @.C283_main_mfun to i8*), i8* bitcast (i32* @.C283_main_mfun to i8*)), !dbg !42
- call void @llvm.dbg.value(metadata i32 %3, metadata !43, metadata !DIExpression()), !dbg !33
- %4 = load i32, i32* %i1_311, align 4, !dbg !42
- call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
- %5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @f90io_sc_i_ldw to i32 (i32, i32, ...)*)(i32 %4, i32 25), !dbg !42
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !31, metadata !DIExpression()), !dbg !33
+ call void @llvm.dbg.declare(metadata ptr %i1_311, metadata !35, metadata !DIExpression()), !dbg !33
+ store i32 5, ptr %i1_311, align 4, !dbg !36
+ %0 = call fastcc float @main_fun(ptr %i1_311), !dbg !41
+ %1 = fptosi float %0 to i32, !dbg !41
+ call void (ptr, ptr, i64, ...) @f90io_src_info03a(ptr @.C313_main_mfun, ptr @.C300_main_mfun, i64 22), !dbg !42
+ %2 = call i32 (ptr, ptr, ptr, ptr, ...) @f90io_print_init(ptr @.C302_main_mfun, ptr null, ptr @.C283_main_mfun, ptr @.C283_main_mfun), !dbg !42
+ call void @llvm.dbg.value(metadata i32 %2, metadata !43, metadata !DIExpression()), !dbg !33
+ %3 = load i32, ptr %i1_311, align 4, !dbg !42
+ call void @llvm.dbg.value(metadata i32 %3, metadata !35, metadata !DIExpression()), !dbg !33
+ %4 = call i32 (i32, i32, ...) @f90io_sc_i_ldw(i32 %3, i32 25), !dbg !42
+ call void @llvm.dbg.value(metadata i32 %4, metadata !43, metadata !DIExpression()), !dbg !33
+ %5 = call i32 (...) @f90io_ldw_end(), !dbg !42
call void @llvm.dbg.value(metadata i32 %5, metadata !43, metadata !DIExpression()), !dbg !33
- %6 = call i32 (...) @f90io_ldw_end(), !dbg !42
- call void @llvm.dbg.value(metadata i32 %6, metadata !43, metadata !DIExpression()), !dbg !33
- ret i32 %2, !dbg !44
+ ret i32 %1, !dbg !44
}
-define internal fastcc float @main_fun(i64* noalias %a) unnamed_addr !dbg !45 {
+define internal fastcc float @main_fun(ptr noalias %a) unnamed_addr !dbg !45 {
L.entry:
- call void @llvm.dbg.declare(metadata i64* %a, metadata !50, metadata !DIExpression()), !dbg !51
- call void @llvm.dbg.declare(metadata i64* undef, metadata !53, metadata !DIExpression()), !dbg !51
- %0 = bitcast i64* %a to i32*, !dbg !54
- %1 = load i32, i32* %0, align 4, !dbg !54
- %2 = sitofp i32 %1 to float, !dbg !54
- ret float %2, !dbg !59
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !50, metadata !DIExpression()), !dbg !51
+ call void @llvm.dbg.declare(metadata ptr undef, metadata !53, metadata !DIExpression()), !dbg !51
+ %0 = load i32, ptr %a, align 4, !dbg !54
+ %1 = sitofp i32 %0 to float, !dbg !54
+ ret float %1, !dbg !59
}
declare signext i32 @f90io_ldw_end(...) local_unnamed_addr
define void @MAIN_() !dbg !5 {
L.entry:
- %.Z0640_333 = alloca i32*, align 8
+ %.Z0640_333 = alloca ptr, align 8
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !14
- call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !15, metadata !DIExpression()), !dbg !14
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !14
+ call void @llvm.dbg.declare(metadata ptr %.Z0640_333, metadata !15, metadata !DIExpression()), !dbg !14
ret void, !dbg !17
}
define void @MAIN_() !dbg !5 {
L.entry:
- %.Z0640_333 = alloca i32*, align 8
+ %.Z0640_333 = alloca ptr, align 8
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !16
- call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !14, metadata !DIExpression()), !dbg !16
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !16
+ call void @llvm.dbg.declare(metadata ptr %.Z0640_333, metadata !14, metadata !DIExpression()), !dbg !16
ret void, !dbg !17
}
entry:
%retval = alloca i32, align 4
%var = alloca i32, align 4
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i32* %var, metadata !11, metadata !DIExpression(DW_OP_push_object_address)), !dbg !12
- %0 = load i32, i32* %var, align 4, !dbg !13
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %var, metadata !11, metadata !DIExpression(DW_OP_push_object_address)), !dbg !12
+ %0 = load i32, ptr %var, align 4, !dbg !13
ret i32 %0, !dbg !14
}
define void @MAIN_() !dbg !5 {
L.entry:
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
ret void, !dbg !14
}
define void @MAIN_() !dbg !5 {
L.entry:
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
ret void, !dbg !14
}
define void @MAIN_() !dbg !5 {
L.entry:
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !13
ret void, !dbg !14
}
define void @MAIN_() !dbg !5 {
L.entry:
- %.Z0640_333 = alloca i32*, align 8
+ %.Z0640_333 = alloca ptr, align 8
%"arr$sd1_349" = alloca [16 x i64], align 8
- call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !8, metadata !DIExpression(DW_OP_deref)), !dbg !17
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !13, metadata !DIExpression(DW_OP_plus_uconst, 80)), !dbg !17
- call void @llvm.dbg.value(metadata [16 x i64]* %"arr$sd1_349", metadata !16, metadata !DIExpression(DW_OP_plus_uconst, 112, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul)), !dbg !17
- call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !15, metadata !DIExpression(DW_OP_plus_uconst, 120)), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %.Z0640_333, metadata !8, metadata !DIExpression(DW_OP_deref)), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !13, metadata !DIExpression(DW_OP_plus_uconst, 80)), !dbg !17
+ call void @llvm.dbg.value(metadata ptr %"arr$sd1_349", metadata !16, metadata !DIExpression(DW_OP_plus_uconst, 112, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul)), !dbg !17
+ call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !15, metadata !DIExpression(DW_OP_plus_uconst, 120)), !dbg !17
ret void, !dbg !18
}
br label %for.cond
for.cond: ; preds = %for.cond.loopexit, %entry
- %.pr = load i32, i32* @foo, align 4
+ %.pr = load i32, ptr @foo, align 4
%tobool1 = icmp eq i32 %.pr, 0
br i1 %tobool1, label %for.cond.loopexit, label %for.inc.preheader
br label %for.inc
for.inc: ; preds = %for.inc.preheader, %for.inc
- %val = load i8, i8* @x
+ %val = load i8, ptr @x
%conv = sext i8 %val to i32
- store i32 %conv, i32* @foo, align 4
+ store i32 %conv, ptr @foo, align 4
%tobool = icmp eq i8 %val, 0
br i1 %tobool, label %for.cond.loopexit.loopexit, label %for.inc
}
%zero = type [0 x [10 x i32]]
;; The constant and variable offsets should be applied correctly.
-; CHECK: call void @llvm.dbg.value(metadata !DIArgList(%struct.S* %ptr, i64 %offset),
+; CHECK: call void @llvm.dbg.value(metadata !DIArgList(ptr %ptr, i64 %offset),
; CHECK-SAME: ![[VAR_OFFSET_PTR:[0-9]+]],
; CHECK-SAME: !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_constu, 8, DW_OP_mul, DW_OP_plus, DW_OP_plus_uconst, 4, DW_OP_stack_value))
;; The variable offset should be ignored, as it applies to a type of width 0,
;; leaving only the constant offset.
-; CHECK: call void @llvm.dbg.value(metadata [0 x [10 x i32]]* %zptr,
+; CHECK: call void @llvm.dbg.value(metadata ptr %zptr,
; CHECK-SAME: ![[VAR_ZERO_PTR:[0-9]+]],
; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 44, DW_OP_stack_value))
; CHECK: ![[VAR_OFFSET_PTR]] = !DILocalVariable(name: "offset_ptr"
; CHECK: ![[VAR_ZERO_PTR]] = !DILocalVariable(name: "zero_ptr"
-define void @"?foo@@YAXPEAUS@@_J@Z"(%struct.S* %ptr, %zero* %zptr, i64 %offset) !dbg !8 {
+define void @"?foo@@YAXPEAUS@@_J@Z"(ptr %ptr, ptr %zptr, i64 %offset) !dbg !8 {
entry:
call void @llvm.dbg.value(metadata i64 %offset, metadata !20, metadata !DIExpression()), !dbg !24
- call void @llvm.dbg.value(metadata %struct.S* %ptr, metadata !21, metadata !DIExpression()), !dbg !24
- %arrayidx = getelementptr inbounds %struct.S, %struct.S* %ptr, i64 %offset, !dbg !25
- %b = getelementptr inbounds %struct.S, %struct.S* %arrayidx, i32 0, i32 1, !dbg !25
- %c = getelementptr inbounds %zero, %zero* %zptr, i64 %offset, i32 1, i32 1, !dbg !25
- call void @llvm.dbg.value(metadata i32* %b, metadata !22, metadata !DIExpression()), !dbg !24
- call void @llvm.dbg.value(metadata i32* %c, metadata !27, metadata !DIExpression()), !dbg !24
+ call void @llvm.dbg.value(metadata ptr %ptr, metadata !21, metadata !DIExpression()), !dbg !24
+ %arrayidx = getelementptr inbounds %struct.S, ptr %ptr, i64 %offset, !dbg !25
+ %b = getelementptr inbounds %struct.S, ptr %arrayidx, i32 0, i32 1, !dbg !25
+ %c = getelementptr inbounds %zero, ptr %zptr, i64 %offset, i32 1, i32 1, !dbg !25
+ call void @llvm.dbg.value(metadata ptr %b, metadata !22, metadata !DIExpression()), !dbg !24
+ call void @llvm.dbg.value(metadata ptr %c, metadata !27, metadata !DIExpression()), !dbg !24
ret void, !dbg !26
}
%y = alloca i64, align 8
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %0 = load i64, i64* %x.addr, align 8
- %1 = bitcast i64* %y to i8*
- call void @llvm.dbg.declare(metadata i64* %y, metadata !15, metadata !DIExpression())
+ %0 = load i64, ptr %x.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %y, metadata !15, metadata !DIExpression())
, !dbg !29
- %2 = load i64, i64* %x.addr, align 8
- %add = add i64 %2, -9223372036854775808
- store i64 %add, i64* %y, align 8
+ %1 = load i64, ptr %x.addr, align 8
+ %add = add i64 %1, -9223372036854775808
+ store i64 %add, ptr %y, align 8
br label %for.cond
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; CHECK-NOT: llvm.dbg.value(metadata !
; CHECK: ret void
-%class.anon = type { i8*, i8*, i8* }
+%class.anon = type { ptr, ptr, ptr }
; Function Attrs: nounwind uwtable
define dso_local void @_Z4testv() local_unnamed_addr !dbg !7 {
%b = alloca i8, align 1
%c = alloca i8, align 1
%ref.tmp = alloca %class.anon, align 8
- call void @llvm.dbg.value(metadata i8* %a, metadata !12, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ call void @llvm.dbg.value(metadata ptr %a, metadata !12, metadata !DIExpression(DW_OP_deref)), !dbg !16
call void @llvm.dbg.value(metadata i8 0, metadata !12, metadata !DIExpression()), !dbg !16
- store i8 0, i8* %a, align 1, !dbg !16
- call void @llvm.dbg.value(metadata i8* %b, metadata !14, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ store i8 0, ptr %a, align 1, !dbg !16
+ call void @llvm.dbg.value(metadata ptr %b, metadata !14, metadata !DIExpression(DW_OP_deref)), !dbg !16
call void @llvm.dbg.value(metadata i8 0, metadata !14, metadata !DIExpression()), !dbg !16
- store i8 0, i8* %b, align 1, !dbg !16
- call void @llvm.dbg.value(metadata i8* %c, metadata !15, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ store i8 0, ptr %b, align 1, !dbg !16
+ call void @llvm.dbg.value(metadata ptr %c, metadata !15, metadata !DIExpression(DW_OP_deref)), !dbg !16
call void @llvm.dbg.value(metadata i8 0, metadata !15, metadata !DIExpression()), !dbg !16
- store i8 0, i8* %c, align 1, !dbg !16
- %0 = bitcast %class.anon* %ref.tmp to i8*, !dbg !16
- %1 = getelementptr inbounds %class.anon, %class.anon* %ref.tmp, i64 0, i32 0, !dbg !16
- store i8* %a, i8** %1, align 8, !dbg !16
- %2 = getelementptr inbounds %class.anon, %class.anon* %ref.tmp, i64 0, i32 1, !dbg !16
- store i8* %b, i8** %2, align 8, !dbg !16
- %3 = getelementptr inbounds %class.anon, %class.anon* %ref.tmp, i64 0, i32 2, !dbg !16
- store i8* %c, i8** %3, align 8, !dbg !16
- call fastcc void @"_ZZ4testvENK3$_0clEv"(%class.anon* nonnull %ref.tmp), !dbg !16
- %4 = load i8, i8* %a, align 1, !dbg !17
- call void @llvm.dbg.value(metadata i8 %4, metadata !12, metadata !DIExpression()), !dbg !16
- %tobool = icmp eq i8 %4, 0, !dbg !17
+ store i8 0, ptr %c, align 1, !dbg !16
+ store ptr %a, ptr %ref.tmp, align 8, !dbg !16
+ %0 = getelementptr inbounds %class.anon, ptr %ref.tmp, i64 0, i32 1, !dbg !16
+ store ptr %b, ptr %0, align 8, !dbg !16
+ %1 = getelementptr inbounds %class.anon, ptr %ref.tmp, i64 0, i32 2, !dbg !16
+ store ptr %c, ptr %1, align 8, !dbg !16
+ call fastcc void @"_ZZ4testvENK3$_0clEv"(ptr nonnull %ref.tmp), !dbg !16
+ %2 = load i8, ptr %a, align 1, !dbg !17
+ call void @llvm.dbg.value(metadata i8 %2, metadata !12, metadata !DIExpression()), !dbg !16
+ %tobool = icmp eq i8 %2, 0, !dbg !17
br i1 %tobool, label %lor.lhs.false, label %if.then, !dbg !17
lor.lhs.false: ; preds = %entry
- %5 = load i8, i8* %b, align 1, !dbg !17
- call void @llvm.dbg.value(metadata i8 %5, metadata !14, metadata !DIExpression()), !dbg !16
- %tobool1 = icmp eq i8 %5, 0, !dbg !17
+ %3 = load i8, ptr %b, align 1, !dbg !17
+ call void @llvm.dbg.value(metadata i8 %3, metadata !14, metadata !DIExpression()), !dbg !16
+ %tobool1 = icmp eq i8 %3, 0, !dbg !17
br i1 %tobool1, label %lor.lhs.false2, label %if.then, !dbg !17
lor.lhs.false2: ; preds = %lor.lhs.false
- %6 = load i8, i8* %c, align 1, !dbg !17
- call void @llvm.dbg.value(metadata i8 %6, metadata !15, metadata !DIExpression()), !dbg !16
- %tobool3 = icmp eq i8 %6, 0, !dbg !17
+ %4 = load i8, ptr %c, align 1, !dbg !17
+ call void @llvm.dbg.value(metadata i8 %4, metadata !15, metadata !DIExpression()), !dbg !16
+ %tobool3 = icmp eq i8 %4, 0, !dbg !17
br i1 %tobool3, label %if.end, label %if.then, !dbg !16
if.then: ; preds = %lor.lhs.false2, %lor.lhs.false, %entry
br label %if.end, !dbg !19
if.end: ; preds = %lor.lhs.false2, %if.then
- call void @llvm.dbg.value(metadata i8* %c, metadata !15, metadata !DIExpression(DW_OP_deref)), !dbg !16
- call void @llvm.dbg.value(metadata i8* %b, metadata !14, metadata !DIExpression(DW_OP_deref)), !dbg !16
- call void @llvm.dbg.value(metadata i8* %a, metadata !12, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ call void @llvm.dbg.value(metadata ptr %c, metadata !15, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ call void @llvm.dbg.value(metadata ptr %b, metadata !14, metadata !DIExpression(DW_OP_deref)), !dbg !16
+ call void @llvm.dbg.value(metadata ptr %a, metadata !12, metadata !DIExpression(DW_OP_deref)), !dbg !16
ret void, !dbg !16
}
; Function Attrs: inlinehint nounwind uwtable
-define internal fastcc void @"_ZZ4testvENK3$_0clEv"(%class.anon* %this) unnamed_addr align 2 !dbg !21 {
+define internal fastcc void @"_ZZ4testvENK3$_0clEv"(ptr %this) unnamed_addr align 2 !dbg !21 {
entry:
- call void @llvm.dbg.value(metadata %class.anon* %this, metadata !34, metadata !DIExpression()), !dbg !36
- %0 = getelementptr inbounds %class.anon, %class.anon* %this, i32 0, i32 1, !dbg !36
- %1 = load i8*, i8** %0, align 8, !dbg !36
- store i8 1, i8* %1, align 1, !dbg !36
+ call void @llvm.dbg.value(metadata ptr %this, metadata !34, metadata !DIExpression()), !dbg !36
+ %0 = getelementptr inbounds %class.anon, ptr %this, i32 0, i32 1, !dbg !36
+ %1 = load ptr, ptr %0, align 8, !dbg !36
+ store i8 1, ptr %1, align 1, !dbg !36
ret void, !dbg !36
}
target triple = "x86_64-unknown-linux-gnu"
@b = common local_unnamed_addr global i32 0, align 4, !dbg !0
-@a = common local_unnamed_addr global i32* null, align 8, !dbg !6
+@a = common local_unnamed_addr global ptr null, align 8, !dbg !6
; Test that loop remainder unrolling doesn't corrupt debuginfo. This example
; used to cause an assert, but also test that the unrolled backwards branches
;
; CHECK-LABEL: @func_c(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[DOTPR:%.*]] = load i32, i32* @b, align 4, !dbg [[DBG17:![0-9]+]], !tbaa [[TBAA20:![0-9]+]]
+; CHECK-NEXT: [[DOTPR:%.*]] = load i32, ptr @b, align 4, !dbg [[DBG17:![0-9]+]], !tbaa [[TBAA20:![0-9]+]]
; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[DOTPR]], 0, !dbg [[DBG24:![0-9]+]]
; CHECK-NEXT: br i1 [[TOBOOL1]], label [[FOR_END:%.*]], label [[FOR_BODY_LR_PH:%.*]], !dbg [[DBG24]]
; CHECK: for.body.lr.ph:
-; CHECK-NEXT: [[A_PROMOTED:%.*]] = load i32*, i32** @a, align 8, !dbg [[DBG25:![0-9]+]], !tbaa [[TBAA26:![0-9]+]]
+; CHECK-NEXT: [[A_PROMOTED:%.*]] = load ptr, ptr @a, align 8, !dbg [[DBG25:![0-9]+]], !tbaa [[TBAA26:![0-9]+]]
; CHECK-NEXT: [[TMP0:%.*]] = sub i32 -2, [[DOTPR]], !dbg [[DBG24]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], -2, !dbg [[DBG24]]
; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[DOTPR]], [[TMP1]], !dbg [[DBG24]]
; CHECK: for.body.prol.preheader:
; CHECK-NEXT: br label [[FOR_BODY_PROL:%.*]], !dbg [[DBG24]]
; CHECK: for.body.prol:
-; CHECK-NEXT: [[ARRAYIDX_PROL:%.*]] = getelementptr inbounds i32, i32* [[A_PROMOTED]], i64 1, !dbg [[DBG28:![0-9]+]]
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[ARRAYIDX_PROL]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_PROL:%.*]] = getelementptr inbounds i32, ptr [[A_PROMOTED]], i64 1, !dbg [[DBG28:![0-9]+]]
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[ARRAYIDX_PROL]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_PROL:%.*]] = sext i32 [[TMP5]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP6:%.*]] = inttoptr i64 [[CONV_PROL]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP6:%.*]] = inttoptr i64 [[CONV_PROL]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_PROL:%.*]] = add nsw i32 [[DOTPR]], 2, !dbg [[DBG29:![0-9]+]]
; CHECK-NEXT: [[PROL_ITER_CMP:%.*]] = icmp ne i32 1, [[XTRAITER]], !dbg [[DBG24]]
; CHECK-NEXT: br i1 [[PROL_ITER_CMP]], label [[FOR_BODY_PROL_1:%.*]], label [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA:%.*]], !dbg [[DBG24]]
; CHECK: for.body.prol.1:
-; CHECK-NEXT: [[ARRAYIDX_PROL_1:%.*]] = getelementptr inbounds i32, i32* [[TMP6]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* [[ARRAYIDX_PROL_1]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_PROL_1:%.*]] = getelementptr inbounds i32, ptr [[TMP6]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX_PROL_1]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_PROL_1:%.*]] = sext i32 [[TMP7]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP8:%.*]] = inttoptr i64 [[CONV_PROL_1]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP8:%.*]] = inttoptr i64 [[CONV_PROL_1]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_PROL_1:%.*]] = add nsw i32 [[ADD_PROL]], 2, !dbg [[DBG29]]
; CHECK-NEXT: [[PROL_ITER_CMP_1:%.*]] = icmp ne i32 2, [[XTRAITER]], !dbg [[DBG24]]
; CHECK-NEXT: br i1 [[PROL_ITER_CMP_1]], label [[FOR_BODY_PROL_2:%.*]], label [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]], !dbg [[DBG24]]
; CHECK: for.body.prol.2:
-; CHECK-NEXT: [[ARRAYIDX_PROL_2:%.*]] = getelementptr inbounds i32, i32* [[TMP8]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[ARRAYIDX_PROL_2]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_PROL_2:%.*]] = getelementptr inbounds i32, ptr [[TMP8]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[ARRAYIDX_PROL_2]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_PROL_2:%.*]] = sext i32 [[TMP9]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP10:%.*]] = inttoptr i64 [[CONV_PROL_2]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP10:%.*]] = inttoptr i64 [[CONV_PROL_2]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_PROL_2:%.*]] = add nsw i32 [[ADD_PROL_1]], 2, !dbg [[DBG29]]
; CHECK-NEXT: br label [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]]
; CHECK: for.body.prol.loopexit.unr-lcssa:
-; CHECK-NEXT: [[DOTLCSSA_UNR_PH:%.*]] = phi i32* [ [[TMP6]], [[FOR_BODY_PROL]] ], [ [[TMP8]], [[FOR_BODY_PROL_1]] ], [ [[TMP10]], [[FOR_BODY_PROL_2]] ]
-; CHECK-NEXT: [[DOTUNR_PH:%.*]] = phi i32* [ [[TMP6]], [[FOR_BODY_PROL]] ], [ [[TMP8]], [[FOR_BODY_PROL_1]] ], [ [[TMP10]], [[FOR_BODY_PROL_2]] ]
+; CHECK-NEXT: [[DOTLCSSA_UNR_PH:%.*]] = phi ptr [ [[TMP6]], [[FOR_BODY_PROL]] ], [ [[TMP8]], [[FOR_BODY_PROL_1]] ], [ [[TMP10]], [[FOR_BODY_PROL_2]] ]
+; CHECK-NEXT: [[DOTUNR_PH:%.*]] = phi ptr [ [[TMP6]], [[FOR_BODY_PROL]] ], [ [[TMP8]], [[FOR_BODY_PROL_1]] ], [ [[TMP10]], [[FOR_BODY_PROL_2]] ]
; CHECK-NEXT: [[DOTUNR1_PH:%.*]] = phi i32 [ [[ADD_PROL]], [[FOR_BODY_PROL]] ], [ [[ADD_PROL_1]], [[FOR_BODY_PROL_1]] ], [ [[ADD_PROL_2]], [[FOR_BODY_PROL_2]] ]
; CHECK-NEXT: br label [[FOR_BODY_PROL_LOOPEXIT]], !dbg [[DBG24]]
; CHECK: for.body.prol.loopexit:
-; CHECK-NEXT: [[DOTLCSSA_UNR:%.*]] = phi i32* [ undef, [[FOR_BODY_LR_PH]] ], [ [[DOTLCSSA_UNR_PH]], [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]] ]
-; CHECK-NEXT: [[DOTUNR:%.*]] = phi i32* [ [[A_PROMOTED]], [[FOR_BODY_LR_PH]] ], [ [[DOTUNR_PH]], [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]] ]
+; CHECK-NEXT: [[DOTLCSSA_UNR:%.*]] = phi ptr [ undef, [[FOR_BODY_LR_PH]] ], [ [[DOTLCSSA_UNR_PH]], [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]] ]
+; CHECK-NEXT: [[DOTUNR:%.*]] = phi ptr [ [[A_PROMOTED]], [[FOR_BODY_LR_PH]] ], [ [[DOTUNR_PH]], [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]] ]
; CHECK-NEXT: [[DOTUNR1:%.*]] = phi i32 [ [[DOTPR]], [[FOR_BODY_LR_PH]] ], [ [[DOTUNR1_PH]], [[FOR_BODY_PROL_LOOPEXIT_UNR_LCSSA]] ]
; CHECK-NEXT: [[TMP11:%.*]] = icmp ult i32 [[TMP3]], 3, !dbg [[DBG24]]
; CHECK-NEXT: br i1 [[TMP11]], label [[FOR_COND_FOR_END_CRIT_EDGE:%.*]], label [[FOR_BODY_LR_PH_NEW:%.*]], !dbg [[DBG24]]
; CHECK: for.body.lr.ph.new:
; CHECK-NEXT: br label [[FOR_BODY:%.*]], !dbg [[DBG24]]
; CHECK: for.body:
-; CHECK-NEXT: [[TMP12:%.*]] = phi i32* [ [[DOTUNR]], [[FOR_BODY_LR_PH_NEW]] ], [ [[TMP21:%.*]], [[FOR_BODY]] ], !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP12:%.*]] = phi ptr [ [[DOTUNR]], [[FOR_BODY_LR_PH_NEW]] ], [ [[TMP21:%.*]], [[FOR_BODY]] ], !dbg [[DBG28]]
; CHECK-NEXT: [[TMP13:%.*]] = phi i32 [ [[DOTUNR1]], [[FOR_BODY_LR_PH_NEW]] ], [ [[ADD_3:%.*]], [[FOR_BODY]] ]
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[TMP12]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP14:%.*]] = load i32, i32* [[ARRAYIDX]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP12]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP14]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP15:%.*]] = inttoptr i64 [[CONV]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP15:%.*]] = inttoptr i64 [[CONV]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], 2, !dbg [[DBG29]]
-; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i32, i32* [[TMP15]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP16:%.*]] = load i32, i32* [[ARRAYIDX_1]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i32, ptr [[TMP15]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP16:%.*]] = load i32, ptr [[ARRAYIDX_1]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_1:%.*]] = sext i32 [[TMP16]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP17:%.*]] = inttoptr i64 [[CONV_1]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP17:%.*]] = inttoptr i64 [[CONV_1]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_1:%.*]] = add nsw i32 [[ADD]], 2, !dbg [[DBG29]]
-; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i32, i32* [[TMP17]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP18:%.*]] = load i32, i32* [[ARRAYIDX_2]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i32, ptr [[TMP17]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[ARRAYIDX_2]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_2:%.*]] = sext i32 [[TMP18]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP19:%.*]] = inttoptr i64 [[CONV_2]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP19:%.*]] = inttoptr i64 [[CONV_2]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_2:%.*]] = add nsw i32 [[ADD_1]], 2, !dbg [[DBG29]]
-; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i32, i32* [[TMP19]], i64 1, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP20:%.*]] = load i32, i32* [[ARRAYIDX_3]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
+; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i32, ptr [[TMP19]], i64 1, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARRAYIDX_3]], align 4, !dbg [[DBG28]], !tbaa [[TBAA20]]
; CHECK-NEXT: [[CONV_3:%.*]] = sext i32 [[TMP20]] to i64, !dbg [[DBG28]]
-; CHECK-NEXT: [[TMP21]] = inttoptr i64 [[CONV_3]] to i32*, !dbg [[DBG28]]
+; CHECK-NEXT: [[TMP21]] = inttoptr i64 [[CONV_3]] to ptr, !dbg [[DBG28]]
; CHECK-NEXT: [[ADD_3]] = add nsw i32 [[ADD_2]], 2, !dbg [[DBG29]]
; CHECK-NEXT: [[TOBOOL_3:%.*]] = icmp eq i32 [[ADD_3]], 0, !dbg [[DBG24]]
; CHECK-NEXT: br i1 [[TOBOOL_3]], label [[FOR_COND_FOR_END_CRIT_EDGE_UNR_LCSSA:%.*]], label [[FOR_BODY]], !dbg [[DBG24]], !llvm.loop [[LOOP30:![0-9]+]]
; CHECK: for.cond.for.end_crit_edge.unr-lcssa:
-; CHECK-NEXT: [[DOTLCSSA_PH:%.*]] = phi i32* [ [[TMP21]], [[FOR_BODY]] ]
+; CHECK-NEXT: [[DOTLCSSA_PH:%.*]] = phi ptr [ [[TMP21]], [[FOR_BODY]] ]
; CHECK-NEXT: br label [[FOR_COND_FOR_END_CRIT_EDGE]], !dbg [[DBG24]]
; CHECK: for.cond.for.end_crit_edge:
-; CHECK-NEXT: [[DOTLCSSA:%.*]] = phi i32* [ [[DOTLCSSA_UNR]], [[FOR_BODY_PROL_LOOPEXIT]] ], [ [[DOTLCSSA_PH]], [[FOR_COND_FOR_END_CRIT_EDGE_UNR_LCSSA]] ], !dbg [[DBG28]]
+; CHECK-NEXT: [[DOTLCSSA:%.*]] = phi ptr [ [[DOTLCSSA_UNR]], [[FOR_BODY_PROL_LOOPEXIT]] ], [ [[DOTLCSSA_PH]], [[FOR_COND_FOR_END_CRIT_EDGE_UNR_LCSSA]] ], !dbg [[DBG28]]
; CHECK-NEXT: [[TMP22:%.*]] = add i32 [[TMP2]], 2, !dbg [[DBG24]]
-; CHECK-NEXT: store i32* [[DOTLCSSA]], i32** @a, align 8, !dbg [[DBG25]], !tbaa [[TBAA26]]
-; CHECK-NEXT: store i32 [[TMP22]], i32* @b, align 4, !dbg [[DBG33:![0-9]+]], !tbaa [[TBAA20]]
+; CHECK-NEXT: store ptr [[DOTLCSSA]], ptr @a, align 8, !dbg [[DBG25]], !tbaa [[TBAA26]]
+; CHECK-NEXT: store i32 [[TMP22]], ptr @b, align 4, !dbg [[DBG33:![0-9]+]], !tbaa [[TBAA20]]
; CHECK-NEXT: br label [[FOR_END]], !dbg [[DBG24]]
; CHECK: for.end:
; CHECK-NEXT: ret i32 undef, !dbg [[DBG34:![0-9]+]]
;
entry:
- %.pr = load i32, i32* @b, align 4, !dbg !17, !tbaa !20
+ %.pr = load i32, ptr @b, align 4, !dbg !17, !tbaa !20
%tobool1 = icmp eq i32 %.pr, 0, !dbg !24
br i1 %tobool1, label %for.end, label %for.body.lr.ph, !dbg !24
for.body.lr.ph:
- %a.promoted = load i32*, i32** @a, align 8, !dbg !25, !tbaa !26
+ %a.promoted = load ptr, ptr @a, align 8, !dbg !25, !tbaa !26
%0 = sub i32 -2, %.pr, !dbg !24
%1 = and i32 %0, -2, !dbg !24
%2 = add i32 %.pr, %1, !dbg !24
br label %for.body, !dbg !24
for.body:
- %3 = phi i32* [ %a.promoted, %for.body.lr.ph ], [ %6, %for.body ], !dbg !28
+ %3 = phi ptr [ %a.promoted, %for.body.lr.ph ], [ %6, %for.body ], !dbg !28
%4 = phi i32 [ %.pr, %for.body.lr.ph ], [ %add, %for.body ]
- %arrayidx = getelementptr inbounds i32, i32* %3, i64 1, !dbg !28
- %5 = load i32, i32* %arrayidx, align 4, !dbg !28, !tbaa !20
+ %arrayidx = getelementptr inbounds i32, ptr %3, i64 1, !dbg !28
+ %5 = load i32, ptr %arrayidx, align 4, !dbg !28, !tbaa !20
%conv = sext i32 %5 to i64, !dbg !28
- %6 = inttoptr i64 %conv to i32*, !dbg !28
+ %6 = inttoptr i64 %conv to ptr, !dbg !28
%add = add nsw i32 %4, 2, !dbg !29
%tobool = icmp eq i32 %add, 0, !dbg !24
br i1 %tobool, label %for.cond.for.end_crit_edge, label %for.body, !dbg !24, !llvm.loop !30
for.cond.for.end_crit_edge:
%7 = add i32 %2, 2, !dbg !24
- store i32* %6, i32** @a, align 8, !dbg !25, !tbaa !26
- store i32 %7, i32* @b, align 4, !dbg !32, !tbaa !20
+ store ptr %6, ptr @a, align 8, !dbg !25, !tbaa !26
+ store i32 %7, ptr @b, align 4, !dbg !32, !tbaa !20
br label %for.end, !dbg !24
for.end:
define dso_local i32 @foo(i32 %i) !dbg !8 {
entry:
%i.addr = alloca i32, align 4
- store i32 %i, i32* %i.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !13, metadata !DIExpression()), !dbg !14
- %0 = load i32, i32* %i.addr, align 4, !dbg !15
+ store i32 %i, ptr %i.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %i.addr, metadata !13, metadata !DIExpression()), !dbg !14
+ %0 = load i32, ptr %i.addr, align 4, !dbg !15
%call = call i32 @goo(i32 %0), !dbg !16
ret i32 %call, !dbg !17
}