[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-02-27 21:17:42 +00:00
parent dc64962c86
commit 7c9c6ed761
3931 changed files with 29316 additions and 29292 deletions

View File

@@ -37,8 +37,8 @@ define void @test1(i8 %V, i32 *%P) {
;; Simple load value numbering.
; CHECK-LABEL: @test2(
define i32 @test2(i32 *%P) {
%V1 = load i32* %P
%V2 = load i32* %P
%V1 = load i32, i32* %P
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
; CHECK: ret i32 0
@@ -46,9 +46,9 @@ define i32 @test2(i32 *%P) {
; CHECK-LABEL: @test2a(
define i32 @test2a(i32 *%P, i1 %b) {
%V1 = load i32* %P
%V1 = load i32, i32* %P
tail call void @llvm.assume(i1 %b)
%V2 = load i32* %P
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
; CHECK: ret i32 0
@@ -57,13 +57,13 @@ define i32 @test2a(i32 *%P, i1 %b) {
;; Cross block load value numbering.
; CHECK-LABEL: @test3(
define i32 @test3(i32 *%P, i1 %Cond) {
%V1 = load i32* %P
%V1 = load i32, i32* %P
br i1 %Cond, label %T, label %F
T:
store i32 4, i32* %P
ret i32 42
F:
%V2 = load i32* %P
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
; CHECK: F:
@@ -72,14 +72,14 @@ F:
; CHECK-LABEL: @test3a(
define i32 @test3a(i32 *%P, i1 %Cond, i1 %b) {
%V1 = load i32* %P
%V1 = load i32, i32* %P
br i1 %Cond, label %T, label %F
T:
store i32 4, i32* %P
ret i32 42
F:
tail call void @llvm.assume(i1 %b)
%V2 = load i32* %P
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
; CHECK: F:
@@ -89,7 +89,7 @@ F:
;; Cross block load value numbering stops when stores happen.
; CHECK-LABEL: @test4(
define i32 @test4(i32 *%P, i1 %Cond) {
%V1 = load i32* %P
%V1 = load i32, i32* %P
br i1 %Cond, label %T, label %F
T:
ret i32 42
@@ -97,7 +97,7 @@ F:
; Clobbers V1
store i32 42, i32* %P
%V2 = load i32* %P
%V2 = load i32, i32* %P
%Diff = sub i32 %V1, %V2
ret i32 %Diff
; CHECK: F:
@@ -120,7 +120,7 @@ define i32 @test5(i32 *%P) {
; CHECK-LABEL: @test6(
define i32 @test6(i32 *%P) {
store i32 42, i32* %P
%V1 = load i32* %P
%V1 = load i32, i32* %P
ret i32 %V1
; CHECK: ret i32 42
}
@@ -129,7 +129,7 @@ define i32 @test6(i32 *%P) {
define i32 @test6a(i32 *%P, i1 %b) {
store i32 42, i32* %P
tail call void @llvm.assume(i1 %b)
%V1 = load i32* %P
%V1 = load i32, i32* %P
ret i32 %V1
; CHECK: ret i32 42
}
@@ -195,11 +195,11 @@ define void @test11(i32 *%P) {
; CHECK-LABEL: @test12(
define i32 @test12(i1 %B, i32* %P1, i32* %P2) {
%load0 = load i32* %P1
%1 = load atomic i32* %P2 seq_cst, align 4
%load1 = load i32* %P1
%load0 = load i32, i32* %P1
%1 = load atomic i32, i32* %P2 seq_cst, align 4
%load1 = load i32, i32* %P1
%sel = select i1 %B, i32 %load0, i32 %load1
ret i32 %sel
; CHECK: load i32* %P1
; CHECK: load i32* %P1
; CHECK: load i32, i32* %P1
; CHECK: load i32, i32* %P1
}