diff options
| author | Gabor Greif <ggreif@gmail.com> | 2010-04-15 10:49:53 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2010-04-15 10:49:53 +0000 |
| commit | aafd20963209e1f19235de9de1afed3584a830c3 (patch) | |
| tree | 12c58a436feb1f125c59847363fa04dcf0f798fd /llvm/lib/CodeGen/GCStrategy.cpp | |
| parent | a1e20de9084036fa2977004a31abf5ff490d8c8d (diff) | |
| download | llvm-aafd20963209e1f19235de9de1afed3584a830c3.zip llvm-aafd20963209e1f19235de9de1afed3584a830c3.tar.gz llvm-aafd20963209e1f19235de9de1afed3584a830c3.tar.bz2 | |
rotate CallInst operands, i.e. move callee to the back
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101364
Diffstat (limited to 'llvm/lib/CodeGen/GCStrategy.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/GCStrategy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GCStrategy.cpp b/llvm/lib/CodeGen/GCStrategy.cpp index 6d7cc51..f573b32 100644 --- a/llvm/lib/CodeGen/GCStrategy.cpp +++ b/llvm/lib/CodeGen/GCStrategy.cpp @@ -270,7 +270,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) { case Intrinsic::gcwrite: if (LowerWr) { // Replace a write barrier with a simple store. - Value *St = new StoreInst(CI->getOperand(1), CI->getOperand(3), CI); + Value *St = new StoreInst(CI->getOperand(0), CI->getOperand(2), CI); CI->replaceAllUsesWith(St); CI->eraseFromParent(); } @@ -278,7 +278,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) { case Intrinsic::gcread: if (LowerRd) { // Replace a read barrier with a simple load. - Value *Ld = new LoadInst(CI->getOperand(2), "", CI); + Value *Ld = new LoadInst(CI->getOperand(1), "", CI); Ld->takeName(CI); CI->replaceAllUsesWith(Ld); CI->eraseFromParent(); @@ -289,7 +289,7 @@ bool LowerIntrinsics::PerformDefaultLowering(Function &F, GCStrategy &S) { // Initialize the GC root, but do not delete the intrinsic. The // backend needs the intrinsic to flag the stack slot. Roots.push_back(cast<AllocaInst>( - CI->getOperand(1)->stripPointerCasts())); + CI->getOperand(0)->stripPointerCasts())); } break; default: |
