[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/InstSimplify/call-callconv.ll b/llvm/test/Transforms/InstSimplify/call-callconv.ll
index e475be7..7701511 100644
--- a/llvm/test/Transforms/InstSimplify/call-callconv.ll
+++ b/llvm/test/Transforms/InstSimplify/call-callconv.ll
@@ -42,7 +42,7 @@
   %cmp = icmp ne i32 %call, 0
   ret i1 %cmp
 
-; CHECK: %[[STRLENFIRST:.*]] = load i8* %str
+; CHECK: %[[STRLENFIRST:.*]] = load i8, i8* %str
 ; CHECK: %[[CMP:.*]] = icmp ne i8 %[[STRLENFIRST]], 0
 ; CHECK: ret i1 %[[CMP]]
 }
diff --git a/llvm/test/Transforms/InstSimplify/compare.ll b/llvm/test/Transforms/InstSimplify/compare.ll
index cbc0125..376f6ea 100644
--- a/llvm/test/Transforms/InstSimplify/compare.ll
+++ b/llvm/test/Transforms/InstSimplify/compare.ll
@@ -950,7 +950,7 @@
 }
 
 define i1 @nonnull_load(i32** %addr) {
-  %ptr = load i32** %addr, !nonnull !{}
+  %ptr = load i32*, i32** %addr, !nonnull !{}
   %cmp = icmp eq i32* %ptr, null
   ret i1 %cmp
 ; CHECK-LABEL: @nonnull_load
@@ -958,14 +958,14 @@
 }
 
 define i1 @nonnull_load_as_outer(i32* addrspace(1)* %addr) {
-  %ptr = load i32* addrspace(1)* %addr, !nonnull !{}
+  %ptr = load i32*, i32* addrspace(1)* %addr, !nonnull !{}
   %cmp = icmp eq i32* %ptr, null
   ret i1 %cmp
 ; CHECK-LABEL: @nonnull_load_as_outer
 ; CHECK: ret i1 false
 }
 define i1 @nonnull_load_as_inner(i32 addrspace(1)** %addr) {
-  %ptr = load i32 addrspace(1)** %addr, !nonnull !{}
+  %ptr = load i32 addrspace(1)*, i32 addrspace(1)** %addr, !nonnull !{}
   %cmp = icmp eq i32 addrspace(1)* %ptr, null
   ret i1 %cmp
 ; CHECK-LABEL: @nonnull_load_as_inner
diff --git a/llvm/test/Transforms/InstSimplify/load.ll b/llvm/test/Transforms/InstSimplify/load.ll
index 92953cd..ab87d4b 100644
--- a/llvm/test/Transforms/InstSimplify/load.ll
+++ b/llvm/test/Transforms/InstSimplify/load.ll
@@ -6,14 +6,14 @@
 define i32 @crash_on_zeroinit() {
 ; CHECK-LABEL: @crash_on_zeroinit
 ; CHECK: ret i32 0
-  %load = load i32* bitcast ({}* @zeroinit to i32*)
+  %load = load i32, i32* bitcast ({}* @zeroinit to i32*)
   ret i32 %load
 }
 
 define i32 @crash_on_undef() {
 ; CHECK-LABEL: @crash_on_undef
 ; CHECK: ret i32 undef
-  %load = load i32* bitcast ({}* @undef to i32*)
+  %load = load i32, i32* bitcast ({}* @undef to i32*)
   ret i32 %load
 }
 
diff --git a/llvm/test/Transforms/InstSimplify/vector_ptr_bitcast.ll b/llvm/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
index 607892a..97c8343 100644
--- a/llvm/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
+++ b/llvm/test/Transforms/InstSimplify/vector_ptr_bitcast.ll
@@ -14,7 +14,7 @@
                                           align 8
 
 define i64 @fn() {
-  %x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
+  %x = load <2 x i8*>, <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
   %b = extractelement <2 x i8*> %x, i32 0
   %c = ptrtoint i8* %b to i64
   ; CHECK-LABEL: @fn
@@ -23,7 +23,7 @@
 }
 
 define i64 @fn2() {
-  %x = load <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8
+  %x = load <4 x i32*>, <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8
   %b = extractelement <4 x i32*> %x, i32 0
   %c = extractelement <4 x i32*> %x, i32 3
   %d = ptrtoint i32* %b to i64