[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp CorrelatedExprs.cpp PRE.cpp Reassociate.cpp SCCP.cpp ScalarReplAggregates.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Jul 14 18:50:58 PDT 2004
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.77 -> 1.78
CorrelatedExprs.cpp updated: 1.21 -> 1.22
PRE.cpp updated: 1.8 -> 1.9
Reassociate.cpp updated: 1.31 -> 1.32
SCCP.cpp updated: 1.94 -> 1.95
ScalarReplAggregates.cpp updated: 1.22 -> 1.23
---
Log message:
Fixes working towards PR341: http://llvm.cs.uiuc.edu/PR341
---
Diffs of the changes: (+23 -22)
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.77 llvm/lib/Transforms/Scalar/ADCE.cpp:1.78
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.77 Tue May 4 12:00:46 2004
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed Jul 14 20:50:47 2004
@@ -92,13 +92,13 @@
inline void markInstructionLive(Instruction *I) {
if (LiveSet.count(I)) return;
- DEBUG(std::cerr << "Insn Live: " << I);
+ DEBUG(std::cerr << "Insn Live: " << *I);
LiveSet.insert(I);
WorkList.push_back(I);
}
inline void markTerminatorLive(const BasicBlock *BB) {
- DEBUG(std::cerr << "Terminator Live: " << BB->getTerminator());
+ DEBUG(std::cerr << "Terminator Live: " << *BB->getTerminator());
markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
}
};
Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.21 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.22
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.21 Mon Jan 12 13:12:50 2004
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Wed Jul 14 20:50:47 2004
@@ -1011,7 +1011,7 @@
Relation::KnownResult Result = getSetCCResult(SCI, RI);
if (Result != Relation::Unknown) {
DEBUG(std::cerr << "Replacing setcc with " << Result
- << " constant: " << SCI);
+ << " constant: " << *SCI);
SCI->replaceAllUsesWith(ConstantBool::get((bool)Result));
// The instruction is now dead, remove it from the program.
@@ -1038,8 +1038,8 @@
if (Value *Repl = VI->getReplacement()) {
// If we know if a replacement with lower rank than Op0, make the
// replacement now.
- DEBUG(std::cerr << "In Inst: " << I << " Replacing operand #" << i
- << " with " << Repl << "\n");
+ DEBUG(std::cerr << "In Inst: " << *I << " Replacing operand #" << i
+ << " with " << *Repl << "\n");
I->setOperand(i, Repl);
Changed = true;
++NumOperandsCann;
@@ -1067,7 +1067,7 @@
if (isa<Constant>(Op1)) {
if (Constant *Result = ConstantFoldInstruction(SCI)) {
// Wow, this is easy, directly eliminate the SetCondInst.
- DEBUG(std::cerr << "Replacing setcc with constant fold: " << SCI);
+ DEBUG(std::cerr << "Replacing setcc with constant fold: " << *SCI);
return cast<ConstantBool>(Result)->getValue()
? Relation::KnownTrue : Relation::KnownFalse;
}
Index: llvm/lib/Transforms/Scalar/PRE.cpp
diff -u llvm/lib/Transforms/Scalar/PRE.cpp:1.8 llvm/lib/Transforms/Scalar/PRE.cpp:1.9
--- llvm/lib/Transforms/Scalar/PRE.cpp:1.8 Fri Jan 9 00:02:20 2004
+++ llvm/lib/Transforms/Scalar/PRE.cpp Wed Jul 14 20:50:47 2004
@@ -390,7 +390,7 @@
return Changed;
}
#endif
- DEBUG(std::cerr << "\n====--- Expression: " << Expr);
+ DEBUG(std::cerr << "\n====--- Expression: " << *Expr);
const Type *ExprType = Expr->getType();
// AnticipatibleBlocks - Blocks where the current expression is anticipatible.
@@ -425,7 +425,7 @@
BasicBlock *BB = Occurrence->getParent();
Definitions.erase(Definitions.begin());
- DEBUG(std::cerr << "PROCESSING Occurrence: " << Occurrence);
+ DEBUG(std::cerr << "PROCESSING Occurrence: " << *Occurrence);
// Check to see if there is already an incoming value for this block...
AvailableBlocksTy::iterator LBI = AvailableBlocks.find(BB);
@@ -433,7 +433,7 @@
// Yes, there is a dominating definition for this block. Replace this
// occurrence with the incoming value.
if (LBI->second != Occurrence) {
- DEBUG(std::cerr << " replacing with: " << LBI->second);
+ DEBUG(std::cerr << " replacing with: " << *LBI->second);
Occurrence->replaceAllUsesWith(LBI->second);
BB->getInstList().erase(Occurrence); // Delete instruction
++NumRedundant;
@@ -489,7 +489,7 @@
DFBlock->begin());
ProcessedExpressions.insert(PN);
- DEBUG(std::cerr << " INSERTING PHI on frontier: " << PN);
+ DEBUG(std::cerr << " INSERTING PHI on frontier: " << *PN);
// Add the incoming blocks for the PHI node
for (pred_iterator PI = pred_begin(DFBlock),
@@ -501,7 +501,8 @@
Instruction *&BlockOcc = Definitions[DFBlockID];
if (BlockOcc) {
- DEBUG(std::cerr <<" PHI superceeds occurrence: "<<BlockOcc);
+ DEBUG(std::cerr <<" PHI superceeds occurrence: "<<
+ *BlockOcc);
BlockOcc->replaceAllUsesWith(PN);
BlockOcc->getParent()->getInstList().erase(BlockOcc);
++NumRedundant;
@@ -528,7 +529,7 @@
//
PHINode *PN = new PHINode(ExprType, Expr->getName()+".PRE",
AFBlock->begin());
- DEBUG(std::cerr << "INSERTING PHI for PR: " << PN);
+ DEBUG(std::cerr << "INSERTING PHI for PR: " << *PN);
// If there is a pending occurrence in this block, make sure to replace it
// with the PHI node...
@@ -538,7 +539,7 @@
// There is already an occurrence in this block. Replace it with PN and
// remove it.
Instruction *OldOcc = EDFI->second;
- DEBUG(std::cerr << " Replaces occurrence: " << OldOcc);
+ DEBUG(std::cerr << " Replaces occurrence: " << *OldOcc);
OldOcc->replaceAllUsesWith(PN);
AFBlock->getInstList().erase(OldOcc);
Definitions.erase(EDFI);
@@ -567,7 +568,7 @@
New->setName(NonPHIOccurrence->getName() + ".PRE-inserted");
ProcessedExpressions.insert(New);
- DEBUG(std::cerr << " INSERTING OCCURRRENCE: " << New);
+ DEBUG(std::cerr << " INSERTING OCCURRRENCE: " << *New);
// Insert it into the bottom of the predecessor, right before the
// terminator instruction...
Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.31 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.32
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.31 Thu Jul 1 14:27:10 2004
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp Wed Jul 14 20:50:47 2004
@@ -127,7 +127,7 @@
std::swap(LHSRank, RHSRank);
Changed = true;
++NumSwapped;
- DEBUG(std::cerr << "Transposed: " << I
+ DEBUG(std::cerr << "Transposed: " << *I
/* << " Result BB: " << I->getParent()*/);
}
@@ -156,7 +156,7 @@
I->getParent()->getInstList().insert(I, LHSI);
++NumChanged;
- DEBUG(std::cerr << "Reassociated: " << I/* << " Result BB: "
+ DEBUG(std::cerr << "Reassociated: " << *I/* << " Result BB: "
<< I->getParent()*/);
// Since we modified the RHS instruction, make sure that we recheck it.
@@ -235,7 +235,7 @@
New->setOperand(1, NegateValue(New->getOperand(1), BI));
Changed = true;
- DEBUG(std::cerr << "Negated: " << New /*<< " Result BB: " << BB*/);
+ DEBUG(std::cerr << "Negated: " << *New /*<< " Result BB: " << BB*/);
}
// If this instruction is a commutative binary operator, and the ranks of
@@ -265,7 +265,7 @@
I = Tmp;
++NumLinear;
Changed = true;
- DEBUG(std::cerr << "Linearized: " << I/* << " Result BB: " << BB*/);
+ DEBUG(std::cerr << "Linearized: " << *I/* << " Result BB: " << BB*/);
}
// Make sure that this expression is correctly reassociated with respect
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.94 llvm/lib/Transforms/Scalar/SCCP.cpp:1.95
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.94 Tue Apr 13 14:43:54 2004
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed Jul 14 20:50:47 2004
@@ -289,7 +289,7 @@
Instruction *I = InstWorkList.back();
InstWorkList.pop_back();
- DEBUG(std::cerr << "\nPopped off I-WL: " << I);
+ DEBUG(std::cerr << "\nPopped off I-WL: " << *I);
// "I" got into the work list because it either made the transition from
// bottom to constant, or to Overdefined.
@@ -305,7 +305,7 @@
BasicBlock *BB = BBWorkList.back();
BBWorkList.pop_back();
- DEBUG(std::cerr << "\nPopped off BBWL: " << BB);
+ DEBUG(std::cerr << "\nPopped off BBWL: " << *BB);
// Notify all instructions in this basic block that they are newly
// executable.
@@ -329,7 +329,7 @@
InstVal &IV = ValueState[&Inst];
if (IV.isConstant()) {
Constant *Const = IV.getConstant();
- DEBUG(std::cerr << "Constant: " << Const << " = " << Inst);
+ DEBUG(std::cerr << "Constant: " << *Const << " = " << Inst);
// Replaces all of the uses of a variable with uses of the constant.
Inst.replaceAllUsesWith(Const);
Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.22 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.23
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.22 Fri Jun 18 21:02:22 2004
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Jul 14 20:50:47 2004
@@ -294,7 +294,7 @@
I != E; ++I)
if (!isSafeUseOfAllocation(cast<Instruction>(*I))) {
DEBUG(std::cerr << "Cannot transform: " << *AI << " due to user: "
- << *I);
+ << **I);
return false;
}
return true;
More information about the llvm-commits
mailing list