[opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.
A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)
import fileinput
import sys
import re
pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")
for line in sys.stdin:
sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7649
llvm-svn: 230794
diff --git a/llvm/test/Feature/aliases.ll b/llvm/test/Feature/aliases.ll
index c11fc47..f03e3cf 100644
--- a/llvm/test/Feature/aliases.ll
+++ b/llvm/test/Feature/aliases.ll
@@ -30,9 +30,9 @@
define i32 @test() {
entry:
- %tmp = load i32* @foo1
- %tmp1 = load i32* @foo2
- %tmp0 = load i32* @bar_i
+ %tmp = load i32, i32* @foo1
+ %tmp1 = load i32, i32* @foo2
+ %tmp0 = load i32, i32* @bar_i
%tmp2 = call i32 @foo_f()
%tmp3 = add i32 %tmp, %tmp2
%tmp4 = call %FunTy* @bar_f()
diff --git a/llvm/test/Feature/md_on_instruction.ll b/llvm/test/Feature/md_on_instruction.ll
index 511cc85..0785538 100644
--- a/llvm/test/Feature/md_on_instruction.ll
+++ b/llvm/test/Feature/md_on_instruction.ll
@@ -8,7 +8,7 @@
; <label>:0 ; preds = %entry
call void @llvm.dbg.region.end(metadata !0)
- %1 = load i32* %retval, !dbg !3 ; <i32> [#uses=1]
+ %1 = load i32, i32* %retval, !dbg !3 ; <i32> [#uses=1]
ret i32 %1, !dbg !3
}
diff --git a/llvm/test/Feature/memorymarkers.ll b/llvm/test/Feature/memorymarkers.ll
index 6643448..47dd1ee 100644
--- a/llvm/test/Feature/memorymarkers.ll
+++ b/llvm/test/Feature/memorymarkers.ll
@@ -26,7 +26,7 @@
;; Constructor has finished here.
%inv = call {}* @llvm.invariant.start(i64 8, i8* %y)
call void @_Z3barRKi(i32* %0) nounwind
- %2 = load i32* %0, align 8
+ %2 = load i32, i32* %0, align 8
;; Destructor is run here.
call void @llvm.invariant.end({}* %inv, i64 8, i8* %y)
diff --git a/llvm/test/Feature/optnone-llc.ll b/llvm/test/Feature/optnone-llc.ll
index f19fa88f..b848b19 100644
--- a/llvm/test/Feature/optnone-llc.ll
+++ b/llvm/test/Feature/optnone-llc.ll
@@ -17,7 +17,7 @@
br label %while.cond
while.cond: ; preds = %while.body, %entry
- %0 = load i32* %x.addr, align 4
+ %0 = load i32, i32* %x.addr, align 4
%dec = add nsw i32 %0, -1
store i32 %dec, i32* %x.addr, align 4
%tobool = icmp ne i32 %0, 0
diff --git a/llvm/test/Feature/optnone-opt.ll b/llvm/test/Feature/optnone-opt.ll
index f83e68c..a17f977 100644
--- a/llvm/test/Feature/optnone-opt.ll
+++ b/llvm/test/Feature/optnone-opt.ll
@@ -18,7 +18,7 @@
br label %while.cond
while.cond: ; preds = %while.body, %entry
- %0 = load i32* %x.addr, align 4
+ %0 = load i32, i32* %x.addr, align 4
%dec = add nsw i32 %0, -1
store i32 %dec, i32* %x.addr, align 4
%tobool = icmp ne i32 %0, 0
diff --git a/llvm/test/Feature/packed.ll b/llvm/test/Feature/packed.ll
index b86a227..fa29535 100644
--- a/llvm/test/Feature/packed.ll
+++ b/llvm/test/Feature/packed.ll
@@ -8,8 +8,8 @@
define void @main() {
store <4 x float> < float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 >, <4 x float>* @foo1
store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo2
- %l1 = load <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
- %l2 = load <2 x i32>* @foo2 ; <<2 x i32>> [#uses=0]
+ %l1 = load <4 x float>, <4 x float>* @foo1 ; <<4 x float>> [#uses=0]
+ %l2 = load <2 x i32>, <2 x i32>* @foo2 ; <<2 x i32>> [#uses=0]
ret void
}
diff --git a/llvm/test/Feature/packed_struct.ll b/llvm/test/Feature/packed_struct.ll
index 0766649..5909f99 100644
--- a/llvm/test/Feature/packed_struct.ll
+++ b/llvm/test/Feature/packed_struct.ll
@@ -16,9 +16,9 @@
define i32 @main()
{
- %tmp = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; <i32> [#uses=1]
- %tmp3 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; <i32> [#uses=1]
- %tmp6 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; <i32> [#uses=1]
+ %tmp = load i32, i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; <i32> [#uses=1]
+ %tmp3 = load i32, i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; <i32> [#uses=1]
+ %tmp6 = load i32, i32* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; <i32> [#uses=1]
%tmp4 = add i32 %tmp3, %tmp ; <i32> [#uses=1]
%tmp7 = add i32 %tmp4, %tmp6 ; <i32> [#uses=1]
ret i32 %tmp7
@@ -26,8 +26,8 @@
define i32 @bar() {
entry:
- %tmp = load i32* getelementptr([2 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; <i32> [#uses=1]
- %tmp4 = load i32* getelementptr ([2 x <{ i32, i8 }>]* @bara, i32 0, i32 1, i32 0) ; <i32> [#uses=1]
+ %tmp = load i32, i32* getelementptr([2 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; <i32> [#uses=1]
+ %tmp4 = load i32, i32* getelementptr ([2 x <{ i32, i8 }>]* @bara, i32 0, i32 1, i32 0) ; <i32> [#uses=1]
%tmp5 = add i32 %tmp4, %tmp ; <i32> [#uses=1]
ret i32 %tmp5
}
diff --git a/llvm/test/Feature/ppcld.ll b/llvm/test/Feature/ppcld.ll
index 393a491..6f56619 100644
--- a/llvm/test/Feature/ppcld.ll
+++ b/llvm/test/Feature/ppcld.ll
@@ -12,15 +12,15 @@
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
+ %tmp = load float, float* @f ; <float> [#uses=1]
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
+ %tmp2 = load double, double* @d ; <double> [#uses=1]
%tmp3 = fmul double %tmp1, %tmp2 ; <double> [#uses=1]
%tmp4 = fpext double %tmp3 to ppc_fp128 ; <ppc_fp128> [#uses=1]
store ppc_fp128 %tmp4, ppc_fp128* @ld
br label %return
return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
+ %retval4 = load i32, i32* %retval ; <i32> [#uses=1]
ret i32 %retval4
}
diff --git a/llvm/test/Feature/recursivetype.ll b/llvm/test/Feature/recursivetype.ll
index 133704c..b040696 100644
--- a/llvm/test/Feature/recursivetype.ll
+++ b/llvm/test/Feature/recursivetype.ll
@@ -43,7 +43,7 @@
define void @InsertIntoListTail(%list** %L, i32 %Data) {
bb1:
- %reg116 = load %list** %L ; <%list*> [#uses=1]
+ %reg116 = load %list*, %list** %L ; <%list*> [#uses=1]
%cast1004 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
%cond1000 = icmp eq %list* %reg116, %cast1004 ; <i1> [#uses=1]
br i1 %cond1000, label %bb3, label %bb2
@@ -51,8 +51,8 @@
bb2: ; preds = %bb2, %bb1
%reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ; <%list**> [#uses=1]
%cast1010 = bitcast %list** %reg117 to %list*** ; <%list***> [#uses=1]
- %reg118 = load %list*** %cast1010 ; <%list**> [#uses=3]
- %reg109 = load %list** %reg118 ; <%list*> [#uses=1]
+ %reg118 = load %list**, %list*** %cast1010 ; <%list**> [#uses=3]
+ %reg109 = load %list*, %list** %reg118 ; <%list*> [#uses=1]
%cast1005 = inttoptr i64 0 to %list* ; <%list*> [#uses=1]
%cond1001 = icmp ne %list* %reg109, %cast1005 ; <i1> [#uses=1]
br i1 %cond1001, label %bb2, label %bb3
@@ -88,7 +88,7 @@
bb4: ; preds = %bb2
%idx = getelementptr %list, %list* %reg115, i64 0, i32 1 ; <i32*> [#uses=1]
- %reg111 = load i32* %idx ; <i32> [#uses=1]
+ %reg111 = load i32, i32* %idx ; <i32> [#uses=1]
%cond1013 = icmp ne i32 %reg111, %Data ; <i1> [#uses=1]
br i1 %cond1013, label %bb6, label %bb5
@@ -97,7 +97,7 @@
bb6: ; preds = %bb4
%idx2 = getelementptr %list, %list* %reg115, i64 0, i32 0 ; <%list**> [#uses=1]
- %reg116 = load %list** %idx2 ; <%list*> [#uses=1]
+ %reg116 = load %list*, %list** %idx2 ; <%list*> [#uses=1]
br label %bb2
}
diff --git a/llvm/test/Feature/sparcld.ll b/llvm/test/Feature/sparcld.ll
index 095f6f6..f5a24f5 100644
--- a/llvm/test/Feature/sparcld.ll
+++ b/llvm/test/Feature/sparcld.ll
@@ -10,15 +10,15 @@
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
+ %tmp = load float, float* @f ; <float> [#uses=1]
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
+ %tmp2 = load double, double* @d ; <double> [#uses=1]
%tmp3 = fmul double %tmp1, %tmp2 ; <double> [#uses=1]
%tmp4 = fpext double %tmp3 to fp128 ; <fp128> [#uses=1]
store fp128 %tmp4, fp128* @ld
br label %return
return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
+ %retval4 = load i32, i32* %retval ; <i32> [#uses=1]
ret i32 %retval4
}
diff --git a/llvm/test/Feature/testalloca.ll b/llvm/test/Feature/testalloca.ll
index ba2eed8..0405320 100644
--- a/llvm/test/Feature/testalloca.ll
+++ b/llvm/test/Feature/testalloca.ll
@@ -9,7 +9,7 @@
alloca i8, i32 5 ; <i8*>:1 [#uses=0]
%ptr = alloca i32 ; <i32*> [#uses=2]
store i32 3, i32* %ptr
- %val = load i32* %ptr ; <i32> [#uses=0]
+ %val = load i32, i32* %ptr ; <i32> [#uses=0]
%sptr = alloca %struct ; <%struct*> [#uses=2]
%nsptr = getelementptr %struct, %struct* %sptr, i64 0, i32 1 ; <%inners*> [#uses=1]
%ubsptr = getelementptr %inners, %inners* %nsptr, i64 0, i32 1 ; <{ i8 }*> [#uses=1]
diff --git a/llvm/test/Feature/varargs_new.ll b/llvm/test/Feature/varargs_new.ll
index a46f270..ca5599d 100644
--- a/llvm/test/Feature/varargs_new.ll
+++ b/llvm/test/Feature/varargs_new.ll
@@ -24,7 +24,7 @@
%tmp = va_arg i8** %ap, i32 ; <i32> [#uses=1]
; Demonstrate usage of llvm.va_copy and llvm_va_end
- %apv = load i8** %ap ; <i8*> [#uses=1]
+ %apv = load i8*, i8** %ap ; <i8*> [#uses=1]
%va0.upgrd.2 = bitcast i8** %aq to i8* ; <i8*> [#uses=1]
%va1.upgrd.3 = bitcast i8* %apv to i8* ; <i8*> [#uses=1]
call void @llvm.va_copy( i8* %va0.upgrd.2, i8* %va1.upgrd.3 )
diff --git a/llvm/test/Feature/weak_constant.ll b/llvm/test/Feature/weak_constant.ll
index fa254e4..4ac2e7e 100644
--- a/llvm/test/Feature/weak_constant.ll
+++ b/llvm/test/Feature/weak_constant.ll
@@ -10,20 +10,20 @@
@c = weak constant %0 { i32 7, i32 9 } ; <%0*> [#uses=1]
define i32 @la() {
- %v = load i32* @a ; <i32> [#uses=1]
+ %v = load i32, i32* @a ; <i32> [#uses=1]
ret i32 %v
}
define i32 @lb() {
- %v = load i32* @b ; <i32> [#uses=1]
+ %v = load i32, i32* @b ; <i32> [#uses=1]
ret i32 %v
}
define i32 @lc() {
%g = getelementptr %0, %0* @c, i32 0, i32 0 ; <i32*> [#uses=1]
- %u = load i32* %g ; <i32> [#uses=1]
+ %u = load i32, i32* %g ; <i32> [#uses=1]
%h = getelementptr %0, %0* @c, i32 0, i32 1 ; <i32*> [#uses=1]
- %v = load i32* %h ; <i32> [#uses=1]
+ %v = load i32, i32* %h ; <i32> [#uses=1]
%r = add i32 %u, %v
ret i32 %r
}
diff --git a/llvm/test/Feature/x86ld.ll b/llvm/test/Feature/x86ld.ll
index 32005ae..7f91abd 100644
--- a/llvm/test/Feature/x86ld.ll
+++ b/llvm/test/Feature/x86ld.ll
@@ -12,15 +12,15 @@
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %tmp = load float* @f ; <float> [#uses=1]
+ %tmp = load float, float* @f ; <float> [#uses=1]
%tmp1 = fpext float %tmp to double ; <double> [#uses=1]
- %tmp2 = load double* @d ; <double> [#uses=1]
+ %tmp2 = load double, double* @d ; <double> [#uses=1]
%tmp3 = fmul double %tmp1, %tmp2 ; <double> [#uses=1]
%tmp4 = fpext double %tmp3 to x86_fp80 ; <x86_fp80> [#uses=1]
store x86_fp80 %tmp4, x86_fp80* @ld
br label %return
return: ; preds = %entry
- %retval4 = load i32* %retval ; <i32> [#uses=1]
+ %retval4 = load i32, i32* %retval ; <i32> [#uses=1]
ret i32 %retval4
}