[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/MC/AArch64/elf-globaladdress.ll b/llvm/test/MC/AArch64/elf-globaladdress.ll
index 7d031e6..8e4ae4c 100644
--- a/llvm/test/MC/AArch64/elf-globaladdress.ll
+++ b/llvm/test/MC/AArch64/elf-globaladdress.ll
@@ -12,16 +12,16 @@
 @var64 = global i64 0
 
 define void @loadstore() {
-    %val8 = load i8* @var8
+    %val8 = load i8, i8* @var8
     store volatile i8 %val8, i8* @var8
 
-    %val16 = load i16* @var16
+    %val16 = load i16, i16* @var16
     store volatile i16 %val16, i16* @var16
 
-    %val32 = load i32* @var32
+    %val32 = load i32, i32* @var32
     store volatile i32 %val32, i32* @var32
 
-    %val64 = load i64* @var64
+    %val64 = load i64, i64* @var64
     store volatile i64 %val64, i64* @var64
 
     ret void
diff --git a/llvm/test/MC/ARM/data-in-code.ll b/llvm/test/MC/ARM/data-in-code.ll
index 50cd5f8..724577b 100644
--- a/llvm/test/MC/ARM/data-in-code.ll
+++ b/llvm/test/MC/ARM/data-in-code.ll
@@ -10,7 +10,7 @@
 ;; marking the data-in-code region.
 
 define void @foo(i32* %ptr) nounwind ssp {
-  %tmp = load i32* %ptr, align 4
+  %tmp = load i32, i32* %ptr, align 4
   switch i32 %tmp, label %default [
     i32 11, label %bb0
     i32 10, label %bb1
diff --git a/llvm/test/MC/ARM/elf-reloc-03.ll b/llvm/test/MC/ARM/elf-reloc-03.ll
index b64d612..a0fdc3e 100644
--- a/llvm/test/MC/ARM/elf-reloc-03.ll
+++ b/llvm/test/MC/ARM/elf-reloc-03.ll
@@ -78,9 +78,9 @@
 
 define i32 @main() nounwind {
 entry:
-  %0 = load i32* @startval, align 4
+  %0 = load i32, i32* @startval, align 4
   %1 = getelementptr inbounds [10 x i32 (...)*], [10 x i32 (...)*]* @vtable, i32 0, i32 %0
-  %2 = load i32 (...)** %1, align 4
+  %2 = load i32 (...)*, i32 (...)** %1, align 4
   %3 = tail call i32 (...)* %2() nounwind
   tail call void @exit(i32 %3) noreturn nounwind
   unreachable
diff --git a/llvm/test/MC/COFF/tricky-names.ll b/llvm/test/MC/COFF/tricky-names.ll
index 458aa41..f34b76a 100644
--- a/llvm/test/MC/COFF/tricky-names.ll
+++ b/llvm/test/MC/COFF/tricky-names.ll
@@ -10,9 +10,9 @@
 @"\01@foo.bar" = global i32 0
 
 define weak i32 @"\01??_B?$num_put@_WV?$back_insert_iterator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@std@@@std@@51"() section ".text" {
-  %a = load i32* @"\01??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ"
-  %b = load i32* @"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"
-  %c = load i32* @"\01@foo.bar"
+  %a = load i32, i32* @"\01??__E_Generic_object@?$_Error_objects@H@std@@YAXXZ"
+  %b = load i32, i32* @"\01__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"
+  %c = load i32, i32* @"\01@foo.bar"
   %x = add i32 %a, %b
   %y = add i32 %x, %c
   ret i32 %y
diff --git a/llvm/test/MC/MachO/tlv-bss.ll b/llvm/test/MC/MachO/tlv-bss.ll
index af620f9..3dbf4b0 100644
--- a/llvm/test/MC/MachO/tlv-bss.ll
+++ b/llvm/test/MC/MachO/tlv-bss.ll
@@ -26,7 +26,7 @@
 entry:
   %x.addr = alloca i32, align 4
   store i32 %x, i32* %x.addr, align 4
-  %0 = load i8** @_ZN3TlsIlE3valE, align 8
+  %0 = load i8*, i8** @_ZN3TlsIlE3valE, align 8
   ret i8* %0
 }
 
diff --git a/llvm/test/MC/MachO/x86-data-in-code.ll b/llvm/test/MC/MachO/x86-data-in-code.ll
index 2410974..c2e136f 100644
--- a/llvm/test/MC/MachO/x86-data-in-code.ll
+++ b/llvm/test/MC/MachO/x86-data-in-code.ll
@@ -6,7 +6,7 @@
 ; CHECK-NOT: (('command', 41)
 
 define void @foo(i32* %ptr) nounwind ssp {
-  %tmp = load i32* %ptr, align 4
+  %tmp = load i32, i32* %ptr, align 4
   switch i32 %tmp, label %default [
     i32 11, label %bb0
     i32 10, label %bb1
diff --git a/llvm/test/MC/Mips/elf-bigendian.ll b/llvm/test/MC/Mips/elf-bigendian.ll
index a92fe33..98b5682 100644
--- a/llvm/test/MC/Mips/elf-bigendian.ll
+++ b/llvm/test/MC/Mips/elf-bigendian.ll
@@ -43,7 +43,7 @@
 
 define i32 @main() nounwind {
 entry:
-  %0 = load i32* @x, align 4
+  %0 = load i32, i32* @x, align 4
   %tobool = icmp eq i32 %0, 0
   br i1 %tobool, label %if.end, label %foo