diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-14 17:25:37 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-14 17:25:37 +0000 |
commit | 042523340bb39407032152b681f2f4d0920b1d59 (patch) | |
tree | 5307c7ff389ad79b456b43db76b676cf0fe8cdd4 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | bb57896f8e68d7cda6a5664a44fbe0a673d4ae63 (diff) | |
download | bcm5719-llvm-042523340bb39407032152b681f2f4d0920b1d59.tar.gz bcm5719-llvm-042523340bb39407032152b681f2f4d0920b1d59.zip |
Delete fast-isel's trivial load optimization; it breaks debugging because
it can look past points where a debugger might modify user variables.
llvm-svn: 108336
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index bd49c179804..6c13f27199e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -782,39 +782,8 @@ FastISel::SelectFNeg(const User *I) { } bool -FastISel::SelectLoad(const User *I) { - LoadInst *LI = const_cast<LoadInst *>(cast<LoadInst>(I)); - - // For a load from an alloca, make a limited effort to find the value - // already available in a register, avoiding redundant loads. - if (!LI->isVolatile() && isa<AllocaInst>(LI->getPointerOperand())) { - BasicBlock::iterator ScanFrom = LI; - if (const Value *V = FindAvailableLoadedValue(LI->getPointerOperand(), - LI->getParent(), ScanFrom)) { - if (!V->use_empty() && - (!isa<Instruction>(V) || - cast<Instruction>(V)->getParent() == LI->getParent() || - (isa<AllocaInst>(V) && - FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(V)))) && - (!isa<Argument>(V) || - LI->getParent() == &LI->getParent()->getParent()->getEntryBlock())) { - unsigned ResultReg = getRegForValue(V); - if (ResultReg != 0) { - UpdateValueMap(I, ResultReg); - return true; - } - } - } - } - - return false; -} - -bool FastISel::SelectOperator(const User *I, unsigned Opcode) { switch (Opcode) { - case Instruction::Load: - return SelectLoad(I); case Instruction::Add: return SelectBinaryOp(I, ISD::ADD); case Instruction::FAdd: |