llvm.org GIT mirror llvm / 34c8847
Update the callgraph correctly in ArgumentPromotion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55895 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 11 years ago
3 changed file(s) with 44 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
605605 // Get the alias analysis information that we need to update to reflect our
606606 // changes.
607607 AliasAnalysis &AA = getAnalysis();
608
609 // Get the callgraph information that we need to update to reflect our
610 // changes.
611 CallGraph &CG = getAnalysis();
608612
609613 // Loop over all of the callers of the function, transforming the call sites
610614 // to pass in the loaded pointers.
709713 // the old call with a new one.
710714 AA.replaceWithNewValue(Call, New);
711715
716 // Update the callgraph to know that the callsite has been transformed.
717 CG[Call->getParent()->getParent()]->replaceCallSite(Call, New);
718
712719 if (!Call->use_empty()) {
713720 Call->replaceAllUsesWith(New);
714721 New->takeName(Call);
0 ; RUN: llvm-as < %s | opt -inline -argpromotion -disable-output
1
2 define internal fastcc i32 @hash(i32* %ts, i32 %mod) nounwind {
3 entry:
4 unreachable
5 }
6
7 define void @encode(i32* %m, i32* %ts, i32* %new) nounwind {
8 entry:
9 %0 = call fastcc i32 @hash( i32* %ts, i32 0 ) nounwind ; [#uses=0]
10 unreachable
11 }
0 ; RUN: llvm-as < %s | opt -argpromotion -disable-output
1
2 define internal fastcc i32 @term_SharingList(i32* %Term, i32* %List) nounwind {
3 entry:
4 br i1 false, label %bb, label %bb5
5
6 bb: ; preds = %entry
7 %0 = call fastcc i32 @term_SharingList( i32* null, i32* %List ) nounwind ; [#uses=0]
8 unreachable
9
10 bb5: ; preds = %entry
11 ret i32 0
12 }
13
14 define i32 @term_Sharing(i32* %Term) nounwind {
15 entry:
16 br i1 false, label %bb.i, label %bb14
17
18 bb.i: ; preds = %entry
19 %0 = call fastcc i32 @term_SharingList( i32* null, i32* null ) nounwind ; [#uses=0]
20 ret i32 1
21
22 bb14: ; preds = %entry
23 ret i32 0
24 }