llvm.org GIT mirror llvm / e77bf55
Merging r155954: ------------------------------------------------------------------------ r155954 | void | 2012-05-01 15:50:45 -0700 (Tue, 01 May 2012) | 3 lines Strip the pointer casts off of allocas so that the selection DAG can find them. PR10799 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_31@155955 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
50495049 }
50505050 case Intrinsic::gcroot:
50515051 if (GFI) {
5052 const Value *Alloca = I.getArgOperand(0);
5052 const Value *Alloca = I.getArgOperand(0)->stripPointerCasts();
50535053 const Constant *TypeMap = cast(I.getArgOperand(1));
50545054
50555055 FrameIndexSDNode *FI = cast(getValue(Alloca).getNode());
0 ; RUN: llc < %s -O0
1
2 define i32 @main() {
3 entry:
4 call void @f()
5 ret i32 0
6 }
7
8 define void @f() gc "ocaml" {
9 entry:
10 %ptr.stackref = alloca i8*
11 %gcroot = bitcast i8** %ptr.stackref to i8**
12 call void @llvm.gcroot(i8** %gcroot, i8* null)
13 ret void
14 }
15
16 declare void @llvm.gcroot(i8**, i8*) nounwind