diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
commit | f375520f7bca15308fe4afeb877448b0db0ec460 (patch) | |
tree | b05341c7235155f862e7b56f562c3f4412de0e33 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
parent | d5635feb1a35f5a9d661fe71f9ee13fb17db9a50 (diff) | |
download | bcm5719-llvm-f375520f7bca15308fe4afeb877448b0db0ec460.tar.gz bcm5719-llvm-f375520f7bca15308fe4afeb877448b0db0ec460.zip |
reapply r101434
with a fix for self-hosting
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: 101465
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 7ecaabbbb33..1392c9f692f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -31,7 +31,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Target/TargetIntrinsicInfo.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/Compiler.h" @@ -310,7 +309,7 @@ GlobalVariable *llvm::ExtractTypeInfo(Value *V) { void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI, MachineBasicBlock *MBB) { // Inform the MachineModuleInfo of the personality for this landing pad. - const ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(2)); + const ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(1)); assert(CE->getOpcode() == Instruction::BitCast && isa<Function>(CE->getOperand(0)) && "Personality should be a function"); @@ -319,9 +318,9 @@ void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI, // Gather all the type infos for this landing pad and pass them along to // MachineModuleInfo. std::vector<const GlobalVariable *> TyInfo; - unsigned N = I.getNumOperands(); + unsigned N = I.getNumOperands() - 1; - for (unsigned i = N - 1; i > 2; --i) { + for (unsigned i = N - 1; i > 1; --i) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i))) { unsigned FilterLength = CI->getZExtValue(); unsigned FirstCatch = i + FilterLength + !FilterLength; @@ -351,9 +350,9 @@ void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI, } } - if (N > 3) { - TyInfo.reserve(N - 3); - for (unsigned j = 3; j < N; ++j) + if (N > 2) { + TyInfo.reserve(N - 2); + for (unsigned j = 2; j < N; ++j) TyInfo.push_back(ExtractTypeInfo(I.getOperand(j))); MMI->addCatchTypeInfo(MBB, TyInfo); } |