[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/Transforms/Reassociate/2011-01-26-UseAfterFree.ll b/llvm/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll
index c4185d2..1c8f0d2 100644
--- a/llvm/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll
+++ b/llvm/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll
@@ -5,7 +5,7 @@
define void @exp_averages_intraday__deviation() {
entry:
- %0 = load i32* undef, align 4
+ %0 = load i32, i32* undef, align 4
%1 = shl i32 %0, 2
%2 = add nsw i32 undef, %1
%3 = add nsw i32 %2, undef
diff --git a/llvm/test/Transforms/Reassociate/basictest.ll b/llvm/test/Transforms/Reassociate/basictest.ll
index 0194ce2..015d3b0b 100644
--- a/llvm/test/Transforms/Reassociate/basictest.ll
+++ b/llvm/test/Transforms/Reassociate/basictest.ll
@@ -28,9 +28,9 @@
@f = external global i32
define void @test3() {
- %A = load i32* @a
- %B = load i32* @b
- %C = load i32* @c
+ %A = load i32, i32* @a
+ %B = load i32, i32* @b
+ %C = load i32, i32* @c
%t1 = add i32 %A, %B
%t2 = add i32 %t1, %C
%t3 = add i32 %C, %A
@@ -49,9 +49,9 @@
}
define void @test4() {
- %A = load i32* @a
- %B = load i32* @b
- %C = load i32* @c
+ %A = load i32, i32* @a
+ %B = load i32, i32* @b
+ %C = load i32, i32* @c
%t1 = add i32 %A, %B
%t2 = add i32 %t1, %C
%t3 = add i32 %C, %A
@@ -70,9 +70,9 @@
}
define void @test5() {
- %A = load i32* @a
- %B = load i32* @b
- %C = load i32* @c
+ %A = load i32, i32* @a
+ %B = load i32, i32* @b
+ %C = load i32, i32* @c
%t1 = add i32 %B, %A
%t2 = add i32 %t1, %C
%t3 = add i32 %C, %A
@@ -91,11 +91,11 @@
}
define i32 @test6() {
- %tmp.0 = load i32* @a
- %tmp.1 = load i32* @b
+ %tmp.0 = load i32, i32* @a
+ %tmp.1 = load i32, i32* @b
; (a+b)
%tmp.2 = add i32 %tmp.0, %tmp.1
- %tmp.4 = load i32* @c
+ %tmp.4 = load i32, i32* @c
; (a+b)+c
%tmp.5 = add i32 %tmp.2, %tmp.4
; (a+c)
diff --git a/llvm/test/Transforms/Reassociate/crash.ll b/llvm/test/Transforms/Reassociate/crash.ll
index 770f973..f8774ea 100644
--- a/llvm/test/Transforms/Reassociate/crash.ll
+++ b/llvm/test/Transforms/Reassociate/crash.ll
@@ -17,7 +17,7 @@
; PR5981
define i32 @test2() nounwind ssp {
entry:
- %0 = load i32* undef, align 4
+ %0 = load i32, i32* undef, align 4
%1 = mul nsw i32 undef, %0
%2 = mul nsw i32 undef, %0
%3 = add nsw i32 undef, %1
@@ -50,7 +50,7 @@
br label %_33
_33: ; preds = %_33, %_
- %tmp348 = load i8* %arg, align 1
+ %tmp348 = load i8, i8* %arg, align 1
%tmp349 = lshr i8 %tmp348, 7
%tmp350 = or i8 %tmp349, 42
%tmp351 = add i8 %tmp350, -42
@@ -123,7 +123,7 @@
; PR12963
@a = external global i8
define i8 @f0(i8 %x) {
- %t0 = load i8* @a
+ %t0 = load i8, i8* @a
%t1 = mul i8 %x, %x
%t2 = mul i8 %t1, %t1
%t3 = mul i8 %t2, %t2
diff --git a/llvm/test/Transforms/Reassociate/fast-basictest.ll b/llvm/test/Transforms/Reassociate/fast-basictest.ll
index 67b07f4..64b74e3 100644
--- a/llvm/test/Transforms/Reassociate/fast-basictest.ll
+++ b/llvm/test/Transforms/Reassociate/fast-basictest.ll
@@ -48,9 +48,9 @@
; CHECK-NOT: fadd fast float
; CHECK: ret void
- %A = load float* @fa
- %B = load float* @fb
- %C = load float* @fc
+ %A = load float, float* @fa
+ %B = load float, float* @fb
+ %C = load float, float* @fc
%t1 = fadd fast float %A, %B
%t2 = fadd fast float %t1, %C
%t3 = fadd fast float %C, %A
@@ -69,9 +69,9 @@
; CHECK-NOT: fadd
; CHECK: ret void
- %A = load float* @fa
- %B = load float* @fb
- %C = load float* @fc
+ %A = load float, float* @fa
+ %B = load float, float* @fb
+ %C = load float, float* @fc
%t1 = fadd fast float %A, %B
%t2 = fadd fast float %t1, %C
%t3 = fadd fast float %C, %A
@@ -90,9 +90,9 @@
; CHECK-NOT: fadd
; CHECK: ret void
- %A = load float* @fa
- %B = load float* @fb
- %C = load float* @fc
+ %A = load float, float* @fa
+ %B = load float, float* @fb
+ %C = load float, float* @fc
%t1 = fadd fast float %B, %A
%t2 = fadd fast float %t1, %C
%t3 = fadd fast float %C, %A
diff --git a/llvm/test/Transforms/Reassociate/pr12245.ll b/llvm/test/Transforms/Reassociate/pr12245.ll
index e9b5355..0e7152e 100644
--- a/llvm/test/Transforms/Reassociate/pr12245.ll
+++ b/llvm/test/Transforms/Reassociate/pr12245.ll
@@ -6,34 +6,34 @@
define i32 @fn2() nounwind uwtable ssp {
entry:
- %0 = load i32* @a, align 4
+ %0 = load i32, i32* @a, align 4
%dec = add nsw i32 %0, -1
store i32 %dec, i32* @a, align 4
- %1 = load i32* @d, align 4
+ %1 = load i32, i32* @d, align 4
%sub = sub nsw i32 %dec, %1
store i32 %sub, i32* @d, align 4
- %2 = load i32* @a, align 4
+ %2 = load i32, i32* @a, align 4
%dec1 = add nsw i32 %2, -1
store i32 %dec1, i32* @a, align 4
- %3 = load i32* @d, align 4
+ %3 = load i32, i32* @d, align 4
%sub2 = sub nsw i32 %dec1, %3
store i32 %sub2, i32* @d, align 4
- %4 = load i32* @a, align 4
+ %4 = load i32, i32* @a, align 4
%dec3 = add nsw i32 %4, -1
store i32 %dec3, i32* @a, align 4
- %5 = load i32* @d, align 4
+ %5 = load i32, i32* @d, align 4
%sub4 = sub nsw i32 %dec3, %5
store i32 %sub4, i32* @d, align 4
- %6 = load i32* @a, align 4
+ %6 = load i32, i32* @a, align 4
%dec5 = add nsw i32 %6, -1
store i32 %dec5, i32* @a, align 4
- %7 = load i32* @d, align 4
+ %7 = load i32, i32* @d, align 4
%sub6 = sub nsw i32 %dec5, %7
store i32 %sub6, i32* @d, align 4
- %8 = load i32* @a, align 4
+ %8 = load i32, i32* @a, align 4
%dec7 = add nsw i32 %8, -1
store i32 %dec7, i32* @a, align 4
- %9 = load i32* @d, align 4
+ %9 = load i32, i32* @d, align 4
%sub8 = sub nsw i32 %dec7, %9
store i32 %sub8, i32* @d, align 4
ret i32 0
diff --git a/llvm/test/Transforms/Reassociate/pr21205.ll b/llvm/test/Transforms/Reassociate/pr21205.ll
index fcc7150..0c6fd3a 100644
--- a/llvm/test/Transforms/Reassociate/pr21205.ll
+++ b/llvm/test/Transforms/Reassociate/pr21205.ll
@@ -11,7 +11,7 @@
define i32 @test1() {
entry:
- %0 = load i32* @a, align 4
+ %0 = load i32, i32* @a, align 4
%conv = sitofp i32 %0 to float
%sub = fsub fast float %conv, undef
%sub1 = fadd fast float %sub, -1.000000e+00