[llvm-commits] [llvm] r67719 - in /llvm/trunk: lib/Analysis/LoopPass.cpp lib/Transforms/Scalar/LoopIndexSplit.cpp test/Transforms/LICM/2009-03-25-AliasSetTracker.ll
Devang Patel
dpatel at apple.com
Wed Mar 25 16:57:48 PDT 2009
Author: dpatel
Date: Wed Mar 25 18:57:48 2009
New Revision: 67719
URL: http://llvm.org/viewvc/llvm-project?rev=67719&view=rev
Log:
Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
Added:
llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll
Modified:
llvm/trunk/lib/Analysis/LoopPass.cpp
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Modified: llvm/trunk/lib/Analysis/LoopPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=67719&r1=67718&r2=67719&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopPass.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopPass.cpp Wed Mar 25 18:57:48 2009
@@ -152,6 +152,13 @@
/// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes.
void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) {
+ if (BasicBlock *BB = dyn_cast<BasicBlock>(V)) {
+ for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE;
+ ++BI) {
+ Instruction &I = *BI;
+ deleteSimpleAnalysisValue(&I, L);
+ }
+ }
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
LoopPass *LP = dynamic_cast<LoopPass *>(P);
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=67719&r1=67718&r2=67719&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Wed Mar 25 18:57:48 2009
@@ -673,6 +673,7 @@
while (!WorkList.empty()) {
BasicBlock *BB = WorkList.back(); WorkList.pop_back();
+ LPM->deleteSimpleAnalysisValue(BB, LP);
for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end();
BBI != BBE; ) {
Instruction *I = BBI;
@@ -680,7 +681,6 @@
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
}
- LPM->deleteSimpleAnalysisValue(BB, LP);
DT->eraseNode(BB);
DF->removeBlock(BB);
LI->removeBlock(BB);
Added: llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll?rev=67719&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll (added)
+++ llvm/trunk/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll Wed Mar 25 18:57:48 2009
@@ -0,0 +1,39 @@
+
+; RUN: llvm-as < %s | opt -licm -loop-index-split -instcombine -disable-output
+
+ %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
+ %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
+@"\01LC81" = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
+
+define fastcc void @hex_dump_internal(i8* %avcl, %struct.FILE* %f, i32 %level, i8* nocapture %buf, i32 %size) nounwind {
+entry:
+ br i1 false, label %bb4, label %return
+
+bb4: ; preds = %bb30, %entry
+ br label %bb6
+
+bb6: ; preds = %bb15, %bb4
+ %j.0.reg2mem.0 = phi i32 [ %2, %bb15 ], [ 0, %bb4 ] ; <i32> [#uses=2]
+ %0 = icmp slt i32 %j.0.reg2mem.0, 0 ; <i1> [#uses=1]
+ br i1 %0, label %bb7, label %bb13
+
+bb7: ; preds = %bb6
+ br label %bb15
+
+bb13: ; preds = %bb6
+ %1 = tail call i32 @fwrite(i8* getelementptr ([4 x i8]* @"\01LC81", i32 0, i32 0), i32 1, i32 3, i8* null) nounwind ; <i32> [#uses=0]
+ br label %bb15
+
+bb15: ; preds = %bb13, %bb7
+ %2 = add i32 %j.0.reg2mem.0, 1 ; <i32> [#uses=2]
+ %3 = icmp sgt i32 %2, 15 ; <i1> [#uses=1]
+ br i1 %3, label %bb30, label %bb6
+
+bb30: ; preds = %bb15
+ br i1 false, label %bb4, label %return
+
+return: ; preds = %bb30, %entry
+ ret void
+}
+
+declare i32 @fwrite(i8* nocapture, i32, i32, i8* nocapture) nounwind
More information about the llvm-commits
mailing list