diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-07-14 17:48:25 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-07-14 17:48:25 +0000 |
| commit | 3be62697dfd328562860d112f8f90f3e5c6cd761 (patch) | |
| tree | 17fa1bafa1dc8631c5c2f7d6880123a7a933b7f1 /llvm/lib/Transforms | |
| parent | 466fd0a16d0f1e70c2fa56ced9f8dcc0f2be6010 (diff) | |
| download | bcm5719-llvm-3be62697dfd328562860d112f8f90f3e5c6cd761.tar.gz bcm5719-llvm-3be62697dfd328562860d112f8f90f3e5c6cd761.zip | |
Revert 75571; I'm convinced this isn't the right thing to do.
llvm-svn: 75642
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 155d5d81e30..f6cffdd0ef4 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -109,8 +109,6 @@ static bool MarkAliveBlocks(BasicBlock *BB, if (!Reachable.insert(BB)) continue; - bool AsmFound = false; - StoreInst *UndefStore = 0; // Do a quick scan of the basic block, turning any obviously unreachable // instructions into LLVM unreachable insts. The instruction combining pass // canonicalizes unreachable insts into stores to null or undef. @@ -127,27 +125,20 @@ static bool MarkAliveBlocks(BasicBlock *BB, } break; } - if (isa<InlineAsm>(CI->getOperand(0))) - AsmFound = true; } if (StoreInst *SI = dyn_cast<StoreInst>(BBI)) { Value *Ptr = SI->getOperand(1); - - if ((isa<UndefValue>(Ptr) || - (isa<ConstantPointerNull>(Ptr) && - cast<PointerType>(Ptr->getType())->getAddressSpace() == 0)) && - !UndefStore) - UndefStore = SI; + + if (isa<UndefValue>(Ptr) || + (isa<ConstantPointerNull>(Ptr) && + cast<PointerType>(Ptr->getType())->getAddressSpace() == 0)) { + ChangeToUnreachable(SI, Context); + Changed = true; + break; + } } } - // We can't delete asm's just because their inputs are undefined; - // xor R, R is a common idiom for zeroing a register, for example. - // Assume user knows what he is doing. - if (UndefStore && !AsmFound) { - ChangeToUnreachable(UndefStore, Context); - Changed = true; - } // Turn invokes that call 'nounwind' functions into ordinary calls. if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator())) |

