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 | 165dac08d1bb8428b32a5f39cdd3dbee2888987f (patch) | |
tree | b96c81333b16aa40af609dd54fa4ea51cfd1f743 /lib/Target/X86/X86FastISel.cpp | |
parent | e6987587d62bb4de0f57e103f677f6bfb43a09f3 (diff) | |
download | external_llvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.zip external_llvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.tar.gz external_llvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FastISel.cpp')
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 606728e..b41c1fd 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -1170,8 +1170,8 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) { // Emit code inline code to store the stack guard onto the stack. EVT PtrTy = TLI.getPointerTy(); - const Value *Op1 = I.getOperand(1); // The guard's value. - const AllocaInst *Slot = cast<AllocaInst>(I.getOperand(2)); + const Value *Op1 = I.getOperand(0); // The guard's value. + const AllocaInst *Slot = cast<AllocaInst>(I.getOperand(1)); // Grab the frame index. X86AddressMode AM; @@ -1182,7 +1182,7 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) { return true; } case Intrinsic::objectsize: { - ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(2)); + ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(1)); const Type *Ty = I.getCalledFunction()->getReturnType(); assert(CI && "Non-constant type in Intrinsic::objectsize?"); @@ -1237,8 +1237,8 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) { if (!isTypeLegal(RetTy, VT)) return false; - const Value *Op1 = I.getOperand(1); - const Value *Op2 = I.getOperand(2); + const Value *Op1 = I.getOperand(0); + const Value *Op2 = I.getOperand(1); unsigned Reg1 = getRegForValue(Op1); unsigned Reg2 = getRegForValue(Op2); @@ -1281,7 +1281,7 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) { bool X86FastISel::X86SelectCall(const Instruction *I) { const CallInst *CI = cast<CallInst>(I); - const Value *Callee = I->getOperand(0); + const Value *Callee = CI->getCalledValue(); // Can't handle inline asm yet. if (isa<InlineAsm>(Callee)) |