summaryrefslogtreecommitdiff
path: root/test/Transforms/ObjCARC
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-02-27 19:29:02 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-02-27 19:29:02 +0000
commit198d8baafbfdfcf5a5e219602a5d94ed263973b4 (patch)
tree1c76a588765bdfffb32fbce3c05cf18009be4f64 /test/Transforms/ObjCARC
parent56f3b7f2fd1505ecf94bed8cae92375cdcde4efe (diff)
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers, replacing them with a single opaque pointer type. This adds an explicit type parameter to the gep instruction so that when the first parameter becomes an opaque pointer type, the type to gep through is still available to the instructions. * This doesn't modify gep operators, only instructions (operators will be handled separately) * Textual IR changes only. Bitcode (including upgrade) and changing the in-memory representation will be in separate changes. * geps of vectors are transformed as: getelementptr <4 x float*> %x, ... ->getelementptr float, <4 x float*> %x, ... Then, once the opaque pointer type is introduced, this will ultimately look like: getelementptr float, <4 x ptr> %x with the unambiguous interpretation that it is a vector of pointers to float. * address spaces remain on the pointer, not the type: getelementptr float addrspace(1)* %x ->getelementptr float, float addrspace(1)* %x Then, eventually: getelementptr float, ptr addrspace(1) %x Importantly, the massive amount of test case churn has been automated by same crappy python code. I had to manually update a few test cases that wouldn't fit the script's model (r228970,r229196,r229197,r229198). The python script just massages stdin and writes the result to stdout, I then wrapped that in a shell script to handle replacing files, then using the usual find+xargs to migrate all the files. update.py: import fileinput import sys import re ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") def conv(match, line): if not match: return line line = match.groups()[0] if len(match.groups()[5]) == 0: line += match.groups()[2] line += match.groups()[3] line += ", " line += match.groups()[1] line += "\n" return line for line in sys.stdin: if line.find("getelementptr ") == line.find("getelementptr inbounds"): if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("): line = conv(re.match(ibrep, line), line) elif line.find("getelementptr ") != line.find("getelementptr ("): line = conv(re.match(normrep, line), line) sys.stdout.write(line) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh After that, check-all (with llvm, clang, clang-tools-extra, lld, compiler-rt, and polly all checked out). The extra 'rm' in the apply.sh script is due to a few files in clang's test suite using interesting unicode stuff that my python script was throwing exceptions on. None of those files needed to be migrated, so it seemed sufficient to ignore those cases. Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7636 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ObjCARC')
-rw-r--r--test/Transforms/ObjCARC/allocas.ll64
-rw-r--r--test/Transforms/ObjCARC/basic.ll22
-rw-r--r--test/Transforms/ObjCARC/contract-storestrong-ivar.ll2
-rw-r--r--test/Transforms/ObjCARC/escape.ll60
-rw-r--r--test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll2
-rw-r--r--test/Transforms/ObjCARC/nested.ll74
-rw-r--r--test/Transforms/ObjCARC/retain-block-side-effects.ll10
-rw-r--r--test/Transforms/ObjCARC/weak-copies.ll12
8 files changed, 123 insertions, 123 deletions
diff --git a/test/Transforms/ObjCARC/allocas.ll b/test/Transforms/ObjCARC/allocas.ll
index 7b671df7064..1fbb01c47d2 100644
--- a/test/Transforms/ObjCARC/allocas.ll
+++ b/test/Transforms/ObjCARC/allocas.ll
@@ -74,7 +74,7 @@ entry:
define void @test1b(i8* %x) {
entry:
%A = alloca i8*
- %gep = getelementptr i8** %A, i32 0
+ %gep = getelementptr i8*, i8** %A, i32 0
tail call i8* @objc_retain(i8* %x)
tail call i8* @objc_retain(i8* %x)
store i8* %x, i8** %gep, align 8
@@ -97,7 +97,7 @@ entry:
define void @test1c(i8* %x) {
entry:
%A = alloca i8*, i32 3
- %gep = getelementptr i8** %A, i32 2
+ %gep = getelementptr i8*, i8** %A, i32 2
tail call i8* @objc_retain(i8* %x)
tail call i8* @objc_retain(i8* %x)
store i8* %x, i8** %gep, align 8
@@ -131,7 +131,7 @@ use_allocaB:
exit:
%A = phi i8** [ %allocaA, %use_allocaA ], [ %allocaB, %use_allocaB ]
- %gep = getelementptr i8** %A, i32 0
+ %gep = getelementptr i8*, i8** %A, i32 0
tail call i8* @objc_retain(i8* %x)
tail call i8* @objc_retain(i8* %x)
store i8* %x, i8** %gep, align 8
@@ -164,7 +164,7 @@ use_allocaB:
exit:
%A = phi i8** [ %allocaA, %use_allocaA ], [ %allocaB, %use_allocaB ]
- %gep = getelementptr i8** %A, i32 2
+ %gep = getelementptr i8*, i8** %A, i32 2
tail call i8* @objc_retain(i8* %x)
tail call i8* @objc_retain(i8* %x)
store i8* %x, i8** %gep, align 8
@@ -243,9 +243,9 @@ bb3:
define void @test2b(i8* %x) {
entry:
%A = alloca i8*
- %gep1 = getelementptr i8** %A, i32 0
+ %gep1 = getelementptr i8*, i8** %A, i32 0
store i8* %x, i8** %gep1, align 8
- %gep2 = getelementptr i8** %A, i32 0
+ %gep2 = getelementptr i8*, i8** %A, i32 0
%y = load i8** %gep2
br label %bb1
@@ -275,9 +275,9 @@ bb3:
define void @test2c(i8* %x) {
entry:
%A = alloca i8*, i32 3
- %gep1 = getelementptr i8** %A, i32 2
+ %gep1 = getelementptr i8*, i8** %A, i32 2
store i8* %x, i8** %gep1, align 8
- %gep2 = getelementptr i8** %A, i32 2
+ %gep2 = getelementptr i8*, i8** %A, i32 2
%y = load i8** %gep2
tail call i8* @objc_retain(i8* %x)
br label %bb1
@@ -311,17 +311,17 @@ entry:
bb1:
%Abb1 = alloca i8*, i32 3
- %gepbb11 = getelementptr i8** %Abb1, i32 2
+ %gepbb11 = getelementptr i8*, i8** %Abb1, i32 2
store i8* %x, i8** %gepbb11, align 8
- %gepbb12 = getelementptr i8** %Abb1, i32 2
+ %gepbb12 = getelementptr i8*, i8** %Abb1, i32 2
%ybb1 = load i8** %gepbb12
br label %bb3
bb2:
%Abb2 = alloca i8*, i32 4
- %gepbb21 = getelementptr i8** %Abb2, i32 2
+ %gepbb21 = getelementptr i8*, i8** %Abb2, i32 2
store i8* %x, i8** %gepbb21, align 8
- %gepbb22 = getelementptr i8** %Abb2, i32 2
+ %gepbb22 = getelementptr i8*, i8** %Abb2, i32 2
%ybb2 = load i8** %gepbb22
br label %bb3
@@ -369,44 +369,44 @@ entry:
%call1 = call i8* @returner()
%tmp0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call1)
- %objs.begin = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0
+ %objs.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0
tail call i8* @objc_retain(i8* %call1)
store i8* %call1, i8** %objs.begin, align 8
- %objs.elt = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 1
+ %objs.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 1
tail call i8* @objc_retain(i8* %call1)
store i8* %call1, i8** %objs.elt
%call2 = call i8* @returner1()
%call3 = call i8* @returner2()
- %keys.begin = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0
+ %keys.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0
tail call i8* @objc_retain(i8* %call2)
store i8* %call2, i8** %keys.begin, align 8
- %keys.elt = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 1
+ %keys.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 1
tail call i8* @objc_retain(i8* %call3)
store i8* %call3, i8** %keys.elt
- %gep = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 2
+ %gep = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 2
br label %arraydestroy.body
arraydestroy.body:
%arraydestroy.elementPast = phi i8** [ %gep, %entry ], [ %arraydestroy.element, %arraydestroy.body ]
- %arraydestroy.element = getelementptr inbounds i8** %arraydestroy.elementPast, i64 -1
+ %arraydestroy.element = getelementptr inbounds i8*, i8** %arraydestroy.elementPast, i64 -1
%destroy_tmp = load i8** %arraydestroy.element, align 8
call void @objc_release(i8* %destroy_tmp), !clang.imprecise_release !0
- %objs_ptr = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0
+ %objs_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0
%arraydestroy.cmp = icmp eq i8** %arraydestroy.element, %objs_ptr
br i1 %arraydestroy.cmp, label %arraydestroy.done, label %arraydestroy.body
arraydestroy.done:
- %gep1 = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 2
+ %gep1 = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 2
br label %arraydestroy.body1
arraydestroy.body1:
%arraydestroy.elementPast1 = phi i8** [ %gep1, %arraydestroy.done ], [ %arraydestroy.element1, %arraydestroy.body1 ]
- %arraydestroy.element1 = getelementptr inbounds i8** %arraydestroy.elementPast1, i64 -1
+ %arraydestroy.element1 = getelementptr inbounds i8*, i8** %arraydestroy.elementPast1, i64 -1
%destroy_tmp1 = load i8** %arraydestroy.element1, align 8
call void @objc_release(i8* %destroy_tmp1), !clang.imprecise_release !0
- %keys_ptr = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0
+ %keys_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0
%arraydestroy.cmp1 = icmp eq i8** %arraydestroy.element1, %keys_ptr
br i1 %arraydestroy.cmp1, label %arraydestroy.done1, label %arraydestroy.body1
@@ -448,44 +448,44 @@ entry:
%tmp0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call1)
%tmp1 = tail call i8* @objc_retain(i8* %call1)
- %objs.begin = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0
+ %objs.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0
tail call i8* @objc_retain(i8* %call1)
store i8* %call1, i8** %objs.begin, align 8
- %objs.elt = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 1
+ %objs.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 1
tail call i8* @objc_retain(i8* %call1)
store i8* %call1, i8** %objs.elt
%call2 = call i8* @returner1()
%call3 = call i8* @returner2()
- %keys.begin = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0
+ %keys.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0
tail call i8* @objc_retain(i8* %call2)
store i8* %call2, i8** %keys.begin, align 8
- %keys.elt = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 1
+ %keys.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 1
tail call i8* @objc_retain(i8* %call3)
store i8* %call3, i8** %keys.elt
- %gep = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 2
+ %gep = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 2
br label %arraydestroy.body
arraydestroy.body:
%arraydestroy.elementPast = phi i8** [ %gep, %entry ], [ %arraydestroy.element, %arraydestroy.body ]
- %arraydestroy.element = getelementptr inbounds i8** %arraydestroy.elementPast, i64 -1
+ %arraydestroy.element = getelementptr inbounds i8*, i8** %arraydestroy.elementPast, i64 -1
%destroy_tmp = load i8** %arraydestroy.element, align 8
call void @objc_release(i8* %destroy_tmp), !clang.imprecise_release !0
- %objs_ptr = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0
+ %objs_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0
%arraydestroy.cmp = icmp eq i8** %arraydestroy.element, %objs_ptr
br i1 %arraydestroy.cmp, label %arraydestroy.done, label %arraydestroy.body
arraydestroy.done:
- %gep1 = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 2
+ %gep1 = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 2
br label %arraydestroy.body1
arraydestroy.body1:
%arraydestroy.elementPast1 = phi i8** [ %gep1, %arraydestroy.done ], [ %arraydestroy.element1, %arraydestroy.body1 ]
- %arraydestroy.element1 = getelementptr inbounds i8** %arraydestroy.elementPast1, i64 -1
+ %arraydestroy.element1 = getelementptr inbounds i8*, i8** %arraydestroy.elementPast1, i64 -1
%destroy_tmp1 = load i8** %arraydestroy.element1, align 8
call void @objc_release(i8* %destroy_tmp1), !clang.imprecise_release !0
- %keys_ptr = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0
+ %keys_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0
%arraydestroy.cmp1 = icmp eq i8** %arraydestroy.element1, %keys_ptr
br i1 %arraydestroy.cmp1, label %arraydestroy.done1, label %arraydestroy.body1
diff --git a/test/Transforms/ObjCARC/basic.ll b/test/Transforms/ObjCARC/basic.ll
index 7bc58c42d53..9c91a05a6e7 100644
--- a/test/Transforms/ObjCARC/basic.ll
+++ b/test/Transforms/ObjCARC/basic.ll
@@ -1659,7 +1659,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g)
ret void
}
@@ -1688,7 +1688,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g)
ret void
}
@@ -1713,7 +1713,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g)
ret void
}
@@ -1732,7 +1732,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g), !clang.imprecise_release !0
ret void
}
@@ -1760,7 +1760,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g)
ret void
}
@@ -1780,7 +1780,7 @@ true:
done:
%g = bitcast i8* %p to i8*
- %h = getelementptr i8* %g, i64 0
+ %h = getelementptr i8, i8* %g, i64 0
call void @objc_release(i8* %g), !clang.imprecise_release !0
ret void
}
@@ -2682,28 +2682,28 @@ invoke.cont:
tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !0, metadata !{})
tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !0, metadata !{})
%ivar = load i64* @"OBJC_IVAR_$_A.myZ", align 8
- %add.ptr = getelementptr i8* %0, i64 %ivar
+ %add.ptr = getelementptr i8, i8* %0, i64 %ivar
%tmp1 = bitcast i8* %add.ptr to float*
%tmp2 = load float* %tmp1, align 4
%conv = fpext float %tmp2 to double
%add.ptr.sum = add i64 %ivar, 4
- %tmp6 = getelementptr inbounds i8* %0, i64 %add.ptr.sum
+ %tmp6 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum
%2 = bitcast i8* %tmp6 to float*
%tmp7 = load float* %2, align 4
%conv8 = fpext float %tmp7 to double
%add.ptr.sum36 = add i64 %ivar, 8
- %tmp12 = getelementptr inbounds i8* %0, i64 %add.ptr.sum36
+ %tmp12 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum36
%arrayidx = bitcast i8* %tmp12 to float*
%tmp13 = load float* %arrayidx, align 4
%conv14 = fpext float %tmp13 to double
%tmp12.sum = add i64 %ivar, 12
- %arrayidx19 = getelementptr inbounds i8* %0, i64 %tmp12.sum
+ %arrayidx19 = getelementptr inbounds i8, i8* %0, i64 %tmp12.sum
%3 = bitcast i8* %arrayidx19 to float*
%tmp20 = load float* %3, align 4
%conv21 = fpext float %tmp20 to double
%call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([33 x i8]* @.str4, i64 0, i64 0), double %conv, double %conv8, double %conv14, double %conv21)
%ivar23 = load i64* @"OBJC_IVAR_$_A.myZ", align 8
- %add.ptr24 = getelementptr i8* %0, i64 %ivar23
+ %add.ptr24 = getelementptr i8, i8* %0, i64 %ivar23
%4 = bitcast i8* %add.ptr24 to i128*
%srcval = load i128* %4, align 4
tail call void @objc_release(i8* %0) nounwind
diff --git a/test/Transforms/ObjCARC/contract-storestrong-ivar.ll b/test/Transforms/ObjCARC/contract-storestrong-ivar.ll
index 4a9b3140f10..078e45f5c6c 100644
--- a/test/Transforms/ObjCARC/contract-storestrong-ivar.ll
+++ b/test/Transforms/ObjCARC/contract-storestrong-ivar.ll
@@ -18,7 +18,7 @@ define hidden void @y(%0* nocapture %self, %1* %preferencesController) nounwind
entry:
%ivar = load i64* @"OBJC_IVAR_$_Controller.preferencesController", align 8
%tmp = bitcast %0* %self to i8*
- %add.ptr = getelementptr inbounds i8* %tmp, i64 %ivar
+ %add.ptr = getelementptr inbounds i8, i8* %tmp, i64 %ivar
%tmp1 = bitcast i8* %add.ptr to %1**
%tmp2 = load %1** %tmp1, align 8
%tmp3 = bitcast %1* %preferencesController to i8*
diff --git a/test/Transforms/ObjCARC/escape.ll b/test/Transforms/ObjCARC/escape.ll
index 357f7592d83..fe6009973b5 100644
--- a/test/Transforms/ObjCARC/escape.ll
+++ b/test/Transforms/ObjCARC/escape.ll
@@ -17,41 +17,41 @@ define void @test0() nounwind {
entry:
%weakLogNTimes = alloca %struct.__block_byref_weakLogNTimes, align 8
%block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, align 8
- %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0
+ %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0
store i8* null, i8** %byref.isa, align 8
- %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1
+ %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1
store %struct.__block_byref_weakLogNTimes* %weakLogNTimes, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8
- %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2
+ %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2
store i32 33554432, i32* %byref.flags, align 8
- %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3
+ %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3
store i32 48, i32* %byref.size, align 4
- %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4
+ %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4
store i8* bitcast (void (i8*, i8*)* @__Block_byref_object_copy_ to i8*), i8** %tmp1, align 8
- %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5
+ %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5
store i8* bitcast (void (i8*)* @__Block_byref_object_dispose_ to i8*), i8** %tmp2, align 8
- %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6
+ %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6
%tmp3 = bitcast void (...)** %weakLogNTimes1 to i8**
%tmp4 = call i8* @objc_initWeak(i8** %tmp3, i8* null) nounwind
- %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0
+ %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0
store i8* null, i8** %block.isa, align 8
- %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1
+ %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1
store i32 1107296256, i32* %block.flags, align 8
- %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2
+ %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2
store i32 0, i32* %block.reserved, align 4
- %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3
+ %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3
store i8* bitcast (void (i8*, i32)* @__main_block_invoke_0 to i8*), i8** %block.invoke, align 8
- %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4
+ %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4
store %struct.__block_descriptor* null, %struct.__block_descriptor** %block.descriptor, align 8
- %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5
+ %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5
%tmp5 = bitcast %struct.__block_byref_weakLogNTimes* %weakLogNTimes to i8*
store i8* %tmp5, i8** %block.captured, align 8
%tmp6 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block to i8*
%tmp7 = call i8* @objc_retainBlock(i8* %tmp6) nounwind, !clang.arc.copy_on_escape !0
%tmp8 = load %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8
- %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6
+ %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6
%tmp9 = bitcast void (...)** %weakLogNTimes3 to i8**
%tmp10 = call i8* @objc_storeWeak(i8** %tmp9, i8* %tmp7) nounwind
- %tmp11 = getelementptr inbounds i8* %tmp7, i64 16
+ %tmp11 = getelementptr inbounds i8, i8* %tmp7, i64 16
%tmp12 = bitcast i8* %tmp11 to i8**
%tmp13 = load i8** %tmp12, align 8
%tmp14 = bitcast i8* %tmp13 to void (i8*, i32)*
@@ -72,41 +72,41 @@ define void @test1() nounwind {
entry:
%weakLogNTimes = alloca %struct.__block_byref_weakLogNTimes, align 8
%block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, align 8
- %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0
+ %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0
store i8* null, i8** %byref.isa, align 8
- %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1
+ %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1
store %struct.__block_byref_weakLogNTimes* %weakLogNTimes, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8
- %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2
+ %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2
store i32 33554432, i32* %byref.flags, align 8
- %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3
+ %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3
store i32 48, i32* %byref.size, align 4
- %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4
+ %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4
store i8* bitcast (void (i8*, i8*)* @__Block_byref_object_copy_ to i8*), i8** %tmp1, align 8
- %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5
+ %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5
store i8* bitcast (void (i8*)* @__Block_byref_object_dispose_ to i8*), i8** %tmp2, align 8
- %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6
+ %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6
%tmp3 = bitcast void (...)** %weakLogNTimes1 to i8**
%tmp4 = call i8* @objc_initWeak(i8** %tmp3, i8* null) nounwind
- %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0
+ %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0
store i8* null, i8** %block.isa, align 8
- %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1
+ %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1
store i32 1107296256, i32* %block.flags, align 8
- %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2
+ %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2
store i32 0, i32* %block.reserved, align 4
- %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3
+ %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3
store i8* bitcast (void (i8*, i32)* @__main_block_invoke_0 to i8*), i8** %block.invoke, align 8
- %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4
+ %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4
store %struct.__block_descriptor* null, %struct.__block_descriptor** %block.descriptor, align 8
- %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5
+ %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5
%tmp5 = bitcast %struct.__block_byref_weakLogNTimes* %weakLogNTimes to i8*
store i8* %tmp5, i8** %block.captured, align 8
%tmp6 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block to i8*
%tmp7 = call i8* @objc_retainBlock(i8* %tmp6) nounwind, !clang.arc.copy_on_escape !0
%tmp8 = load %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8
- %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6
+ %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6
%tmp9 = bitcast void (...)** %weakLogNTimes3 to i8**
%tmp10 = call i8* @not_really_objc_storeWeak(i8** %tmp9, i8* %tmp7) nounwind
- %tmp11 = getelementptr inbounds i8* %tmp7, i64 16
+ %tmp11 = getelementptr inbounds i8, i8* %tmp7, i64 16
%tmp12 = bitcast i8* %tmp11 to i8**
%tmp13 = load i8** %tmp12, align 8
%tmp14 = bitcast i8* %tmp13 to void (i8*, i32)*
diff --git a/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll b/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll
index 5d058257c6e..85fd06b557f 100644
--- a/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll
+++ b/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll
@@ -168,7 +168,7 @@ bb57: ; preds = %bb55, %bb46
%tmp70 = tail call %14* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %14* (i8*, i8*, %23*, %18*)*)(i8* %tmp69, i8* %tmp68, %23* %tmp67, %18* %tmp47)
%tmp71 = bitcast %14* %tmp70 to i8*
; hack to prevent the optimize from using objc_retainAutoreleasedReturnValue.
- %tmp71x = getelementptr i8* %tmp71, i64 1
+ %tmp71x = getelementptr i8, i8* %tmp71, i64 1
%tmp72 = tail call i8* @objc_retain(i8* %tmp71x) nounwind
%tmp73 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_402", align 8
tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8)*)(i8* %tmp72, i8* %tmp73, i8 signext 1)
diff --git a/test/Transforms/ObjCARC/nested.ll b/test/Transforms/ObjCARC/nested.ll
index 7d72e37f803..ac0e7c783f0 100644
--- a/test/Transforms/ObjCARC/nested.ll
+++ b/test/Transforms/ObjCARC/nested.ll
@@ -43,10 +43,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -68,7 +68,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -108,10 +108,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -133,7 +133,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -173,10 +173,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -198,7 +198,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -239,10 +239,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -264,7 +264,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -306,10 +306,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -331,7 +331,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -375,10 +375,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -400,7 +400,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
call void @use(i8* %3)
%4 = add i64 %forcoll.index, 1
@@ -441,10 +441,10 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
- %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
+ %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1
br label %forcoll.loopbody.outer
forcoll.loopbody.outer:
@@ -466,7 +466,7 @@ forcoll.mutated:
forcoll.notmutated:
%stateitems = load i8*** %stateitems.ptr, align 8
- %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index
+ %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index
%3 = load i8** %currentitem.ptr, align 8
%tobool = icmp eq i8* %3, null
br i1 %tobool, label %forcoll.next, label %if.then
@@ -518,7 +518,7 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
br label %forcoll.loopbody.outer
@@ -585,7 +585,7 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
br label %forcoll.loopbody.outer
@@ -652,7 +652,7 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
br label %forcoll.loopbody.outer
@@ -720,7 +720,7 @@ entry:
br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit
forcoll.loopinit:
- %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
+ %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2
%mutationsptr = load i64** %mutationsptr.ptr, align 8
%forcoll.initial-mutations = load i64* %mutationsptr, align 8
br label %forcoll.loopbody.outer
@@ -779,16 +779,16 @@ entry:
%block = alloca <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, align 8
%block9 = alloca <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, align 8
%call = call i8* @def(), !clang.arc.no_objc_arc_exceptions !0
- %foo = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 5
- %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 0
+ %foo = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 5
+ %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 0
store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa, align 8
- %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 1
+ %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 1
store i32 1107296256, i32* %block.flags, align 8
- %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 2
+ %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 2
store i32 0, i32* %block.reserved, align 4
- %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 3
+ %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 3
store i8* bitcast (void (i8*)* @__crasher_block_invoke to i8*), i8** %block.invoke, align 8
- %block.d = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 4
+ %block.d = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 4
store %struct.__block_d* bitcast ({ i64, i64, i8*, i8*, i8*, i8* }* @__block_d_tmp to %struct.__block_d*), %struct.__block_d** %block.d, align 8
%foo2 = tail call i8* @objc_retain(i8* %call) nounwind
store i8* %foo2, i8** %foo, align 8
@@ -798,16 +798,16 @@ entry:
call void @objc_release(i8* %foo5) nounwind
%strongdestroy = load i8** %foo, align 8
call void @objc_release(i8* %strongdestroy) nounwind, !clang.imprecise_release !0
- %foo10 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 5
- %block.isa11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 0
+ %foo10 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 5
+ %block.isa11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 0
store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa11, align 8
- %block.flags12 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 1
+ %block.flags12 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 1
store i32 1107296256, i32* %block.flags12, align 8
- %block.reserved13 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 2
+ %block.reserved13 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 2
store i32 0, i32* %block.reserved13, align 4
- %block.invoke14 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 3
+ %block.invoke14 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 3
store i8* bitcast (void (i8*)* @__crasher_block_invoke1 to i8*), i8** %block.invoke14, align 8
- %block.d15 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 4
+ %block.d15 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 4
store %struct.__block_d* bitcast ({ i64, i64, i8*, i8*, i8*, i8* }* @__block_d_tmp5 to %struct.__block_d*), %struct.__block_d** %block.d15, align 8
%foo18 = call i8* @objc_retain(i8* %call) nounwind
store i8* %call, i8** %foo10, align 8
diff --git a/test/Transforms/ObjCARC/retain-block-side-effects.ll b/test/Transforms/ObjCARC/retain-block-side-effects.ll
index 7fa73cbfef1..b4f4089115e 100644
--- a/test/Transforms/ObjCARC/retain-block-side-effects.ll
+++ b/test/Transforms/ObjCARC/retain-block-side-effects.ll
@@ -7,7 +7,7 @@
; CHECK: %tmp16 = call i8* @objc_retainBlock(i8* %tmp15) [[NUW:#[0-9]+]]
; CHECK: %tmp17 = bitcast i8* %tmp16 to void ()*
; CHECK: %tmp18 = load %struct.__block_byref_repeater** %byref.forwarding, align 8
-; CHECK: %repeater12 = getelementptr inbounds %struct.__block_byref_repeater* %tmp18, i64 0, i32 6
+; CHECK: %repeater12 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %tmp18, i64 0, i32 6
; CHECK: store void ()* %tmp17, void ()** %repeater12, align 8
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
@@ -20,17 +20,17 @@ define void @foo() noreturn {
entry:
%repeater = alloca %struct.__block_byref_repeater, align 8
%block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>, align 8
- %byref.forwarding = getelementptr inbounds %struct.__block_byref_repeater* %repeater, i64 0, i32 1
- %tmp10 = getelementptr inbounds %struct.__block_byref_repeater* %repeater, i64 0, i32 6
+ %byref.forwarding = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %repeater, i64 0, i32 1
+ %tmp10 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %repeater, i64 0, i32 6
store void ()* null, void ()** %tmp10, align 8
- %block.captured11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block, i64 0, i32 6
+ %block.captured11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block, i64 0, i32 6
%tmp14 = bitcast %struct.__block_byref_repeater* %repeater to i8*
store i8* %tmp14, i8** %block.captured11, align 8
%tmp15 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block to i8*
%tmp16 = call i8* @objc_retainBlock(i8* %tmp15) nounwind
%tmp17 = bitcast i8* %tmp16 to void ()*
%tmp18 = load %struct.__block_byref_repeater** %byref.forwarding, align 8
- %repeater12 = getelementptr inbounds %struct.__block_byref_repeater* %tmp18, i64 0, i32 6
+ %repeater12 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %tmp18, i64 0, i32 6
%tmp13 = load void ()** %repeater12, align 8
store void ()* %tmp17, void ()** %repeater12, align 8
ret void
diff --git a/test/Transforms/ObjCARC/weak-copies.ll b/test/Transforms/ObjCARC/weak-copies.ll
index 13d0b0a0c6b..82a44c58848 100644
--- a/test/Transforms/ObjCARC/weak-copies.ll
+++ b/test/Transforms/ObjCARC/weak-copies.ll
@@ -50,17 +50,17 @@ entry:
%block = alloca %1, align 8
%0 = call i8* @objc_retain(i8* %me) nounwind
%1 = call i8* @objc_initWeak(i8** %w, i8* %0) nounwind
- %block.isa = getelementptr inbounds %1* %block, i64 0, i32 0
+ %block.isa = getelementptr inbounds %1, %1* %block, i64 0, i32 0
store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa, align 8
- %block.flags = getelementptr inbounds %1* %block, i64 0, i32 1
+ %block.flags = getelementptr inbounds %1, %1* %block, i64 0, i32 1
store i32 1107296256, i32* %block.flags, align 8
- %block.reserved = getelementptr inbounds %1* %block, i64 0, i32 2
+ %block.reserved = getelementptr inbounds %1, %1* %block, i64 0, i32 2
store i32 0, i32* %block.reserved, align 4
- %block.invoke = getelementptr inbounds %1* %block, i64 0, i32 3
+ %block.invoke = getelementptr inbounds %1, %1* %block, i64 0, i32 3
store i8* bitcast (void (i8*)* @__qux_block_invoke_0 to i8*), i8** %block.invoke, align 8
- %block.descriptor = getelementptr inbounds %1* %block, i64 0, i32 4
+ %block.descriptor = getelementptr inbounds %1, %1* %block, i64 0, i32 4
store %struct.__block_descriptor* bitcast (%0* @__block_descriptor_tmp to %struct.__block_descriptor*), %struct.__block_descriptor** %block.descriptor, align 8
- %block.captured = getelementptr inbounds %1* %block, i64 0, i32 5
+ %block.captured = getelementptr inbounds %1, %1* %block, i64 0, i32 5
%2 = call i8* @objc_loadWeak(i8** %w) nounwind
%3 = call i8* @objc_initWeak(i8** %block.captured, i8* %2) nounwind
%4 = bitcast %1* %block to void ()*