Remove FreeInst.

Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Victor Hernandez
2009-10-26 23:43:48 +00:00
parent dda9583e51
commit 046e78ce55
40 changed files with 131 additions and 401 deletions
@@ -89,7 +89,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
Instruction *Inst = BBI++;
// If we find a store or a free, get its memory dependence.
if (!isa<StoreInst>(Inst) && !isa<FreeInst>(Inst) && !isFreeCall(Inst))
if (!isa<StoreInst>(Inst) && !isFreeCall(Inst))
continue;
// Don't molest volatile stores or do queries that will return "clobber".
@@ -104,7 +104,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
if (InstDep.isNonLocal()) continue;
// Handle frees whose dependencies are non-trivial.
if (isa<FreeInst>(Inst) || isFreeCall(Inst)) {
if (isFreeCall(Inst)) {
MadeChange |= handleFreeWithNonTrivialDependency(Inst, InstDep);
continue;
}
@@ -176,8 +176,7 @@ bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) {
Value *DepPointer = Dependency->getPointerOperand()->getUnderlyingObject();
// Check for aliasing.
Value* FreeVal = isa<FreeInst>(F) ? F->getOperand(0) : F->getOperand(1);
if (AA.alias(FreeVal, 1, DepPointer, 1) !=
if (AA.alias(F->getOperand(1), 1, DepPointer, 1) !=
AliasAnalysis::MustAlias)
return false;