[llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp AliasAnalysis.cpp AliasAnalysisEvaluator.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp Expressions.cpp InstCount.cpp Interval.cpp IntervalPartition.cpp LoadValueNumbering.cpp LoopInfo.cpp PostDominators.cpp ProfileInfo.cpp ProfileInfoLoader.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp ValueNumbering.cpp
Misha Brukman
brukman at cs.uiuc.edu
Thu Apr 21 14:05:10 PDT 2005
Changes in directory llvm/lib/Analysis:
AliasAnalysisCounter.cpp updated: 1.12 -> 1.13
AliasAnalysis.cpp updated: 1.25 -> 1.26
AliasAnalysisEvaluator.cpp updated: 1.26 -> 1.27
AliasSetTracker.cpp updated: 1.35 -> 1.36
BasicAliasAnalysis.cpp updated: 1.65 -> 1.66
CFGPrinter.cpp updated: 1.11 -> 1.12
Expressions.cpp updated: 1.43 -> 1.44
InstCount.cpp updated: 1.11 -> 1.12
Interval.cpp updated: 1.16 -> 1.17
IntervalPartition.cpp updated: 1.28 -> 1.29
LoadValueNumbering.cpp updated: 1.30 -> 1.31
LoopInfo.cpp updated: 1.61 -> 1.62
PostDominators.cpp updated: 1.50 -> 1.51
ProfileInfo.cpp updated: 1.6 -> 1.7
ProfileInfoLoader.cpp updated: 1.7 -> 1.8
ProfileInfoLoaderPass.cpp updated: 1.11 -> 1.12
ScalarEvolution.cpp updated: 1.37 -> 1.38
ValueNumbering.cpp updated: 1.14 -> 1.15
---
Log message:
Remove trailing whitespace
---
Diffs of the changes: (+203 -203)
AliasAnalysis.cpp | 4 -
AliasAnalysisCounter.cpp | 16 +++----
AliasAnalysisEvaluator.cpp | 34 ++++++++--------
AliasSetTracker.cpp | 10 ++--
BasicAliasAnalysis.cpp | 70 +++++++++++++++++-----------------
CFGPrinter.cpp | 12 ++---
Expressions.cpp | 22 +++++-----
InstCount.cpp | 10 ++--
Interval.cpp | 6 +-
IntervalPartition.cpp | 6 +-
LoadValueNumbering.cpp | 28 ++++++-------
LoopInfo.cpp | 26 ++++++------
PostDominators.cpp | 16 +++----
ProfileInfo.cpp | 6 +-
ProfileInfoLoader.cpp | 22 +++++-----
ProfileInfoLoaderPass.cpp | 8 +--
ScalarEvolution.cpp | 92 ++++++++++++++++++++++-----------------------
ValueNumbering.cpp | 18 ++++----
18 files changed, 203 insertions(+), 203 deletions(-)
Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp
diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.12 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.13
--- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.12 Wed Mar 23 15:59:07 2005
+++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- AliasAnalysisCounter.cpp - Alias Analysis Query Counter ------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements a pass which can be used to count how many alias queries
@@ -67,7 +67,7 @@
printLine("mod/ref", MR, MRSum);
std::cerr
<< " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/"
- << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
+ << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
<< MR*100/MRSum <<"%\n\n";
}
}
@@ -96,8 +96,8 @@
bool onlyReadsMemory(Function *F) {
return getAnalysis<AliasAnalysis>().onlyReadsMemory(F);
}
-
-
+
+
// Forwarding functions: just delegate to a real AA implementation, counting
// the number of responses...
AliasResult alias(const Value *V1, unsigned V1Size,
@@ -118,11 +118,11 @@
return new AliasAnalysisCounter();
}
-AliasAnalysis::AliasResult
+AliasAnalysis::AliasResult
AliasAnalysisCounter::alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size) {
AliasResult R = getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size);
-
+
const char *AliasString;
switch (R) {
default: assert(0 && "Unknown alias type!");
@@ -142,7 +142,7 @@
return R;
}
-AliasAnalysis::ModRefResult
+AliasAnalysis::ModRefResult
AliasAnalysisCounter::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
ModRefResult R = getAnalysis<AliasAnalysis>().getModRefInfo(CS, P, Size);
Index: llvm/lib/Analysis/AliasAnalysis.cpp
diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.25 llvm/lib/Analysis/AliasAnalysis.cpp:1.26
--- llvm/lib/Analysis/AliasAnalysis.cpp:1.25 Wed Mar 23 17:26:58 2005
+++ llvm/lib/Analysis/AliasAnalysis.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- AliasAnalysis.cpp - Generic Alias Analysis Interface Implementation -==//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the generic AliasAnalysis interface which is used as the
Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.26 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.27
--- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.26 Tue Mar 29 11:44:52 2005
+++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- AliasAnalysisEvaluator.cpp - Alias Analysis Accuracy Evaluator -----===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements a simple N^2 alias analysis accuracy evaluator.
@@ -54,16 +54,16 @@
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
}
-
- bool doInitialization(Module &M) {
- NoAlias = MayAlias = MustAlias = 0;
+
+ bool doInitialization(Module &M) {
+ NoAlias = MayAlias = MustAlias = 0;
NoModRef = Mod = Ref = ModRef = 0;
if (PrintAll) {
PrintNoAlias = PrintMayAlias = PrintMustAlias = true;
PrintNoModRef = PrintMod = PrintRef = PrintModRef = true;
}
- return false;
+ return false;
}
bool runOnFunction(Function &F);
@@ -85,7 +85,7 @@
}
}
-static inline void
+static inline void
PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
Module *M) {
if (P) {
@@ -99,7 +99,7 @@
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
const TargetData &TD = AA.getTargetData();
-
+
std::set<Value *> Pointers;
std::set<CallSite> CallSites;
@@ -157,16 +157,16 @@
}
// Mod/ref alias analysis: compare all pairs of calls and values
- for (std::set<CallSite>::iterator C = CallSites.begin(),
+ for (std::set<CallSite>::iterator C = CallSites.begin(),
Ce = CallSites.end(); C != Ce; ++C) {
Instruction *I = C->getInstruction();
-
+
for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end();
V != Ve; ++V) {
unsigned Size = 0;
const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType();
if (ElTy->isSized()) Size = TD.getTypeSize(ElTy);
-
+
switch (AA.getModRefInfo(*C, *V, Size)) {
case AliasAnalysis::NoModRef:
PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent());
@@ -185,7 +185,7 @@
}
}
}
-
+
return false;
}
@@ -199,7 +199,7 @@
std::cerr << "===== Alias Analysis Evaluator Report =====\n";
if (AliasSum == 0) {
std::cerr << " Alias Analysis Evaluator Summary: No pointers!\n";
- } else {
+ } else {
std::cerr << " " << AliasSum << " Total Alias Queries Performed\n";
std::cerr << " " << NoAlias << " no alias responses ";
PrintPercent(NoAlias, AliasSum);
@@ -207,8 +207,8 @@
PrintPercent(MayAlias, AliasSum);
std::cerr << " " << MustAlias << " must alias responses ";
PrintPercent(MustAlias, AliasSum);
- std::cerr << " Alias Analysis Evaluator Pointer Alias Summary: "
- << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
+ std::cerr << " Alias Analysis Evaluator Pointer Alias Summary: "
+ << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
<< MustAlias*100/AliasSum << "%\n";
}
@@ -226,8 +226,8 @@
PrintPercent(Ref, ModRefSum);
std::cerr << " " << ModRef << " mod & ref responses ";
PrintPercent(ModRef, ModRefSum);
- std::cerr << " Alias Analysis Evaluator Mod/Ref Summary: "
- << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
+ std::cerr << " Alias Analysis Evaluator Mod/Ref Summary: "
+ << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
<< Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
}
Index: llvm/lib/Analysis/AliasSetTracker.cpp
diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.35 llvm/lib/Analysis/AliasSetTracker.cpp:1.36
--- llvm/lib/Analysis/AliasSetTracker.cpp:1.35 Thu Mar 24 23:49:37 2005
+++ llvm/lib/Analysis/AliasSetTracker.cpp Thu Apr 21 16:04:58 2005
@@ -1,14 +1,14 @@
//===- AliasSetTracker.cpp - Alias Sets Tracker implementation-------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the AliasSetTracker and AliasSet classes.
-//
+//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/AliasSetTracker.h"
@@ -53,7 +53,7 @@
CallSites.insert(CallSites.end(), AS.CallSites.begin(), AS.CallSites.end());
AS.CallSites.clear();
}
-
+
AS.Forward = this; // Forward across AS now...
addRef(); // AS is now pointing to us...
@@ -506,7 +506,7 @@
for (unsigned i = 0, e = CallSites.size(); i != e; ++i) {
if (i) OS << ", ";
WriteAsOperand(OS, CallSites[i].getCalledValue());
- }
+ }
}
OS << "\n";
}
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.65 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.66
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.65 Wed Mar 9 10:29:52 2005
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- BasicAliasAnalysis.cpp - Local Alias Analysis Impl -----------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines the default implementation of the Alias Analysis interface
@@ -39,7 +39,7 @@
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
-
+
virtual void initializePass() {
TD = &getAnalysis<TargetData>();
}
@@ -53,7 +53,7 @@
std::vector<PointerAccessInfo> *Info) {
return UnknownModRefBehavior;
}
-
+
virtual void getArgumentAccesses(Function *F, CallSite CS,
std::vector<PointerAccessInfo> &Info) {
assert(0 && "This method may not be called on this function!");
@@ -72,7 +72,7 @@
virtual void deleteValue(Value *V) {}
virtual void copyValue(Value *From, Value *To) {}
};
-
+
// Register this pass...
RegisterOpt<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
@@ -106,7 +106,7 @@
virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS,
std::vector<PointerAccessInfo> *Info);
-
+
private:
// CheckGEPInstructions - Check two GEP instructions with known
// must-aliasing base pointers. This checks to see if the index expressions
@@ -117,7 +117,7 @@
const Type *BasePtr2Ty, std::vector<Value*> &GEP2Ops,
unsigned G2Size);
};
-
+
// Register this pass...
RegisterOpt<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");
@@ -144,7 +144,7 @@
// If we are at some type of object... return it.
if (hasUniqueAddress(V) || isa<Argument>(V)) return V;
-
+
// Traverse through different addressing mechanisms...
if (const Instruction *I = dyn_cast<Instruction>(V)) {
if (isa<CastInst>(I) || isa<GetElementPtrInst>(I))
@@ -307,7 +307,7 @@
if (!isa<Argument>(O1) && isa<ConstantPointerNull>(V2))
return NoAlias; // Unique values don't alias null
- if (isa<GlobalVariable>(O1) ||
+ if (isa<GlobalVariable>(O1) ||
(isa<AllocationInst>(O1) &&
!cast<AllocationInst>(O1)->isArrayAllocation()))
if (cast<PointerType>(O1->getType())->getElementType()->isSized()) {
@@ -351,12 +351,12 @@
do {
BasePtr1 = cast<User>(BasePtr1)->getOperand(0);
} while (isGEP(BasePtr1) &&
- cast<User>(BasePtr1)->getOperand(1) ==
+ cast<User>(BasePtr1)->getOperand(1) ==
Constant::getNullValue(cast<User>(BasePtr1)->getOperand(1)->getType()));
do {
BasePtr2 = cast<User>(BasePtr2)->getOperand(0);
} while (isGEP(BasePtr2) &&
- cast<User>(BasePtr2)->getOperand(1) ==
+ cast<User>(BasePtr2)->getOperand(1) ==
Constant::getNullValue(cast<User>(BasePtr2)->getOperand(1)->getType()));
// Do the base pointers alias?
@@ -423,7 +423,7 @@
if (ConstantFound) {
if (V2Size <= 1 && V1Size <= 1) // Just pointer check?
return NoAlias;
-
+
// Otherwise we have to check to see that the distance is more than
// the size of the argument... build an index vector that is equal to
// the arguments provided, except substitute 0's for any variable
@@ -443,7 +443,7 @@
}
}
}
-
+
return MayAlias;
}
@@ -503,7 +503,7 @@
// If so, return mustalias.
if (UnequalOper == MinOperands) {
if (GEP1Ops.size() < GEP2Ops.size()) std::swap(GEP1Ops, GEP2Ops);
-
+
bool AllAreZeros = true;
for (unsigned i = UnequalOper; i != MaxOperands; ++i)
if (!isa<Constant>(GEP1Ops[i]) ||
@@ -514,7 +514,7 @@
if (AllAreZeros) return MustAlias;
}
-
+
// So now we know that the indexes derived from the base pointers,
// which are known to alias, are different. We can still determine a
// no-alias result if there are differing constant pairs in the index
@@ -530,7 +530,7 @@
for (; FirstConstantOper != MinOperands; ++FirstConstantOper) {
const Value *G1Oper = GEP1Ops[FirstConstantOper];
const Value *G2Oper = GEP2Ops[FirstConstantOper];
-
+
if (G1Oper != G2Oper) // Found non-equal constant indexes...
if (Constant *G1OC = dyn_cast<ConstantInt>(const_cast<Value*>(G1Oper)))
if (Constant *G2OC = dyn_cast<ConstantInt>(const_cast<Value*>(G2Oper))){
@@ -555,7 +555,7 @@
}
BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(G1Oper);
}
-
+
// No shared constant operands, and we ran out of common operands. At this
// point, the GEP instructions have run through all of their operands, and we
// haven't found evidence that there are any deltas between the GEP's.
@@ -585,13 +585,13 @@
// Now crop off any constants from the end...
GEP1Ops.resize(MinOperands);
int64_t Offset2 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops);
-
+
// If the tail provided a bit enough offset, return noalias!
if ((uint64_t)(Offset2-Offset1) >= SizeMax)
return NoAlias;
}
}
-
+
// Couldn't find anything useful.
return MayAlias;
}
@@ -604,7 +604,7 @@
// Advance BasePtr[12]Ty over this first differing constant operand.
BasePtr2Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(GEP2Ops[FirstConstantOper]);
BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(GEP1Ops[FirstConstantOper]);
-
+
// We are going to be using TargetData::getIndexedOffset to determine the
// offset that each of the GEP's is reaching. To do this, we have to convert
// all variable references to constant references. To do this, we convert the
@@ -614,7 +614,7 @@
GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Type::UIntTy);
// We know that GEP1Ops[FirstConstantOper] & GEP2Ops[FirstConstantOper] are ok
-
+
// Loop over the rest of the operands...
for (unsigned i = FirstConstantOper+1; i != MaxOperands; ++i) {
const Value *Op1 = i < GEP1Ops.size() ? GEP1Ops[i] : 0;
@@ -631,7 +631,7 @@
if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
if (Op1C->getRawValue() >= AT->getNumElements())
return MayAlias; // Be conservative with out-of-range accesses
-
+
} else {
// GEP1 is known to produce a value less than GEP2. To be
// conservatively correct, we must assume the largest possible
@@ -647,7 +647,7 @@
GEP1Ops[i] = ConstantSInt::get(Type::LongTy,AT->getNumElements()-1);
}
}
-
+
if (Op2) {
if (const ConstantInt *Op2C = dyn_cast<ConstantInt>(Op2)) {
// If this is an array index, make sure the array element is in range.
@@ -674,14 +674,14 @@
BasePtr2Ty = 0;
}
}
-
+
if (GEPPointerTy->getElementType()->isSized()) {
int64_t Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops);
int64_t Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops);
assert(Offset1<Offset2 && "There is at least one different constant here!");
if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
- //std::cerr << "Determined that these two GEP's don't alias ["
+ //std::cerr << "Determined that these two GEP's don't alias ["
// << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
return NoAlias;
}
@@ -706,11 +706,11 @@
"abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl",
"trunc", "truncf", "truncl", "ldexp",
-
+
"atan", "atanf", "atanl", "atan2", "atan2f", "atan2l",
"cbrt",
"cos", "cosf", "cosl", "cosh", "coshf", "coshl",
- "exp", "expf", "expl",
+ "exp", "expf", "expl",
"hypot",
"sin", "sinf", "sinl", "sinh", "sinhf", "sinhl",
"tan", "tanf", "tanl", "tanh", "tanhf", "tanhl",
@@ -723,9 +723,9 @@
"iswalnum", "iswalpha", "iswcntrl", "iswdigit", "iswgraph", "iswlower",
"iswprint", "iswpunct", "iswspace", "iswupper", "iswxdigit",
- "iswctype", "towctrans", "towlower", "towupper",
+ "iswctype", "towctrans", "towlower", "towupper",
- "btowc", "wctob",
+ "btowc", "wctob",
"isinf", "isnan", "finite",
@@ -744,16 +744,16 @@
static const char *OnlyReadsMemoryTable[] = {
"atoi", "atol", "atof", "atoll", "atoq", "a64l",
- "bcmp", "memcmp", "memchr", "memrchr", "wmemcmp", "wmemchr",
+ "bcmp", "memcmp", "memchr", "memrchr", "wmemcmp", "wmemchr",
// Strings
"strcmp", "strcasecmp", "strcoll", "strncmp", "strncasecmp",
- "strchr", "strcspn", "strlen", "strpbrk", "strrchr", "strspn", "strstr",
+ "strchr", "strcspn", "strlen", "strpbrk", "strrchr", "strspn", "strstr",
"index", "rindex",
// Wide char strings
"wcschr", "wcscmp", "wcscoll", "wcscspn", "wcslen", "wcsncmp", "wcspbrk",
- "wcsrchr", "wcsspn", "wcsstr",
+ "wcsrchr", "wcsspn", "wcsstr",
// glibc
"alphasort", "alphasort64", "versionsort", "versionsort64",
@@ -768,8 +768,8 @@
static const unsigned ORMTableSize =
sizeof(OnlyReadsMemoryTable)/sizeof(OnlyReadsMemoryTable[0]);
-
-AliasAnalysis::ModRefBehavior
+
+AliasAnalysis::ModRefBehavior
BasicAliasAnalysis::getModRefBehavior(Function *F, CallSite CS,
std::vector<PointerAccessInfo> *Info) {
if (!F->isExternal()) return UnknownModRefBehavior;
@@ -789,7 +789,7 @@
F->getName().c_str(), StringCompare());
if (Ptr != DoesntAccessMemoryTable+DAMTableSize && *Ptr == F->getName())
return DoesNotAccessMemory;
-
+
Ptr = std::lower_bound(OnlyReadsMemoryTable,
OnlyReadsMemoryTable+ORMTableSize,
F->getName().c_str(), StringCompare());
Index: llvm/lib/Analysis/CFGPrinter.cpp
diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.11 llvm/lib/Analysis/CFGPrinter.cpp:1.12
--- llvm/lib/Analysis/CFGPrinter.cpp:1.11 Mon Dec 6 22:03:45 2004
+++ llvm/lib/Analysis/CFGPrinter.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- CFGPrinter.cpp - DOT printer for the control flow graph ------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines a '-print-cfg' analysis pass, which emits the
@@ -92,7 +92,7 @@
std::string Filename = "cfg." + F.getName() + ".dot";
std::cerr << "Writing '" << Filename << "'...";
std::ofstream File(Filename.c_str());
-
+
if (File.good())
WriteGraph(File, (const Function*)&F);
else
@@ -102,7 +102,7 @@
}
void print(std::ostream &OS, const Module* = 0) const {}
-
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
@@ -120,7 +120,7 @@
return false;
}
void print(std::ostream &OS, const Module* = 0) const {}
-
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
@@ -140,7 +140,7 @@
std::string Filename = "/tmp/cfg." + getName() + ".dot";
std::cerr << "Writing '" << Filename << "'... ";
std::ofstream F(Filename.c_str());
-
+
if (!F.good()) {
std::cerr << " error opening file for writing!\n";
return;
Index: llvm/lib/Analysis/Expressions.cpp
diff -u llvm/lib/Analysis/Expressions.cpp:1.43 llvm/lib/Analysis/Expressions.cpp:1.44
--- llvm/lib/Analysis/Expressions.cpp:1.43 Sun Jul 4 07:19:55 2004
+++ llvm/lib/Analysis/Expressions.cpp Thu Apr 21 16:04:58 2005
@@ -1,16 +1,16 @@
//===- Expressions.cpp - Expression Analysis Utilities --------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines a package of expression analysis utilties:
//
// ClassifyExpression: Analyze an expression to determine the complexity of the
-// expression, and which other variables it depends on.
+// expression, and which other variables it depends on.
//
//===----------------------------------------------------------------------===//
@@ -23,7 +23,7 @@
using namespace llvm;
ExprType::ExprType(Value *Val) {
- if (Val)
+ if (Val)
if (ConstantInt *CPI = dyn_cast<ConstantInt>(Val)) {
Offset = CPI;
Var = 0;
@@ -37,7 +37,7 @@
Scale = 0;
}
-ExprType::ExprType(const ConstantInt *scale, Value *var,
+ExprType::ExprType(const ConstantInt *scale, Value *var,
const ConstantInt *offset) {
Scale = var ? scale : 0; Var = var; Offset = offset;
ExprTy = Scale ? ScaledLinear : (Var ? Linear : Constant);
@@ -67,12 +67,12 @@
inline operator const ConstantInt * () const { return Val; }
inline const ConstantInt *operator->() const { return Val; }
};
-
+
struct DefZero : public DefVal {
inline DefZero(const ConstantInt *val, const Type *ty) : DefVal(val, ty) {}
inline DefZero(const ConstantInt *val) : DefVal(val, val->getType()) {}
};
-
+
struct DefOne : public DefVal {
inline DefOne(const ConstantInt *val, const Type *ty) : DefVal(val, ty) {}
};
@@ -160,7 +160,7 @@
// 3. If DefOne is true, a null return value indicates a value of 1, if DefOne
// is false, a null return value indicates a value of 0.
//
-static inline const ConstantInt *Mul(const ConstantInt *Arg1,
+static inline const ConstantInt *Mul(const ConstantInt *Arg1,
const ConstantInt *Arg2, bool DefOne) {
assert(Arg1 && Arg2 && "No null arguments should exist now!");
assert(Arg1->getType() == Arg2->getType() && "Types must be compatible!");
@@ -168,7 +168,7 @@
// Actually perform the computation now!
Constant *Result = ConstantExpr::get(Instruction::Mul, (Constant*)Arg1,
(Constant*)Arg2);
- assert(Result && Result->getType() == Arg1->getType() &&
+ assert(Result && Result->getType() == Arg1->getType() &&
"Couldn't perform multiplication!");
ConstantInt *ResultI = cast<ConstantInt>(Result);
@@ -257,7 +257,7 @@
return Expr;
}
-
+
Instruction *I = cast<Instruction>(Expr);
const Type *Ty = I->getType();
@@ -277,7 +277,7 @@
return handleAddition(Left, RightNeg, I);
} // end case Instruction::Sub
- case Instruction::Shl: {
+ case Instruction::Shl: {
ExprType Right(ClassifyExpr(I->getOperand(1)));
if (Right.ExprTy != ExprType::Constant) break;
ExprType Left(ClassifyExpr(I->getOperand(0)));
Index: llvm/lib/Analysis/InstCount.cpp
diff -u llvm/lib/Analysis/InstCount.cpp:1.11 llvm/lib/Analysis/InstCount.cpp:1.12
--- llvm/lib/Analysis/InstCount.cpp:1.11 Mon Mar 21 21:55:10 2005
+++ llvm/lib/Analysis/InstCount.cpp Thu Apr 21 16:04:58 2005
@@ -1,13 +1,13 @@
//===-- InstCount.cpp - Collects the count of all instructions ------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
-// This pass collects the count of all instructions and reports them
+// This pass collects the count of all instructions and reports them
//
//===----------------------------------------------------------------------===//
@@ -62,11 +62,11 @@
//
bool InstCount::runOnFunction(Function &F) {
unsigned StartMemInsts =
- NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
+ NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
NumInvokeInst + NumAllocaInst + NumMallocInst + NumFreeInst;
visit(F);
unsigned EndMemInsts =
- NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
+ NumGetElementPtrInst + NumLoadInst + NumStoreInst + NumCallInst +
NumInvokeInst + NumAllocaInst + NumMallocInst + NumFreeInst;
TotalMemInst += EndMemInsts-StartMemInsts;
return false;
Index: llvm/lib/Analysis/Interval.cpp
diff -u llvm/lib/Analysis/Interval.cpp:1.16 llvm/lib/Analysis/Interval.cpp:1.17
--- llvm/lib/Analysis/Interval.cpp:1.16 Wed Jul 14 21:31:42 2004
+++ llvm/lib/Analysis/Interval.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- Interval.cpp - Interval class code ---------------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file contains the definition of the Interval class, which represents a
@@ -39,7 +39,7 @@
void Interval::print(std::ostream &o) const {
o << "-------------------------------------------------------------\n"
<< "Interval Contents:\n";
-
+
// Print out all of the basic blocks in the interval...
for (std::vector<BasicBlock*>::const_iterator I = Nodes.begin(),
E = Nodes.end(); I != E; ++I)
Index: llvm/lib/Analysis/IntervalPartition.cpp
diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.28 llvm/lib/Analysis/IntervalPartition.cpp:1.29
--- llvm/lib/Analysis/IntervalPartition.cpp:1.28 Tue Feb 22 17:27:21 2005
+++ llvm/lib/Analysis/IntervalPartition.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- IntervalPartition.cpp - Interval Partition module code -------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file contains the definition of the IntervalPartition class, which
@@ -55,7 +55,7 @@
//
void IntervalPartition::updatePredecessors(Interval *Int) {
BasicBlock *Header = Int->getHeaderNode();
- for (Interval::succ_iterator I = Int->Successors.begin(),
+ for (Interval::succ_iterator I = Int->Successors.begin(),
E = Int->Successors.end(); I != E; ++I)
getBlockInterval(*I)->Predecessors.push_back(Header);
}
Index: llvm/lib/Analysis/LoadValueNumbering.cpp
diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.30 llvm/lib/Analysis/LoadValueNumbering.cpp:1.31
--- llvm/lib/Analysis/LoadValueNumbering.cpp:1.30 Sat Jan 29 01:04:10 2005
+++ llvm/lib/Analysis/LoadValueNumbering.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- LoadValueNumbering.cpp - Load Value #'ing Implementation -*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements a value numbering pass that value numbers load and call
@@ -39,16 +39,16 @@
namespace {
// FIXME: This should not be a FunctionPass.
struct LoadVN : public FunctionPass, public ValueNumbering {
-
+
/// Pass Implementation stuff. This doesn't do any analysis.
///
bool runOnFunction(Function &) { return false; }
-
+
/// getAnalysisUsage - Does not modify anything. It uses Value Numbering
/// and Alias Analysis.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
-
+
/// getEqualNumberNodes - Return nodes with the same value number as the
/// specified Value. This fills in the argument vector with any equal
/// values.
@@ -63,7 +63,7 @@
virtual void deleteValue(Value *V) {
getAnalysis<AliasAnalysis>().deleteValue(V);
}
-
+
/// copyValue - This method should be used whenever a preexisting value in
/// the program is copied or cloned, introducing a new value. Note that
/// analysis implementations should tolerate clients that use this method to
@@ -109,7 +109,7 @@
// stop searching, returning success.
if (CurBlock == Dom || !Visited.insert(CurBlock).second)
return true;
-
+
// Check whether this block is known transparent or not.
std::map<BasicBlock*, bool>::iterator TBI =
TransparentBlocks.lower_bound(CurBlock);
@@ -125,7 +125,7 @@
} else if (!TBI->second)
// This block is known non-transparent, so that path can't be either.
return false;
-
+
// The current block is known to be transparent. The entire path is
// transparent if all of the predecessors paths to the parent is also
// transparent to the memory location.
@@ -180,7 +180,7 @@
if (AllOperandsEqual)
IdenticalCalls.push_back(C);
}
-
+
if (IdenticalCalls.empty()) return;
// Eliminate duplicates, which could occur if we chose a value that is passed
@@ -212,7 +212,7 @@
Instruction *First = CI, *Second = C;
if (!DomSetInfo.dominates(CI, C))
std::swap(First, Second);
-
+
// Scan the instructions between the calls, checking for stores or
// calls to dangerous functions.
BasicBlock::iterator I = First;
@@ -283,7 +283,7 @@
LoadInst *LI = cast<LoadInst>(V);
if (LI->isVolatile())
return getAnalysis<ValueNumbering>().getEqualNumberNodes(V, RetVals);
-
+
Value *LoadPtr = LI->getOperand(0);
BasicBlock *LoadBB = LI->getParent();
Function *F = LoadBB->getParent();
@@ -351,14 +351,14 @@
// no need to do any global analysis at all.
if (LoadInvalidatedInBBBefore && LoadInvalidatedInBBAfter)
return;
-
+
// Now that we know the value is not neccesarily killed on entry or exit to
// the BB, find out how many load and store instructions (to this location)
// live in each BB in the function.
//
std::map<BasicBlock*, unsigned> CandidateLoads;
std::set<BasicBlock*> CandidateStores;
-
+
for (Value::use_iterator UI = LoadPtr->use_begin(), UE = LoadPtr->use_end();
UI != UE; ++UI)
if (LoadInst *Cand = dyn_cast<LoadInst>(*UI)) {// Is a load of source?
@@ -476,7 +476,7 @@
// Stores in the load-bb are handled above.
CandidateStores.erase(LoadBB);
-
+
for (std::set<BasicBlock*>::iterator I = CandidateStores.begin(),
E = CandidateStores.end(); I != E; ++I)
if (DomSetInfo.dominates(*I, LoadBB)) {
Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.61 llvm/lib/Analysis/LoopInfo.cpp:1.62
--- llvm/lib/Analysis/LoopInfo.cpp:1.61 Mon Dec 6 22:03:45 2004
+++ llvm/lib/Analysis/LoopInfo.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- LoopInfo.cpp - Natural Loop Calculator -----------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines the LoopInfo class that is used to identify natural loops
@@ -175,7 +175,7 @@
std::find(SLP->SubLoops.begin(), SLP->SubLoops.end(), SubLoop);
assert(I != SLP->SubLoops.end() && "SubLoop not a child of parent?");
SLP->SubLoops.erase(I); // Remove from parent...
-
+
// Add the subloop to THIS loop...
SubLoop->ParentLoop = L;
L->SubLoops.push_back(SubLoop);
@@ -183,7 +183,7 @@
// Normal case, add the block to our loop...
L->Blocks.push_back(X);
-
+
// Add all of the predecessors of X to the end of the work stack...
TodoStack.insert(TodoStack.end(), pred_begin(X), pred_end(X));
}
@@ -243,7 +243,7 @@
--i; // We just shrunk the SubLoops list.
}
}
- }
+ }
}
}
@@ -263,8 +263,8 @@
assert(I != OldParent->SubLoops.end() && "Parent fields incorrect??");
OldParent->SubLoops.erase(I); // Remove from parent's subloops list
NewChild->ParentLoop = 0;
-
- InsertLoopInto(NewChild, NewParent);
+
+ InsertLoopInto(NewChild, NewParent);
}
/// InsertLoopInto - This inserts loop L into the specified parent loop. If the
@@ -273,13 +273,13 @@
void LoopInfo::InsertLoopInto(Loop *L, Loop *Parent) {
BasicBlock *LHeader = L->getHeader();
assert(Parent->contains(LHeader) && "This loop should not be inserted here!");
-
+
// Check to see if it belongs in a child loop...
for (unsigned i = 0, e = Parent->SubLoops.size(); i != e; ++i)
if (Parent->SubLoops[i]->contains(LHeader)) {
InsertLoopInto(L, Parent->SubLoops[i]);
return;
- }
+ }
// If not, insert it here!
Parent->SubLoops.push_back(L);
@@ -325,7 +325,7 @@
if (I != BBMap.end()) {
for (Loop *L = I->second; L; L = L->getParentLoop())
L->removeBlockFromLoop(BB);
-
+
BBMap.erase(I);
}
}
@@ -367,7 +367,7 @@
return 0; // Multiple predecessors outside the loop
Out = *PI;
}
-
+
// Make sure there is only one exit out of the preheader...
succ_iterator SI = succ_begin(Out);
++SI;
@@ -439,7 +439,7 @@
Instruction *Inc = getCanonicalInductionVariableIncrement();
if (Inc == 0) return 0;
PHINode *IV = cast<PHINode>(Inc->getOperand(0));
-
+
BasicBlock *BackedgeBlock =
IV->getIncomingBlock(contains(IV->getIncomingBlock(1)));
@@ -453,7 +453,7 @@
} else if (SCI->getOpcode() == Instruction::SetEQ) {
return SCI->getOperand(1);
}
-
+
return 0;
}
Index: llvm/lib/Analysis/PostDominators.cpp
diff -u llvm/lib/Analysis/PostDominators.cpp:1.50 llvm/lib/Analysis/PostDominators.cpp:1.51
--- llvm/lib/Analysis/PostDominators.cpp:1.50 Sat Oct 16 13:15:15 2004
+++ llvm/lib/Analysis/PostDominators.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- PostDominators.cpp - Post-Dominator Calculation --------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the post-dominator construction algorithms.
@@ -73,7 +73,7 @@
//
while (Doms[*SI].size() == 0) ++SI;
WorkingSet = Doms[*SI];
-
+
for (++SI; SI != SE; ++SI) { // Intersect all of the successor sets
DomSetType &SuccSet = Doms[*SI];
if (SuccSet.size())
@@ -115,7 +115,7 @@
// Loop over all of the nodes that have dominators... figuring out the IDOM
// for each node...
//
- for (DominatorSet::const_iterator DI = DS.begin(), DEnd = DS.end();
+ for (DominatorSet::const_iterator DI = DS.begin(), DEnd = DS.end();
DI != DEnd; ++DI) {
BasicBlock *BB = DI->first;
const DominatorSet::DomSetType &Dominators = DI->second;
@@ -133,7 +133,7 @@
for (; I != End; ++I) { // Iterate over dominators...
// All of our dominators should form a chain, where the number of elements
// in the dominator set indicates what level the node is at in the chain.
- // We want the node immediately above us, so it will have an identical
+ // We want the node immediately above us, so it will have an identical
// dominator set, except that BB will not dominate it... therefore it's
// dominator set size will be one less than BB's...
//
@@ -191,12 +191,12 @@
// dominator set size will be one less than BB's...
//
if (DS.getDominators(*I).size() == DomSetSize - 1) {
- // We know that the immediate dominator should already have a node,
+ // We know that the immediate dominator should already have a node,
// because we are traversing the CFG in depth first order!
//
Node *IDomNode = Nodes[*I];
assert(IDomNode && "No node for IDOM?");
-
+
// Add a new tree node for this BasicBlock, and link it as a child of
// IDomNode
Nodes[BB] = IDomNode->addChild(new Node(BB, IDomNode));
@@ -214,7 +214,7 @@
H("postdomfrontier", "Post-Dominance Frontier Construction", true);
const DominanceFrontier::DomSetType &
-PostDominanceFrontier::calculate(const PostDominatorTree &DT,
+PostDominanceFrontier::calculate(const PostDominatorTree &DT,
const DominatorTree::Node *Node) {
// Loop over CFG successors to calculate DFlocal[Node]
BasicBlock *BB = Node->getBlock();
Index: llvm/lib/Analysis/ProfileInfo.cpp
diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.6 llvm/lib/Analysis/ProfileInfo.cpp:1.7
--- llvm/lib/Analysis/ProfileInfo.cpp:1.6 Sat Jan 8 16:01:16 2005
+++ llvm/lib/Analysis/ProfileInfo.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- ProfileInfo.cpp - Profile Info Interface ---------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the abstract ProfileInfo interface, and the default
@@ -83,7 +83,7 @@
namespace {
struct NoProfileInfo : public ImmutablePass, public ProfileInfo {};
-
+
// Register this pass...
RegisterOpt<NoProfileInfo>
X("no-profile", "No Profile Information");
Index: llvm/lib/Analysis/ProfileInfoLoader.cpp
diff -u llvm/lib/Analysis/ProfileInfoLoader.cpp:1.7 llvm/lib/Analysis/ProfileInfoLoader.cpp:1.8
--- llvm/lib/Analysis/ProfileInfoLoader.cpp:1.7 Sun Jul 4 07:19:55 2004
+++ llvm/lib/Analysis/ProfileInfoLoader.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- ProfileInfoLoad.cpp - Load profile information from disk -----------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// The ProfileInfoLoader class is used to load and represent profiling
@@ -26,9 +26,9 @@
//
static inline unsigned ByteSwap(unsigned Var, bool Really) {
if (!Really) return Var;
- return ((Var & (255<< 0)) << 24) |
- ((Var & (255<< 8)) << 8) |
- ((Var & (255<<16)) >> 8) |
+ return ((Var & (255<< 0)) << 24) |
+ ((Var & (255<< 8)) << 8) |
+ ((Var & (255<<16)) >> 8) |
((Var & (255<<24)) >> 24);
}
@@ -57,7 +57,7 @@
// Make sure we have enough space...
if (Data.size() < NumEntries)
Data.resize(NumEntries);
-
+
// Accumulate the data we just read into the data.
if (!ShouldByteSwap) {
for (unsigned i = 0; i != NumEntries; ++i)
@@ -112,11 +112,11 @@
CommandLines.push_back(std::string(&Chars[0], &Chars[ArgLength]));
break;
}
-
+
case FunctionInfo:
ReadProfilingBlock(ToolName, F, ShouldByteSwap, FunctionCounts);
break;
-
+
case BlockInfo:
ReadProfilingBlock(ToolName, F, ShouldByteSwap, BlockCounts);
break;
@@ -134,7 +134,7 @@
exit(1);
}
}
-
+
fclose(F);
}
@@ -151,7 +151,7 @@
// their entry blocks were executed.
std::vector<std::pair<BasicBlock*, unsigned> > BlockCounts;
getBlockCounts(BlockCounts);
-
+
for (unsigned i = 0, e = BlockCounts.size(); i != e; ++i)
if (&BlockCounts[i].first->getParent()->front() == BlockCounts[i].first)
Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(),
@@ -161,7 +161,7 @@
}
return;
}
-
+
unsigned Counter = 0;
for (Module::iterator I = M.begin(), E = M.end();
I != E && Counter != FunctionCounts.size(); ++I)
Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp
diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.11 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.12
--- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.11 Thu Mar 17 23:27:57 2005
+++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- ProfileInfoLoaderPass.cpp - LLVM Pass to load profile info ---------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements a concrete implementation of profiling information that
@@ -48,7 +48,7 @@
/// run - Load the profile information from the specified file.
virtual bool runOnModule(Module &M);
};
-
+
RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out",
PassInfo::Analysis|PassInfo::Optimization);
@@ -69,7 +69,7 @@
ProfileInfoLoader PIL("profile-loader", Filename, M);
EdgeCounts.clear();
bool PrintedWarning = false;
-
+
std::vector<std::pair<ProfileInfoLoader::Edge, unsigned> > ECs;
PIL.getEdgeCounts(ECs);
for (unsigned i = 0, e = ECs.size(); i != e; ++i) {
Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.37 llvm/lib/Analysis/ScalarEvolution.cpp:1.38
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.37 Wed Apr 6 16:45:00 2005
+++ llvm/lib/Analysis/ScalarEvolution.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- ScalarEvolution.cpp - Scalar Evolution Analysis ----------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file contains the implementation of the scalar evolution analysis
@@ -28,7 +28,7 @@
// have folders that are used to build the *canonical* representation for a
// particular expression. These folders are capable of using a variety of
// rewrite rules to simplify the expressions.
-//
+//
// Once the folders are defined, we can implement the more interesting
// higher-level code, such as the code that recognizes PHI nodes of various
// types, computes the execution count of a loop, etc.
@@ -163,7 +163,7 @@
// particular value. Don't use a SCEVHandle here, or else the object will
// never be deleted!
static std::map<ConstantInt*, SCEVConstant*> SCEVConstants;
-
+
SCEVConstant::~SCEVConstant() {
SCEVConstants.erase(V);
@@ -175,7 +175,7 @@
const Type *NewTy = V->getType()->getUnsignedVersion();
V = cast<ConstantUInt>(ConstantExpr::getCast(V, NewTy));
}
-
+
SCEVConstant *&R = SCEVConstants[V];
if (R == 0) R = new SCEVConstant(V);
return R;
@@ -337,7 +337,7 @@
for (++i; i != e; ++i)
NewOps.push_back(getOperand(i)->
replaceSymbolicValuesWithConcrete(Sym, Conc));
-
+
return get(NewOps, L);
}
}
@@ -451,7 +451,7 @@
/// specified signed integer value and return a SCEV for the constant.
SCEVHandle SCEVUnknown::getIntegerSCEV(int Val, const Type *Ty) {
Constant *C;
- if (Val == 0)
+ if (Val == 0)
C = Constant::getNullValue(Ty);
else if (Ty->isFloatingPoint())
C = ConstantFP::get(Ty, Val);
@@ -483,7 +483,7 @@
SCEVHandle SCEV::getNegativeSCEV(const SCEVHandle &V) {
if (SCEVConstant *VC = dyn_cast<SCEVConstant>(V))
return SCEVUnknown::get(ConstantExpr::getNeg(VC->getValue()));
-
+
return SCEVMulExpr::get(V, SCEVUnknown::getIntegerSCEV(-1, V->getType()));
}
@@ -511,7 +511,7 @@
const Type *Ty = V->getType();
if (NumSteps == 0)
return SCEVUnknown::getIntegerSCEV(1, Ty);
-
+
SCEVHandle Result = V;
for (unsigned i = 1; i != NumSteps; ++i)
Result = SCEVMulExpr::get(Result, SCEV::getMinusSCEV(V,
@@ -623,7 +623,7 @@
}
if (Ops.size() == 1) return Ops[0];
-
+
// Okay, check to see if the same value occurs in the operand list twice. If
// so, merge them together into an multiply expression. Since we sorted the
// list, these values are required to be adjacent.
@@ -696,7 +696,7 @@
Ops.push_back(OuterMul);
return SCEVAddExpr::get(Ops);
}
-
+
// Check this multiply against other multiplies being added together.
for (unsigned OtherMulIdx = Idx+1;
OtherMulIdx < Ops.size() && isa<SCEVMulExpr>(Ops[OtherMulIdx]);
@@ -868,7 +868,7 @@
if (Ops.size() == 1)
return Ops[0];
-
+
// If there are mul operands inline them all into this expression.
if (Idx < Ops.size()) {
bool DeletedMul = false;
@@ -1086,7 +1086,7 @@
/// properties. An instruction maps to null if we are unable to compute its
/// exit value.
std::map<PHINode*, Constant*> ConstantEvolutionLoopExitValue;
-
+
public:
ScalarEvolutionsImpl(Function &f, LoopInfo &li)
: F(f), LI(li), UnknownValue(new SCEVCouldNotCompute()) {}
@@ -1230,7 +1230,7 @@
// from outside the loop, and one from inside.
unsigned IncomingEdge = L->contains(PN->getIncomingBlock(0));
unsigned BackEdge = IncomingEdge^1;
-
+
// While we are analyzing this PHI node, handle its value symbolically.
SCEVHandle SymbolicName = SCEVUnknown::get(PN);
assert(Scalars.find(PN) == Scalars.end() &&
@@ -1286,7 +1286,7 @@
return SymbolicName;
}
-
+
// If it's not a loop phi, we can't handle it yet.
return SCEVUnknown::get(PN);
}
@@ -1296,11 +1296,11 @@
SCEVHandle ScalarEvolutionsImpl::createNodeForCast(CastInst *CI) {
const Type *SrcTy = CI->getOperand(0)->getType();
const Type *DestTy = CI->getType();
-
+
// If this is a noop cast (ie, conversion from int to uint), ignore it.
if (SrcTy->isLosslesslyConvertibleTo(DestTy))
return getSCEV(CI->getOperand(0));
-
+
if (SrcTy->isInteger() && DestTy->isInteger()) {
// Otherwise, if this is a truncating integer cast, we can represent this
// cast.
@@ -1486,7 +1486,7 @@
if (CompVal) {
// Form the constant range.
ConstantRange CompRange(Cond, CompVal);
-
+
// Now that we have it, if it's signed, convert it to an unsigned
// range.
if (CompRange.getLower()->getType()->isSigned()) {
@@ -1495,12 +1495,12 @@
Constant *NewU = ConstantExpr::getCast(CompRange.getUpper(), NewTy);
CompRange = ConstantRange(NewL, NewU);
}
-
+
SCEVHandle Ret = AddRec->getNumIterationsInRange(CompRange);
if (!isa<SCEVCouldNotCompute>(Ret)) return Ret;
}
}
-
+
switch (Cond) {
case Instruction::SetNE: // while (X != Y)
// Convert to: while (X-Y != 0)
@@ -1545,7 +1545,7 @@
/// the addressed element of the initializer or null if the index expression is
/// invalid.
static Constant *
-GetAddressedElementFromGlobal(GlobalVariable *GV,
+GetAddressedElementFromGlobal(GlobalVariable *GV,
const std::vector<ConstantInt*> &Indices) {
Constant *Init = GV->getInitializer();
for (unsigned i = 0, e = Indices.size(); i != e; ++i) {
@@ -1577,7 +1577,7 @@
/// ComputeLoadConstantCompareIterationCount - Given an exit condition of
/// 'setcc load X, cst', try to se if we can compute the trip count.
SCEVHandle ScalarEvolutionsImpl::
-ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
+ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
const Loop *L, unsigned SetCCOpcode) {
if (LI->isVolatile()) return UnknownValue;
@@ -1656,7 +1656,7 @@
if (isa<BinaryOperator>(I) || isa<ShiftInst>(I) ||
isa<SelectInst>(I) || isa<CastInst>(I) || isa<GetElementPtrInst>(I))
return true;
-
+
if (const CallInst *CI = dyn_cast<CallInst>(I))
if (const Function *F = CI->getCalledFunction())
return canConstantFoldCallTo((Function*)F); // FIXME: elim cast
@@ -1713,7 +1713,7 @@
// If we won't be able to constant fold this expression even if the operands
// are constants, return early.
if (!CanConstantFold(I)) return 0;
-
+
// Otherwise, we can evaluate this instruction if all of its operands are
// constant or derived from a PHI node themselves.
PHINode *PHI = 0;
@@ -1765,7 +1765,7 @@
if (I != ConstantEvolutionLoopExitValue.end())
return I->second;
- if (Its > MaxBruteForceIterations)
+ if (Its > MaxBruteForceIterations)
return ConstantEvolutionLoopExitValue[PN] = 0; // Not going to evaluate it.
Constant *&RetVal = ConstantEvolutionLoopExitValue[PN];
@@ -1842,7 +1842,7 @@
++NumBruteForceTripCountsComputed;
return SCEVConstant::get(ConstantUInt::get(Type::UIntTy, IterationNum));
}
-
+
// Compute the value of the PHI node for the next iteration.
Constant *NextPHI = EvaluateExpression(BEValue, PHIVal);
if (NextPHI == 0 || NextPHI == PHIVal)
@@ -1861,7 +1861,7 @@
// FIXME: this should be turned into a virtual method on SCEV!
if (isa<SCEVConstant>(V)) return V;
-
+
// If this instruction is evolves from a constant-evolving PHI, compute the
// exit value from the loop without using SCEVs.
if (SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V)) {
@@ -1966,7 +1966,7 @@
if (IterationCount == UnknownValue) return UnknownValue;
IterationCount = getTruncateOrZeroExtend(IterationCount,
AddRec->getType());
-
+
// If the value is affine, simplify the expression evaluation to just
// Start + Step*IterationCount.
if (AddRec->isAffine())
@@ -1995,7 +1995,7 @@
SCEVConstant *L = dyn_cast<SCEVConstant>(AddRec->getOperand(0));
SCEVConstant *M = dyn_cast<SCEVConstant>(AddRec->getOperand(1));
SCEVConstant *N = dyn_cast<SCEVConstant>(AddRec->getOperand(2));
-
+
// We currently can only solve this if the coefficients are constants.
if (!L || !M || !N) {
SCEV *CNC = new SCEVCouldNotCompute();
@@ -2003,7 +2003,7 @@
}
Constant *Two = ConstantInt::get(L->getValue()->getType(), 2);
-
+
// Convert from chrec coefficients to polynomial coefficients AX^2+BX+C
Constant *C = L->getValue();
// The B coefficient is M-N/2
@@ -2012,7 +2012,7 @@
Two));
// The A coefficient is N/2
Constant *A = ConstantExpr::getDiv(N->getValue(), Two);
-
+
// Compute the B^2-4ac term.
Constant *SqrtTerm =
ConstantExpr::getMul(ConstantInt::get(C->getType(), 4),
@@ -2035,16 +2035,16 @@
SqrtVal = ConstantUInt::get(Type::ULongTy, SqrtValV2);
SqrtTerm = ConstantExpr::getCast(SqrtVal, SqrtTerm->getType());
-
+
Constant *NegB = ConstantExpr::getNeg(B);
Constant *TwoA = ConstantExpr::getMul(A, Two);
-
+
// The divisions must be performed as signed divisions.
const Type *SignedTy = NegB->getType()->getSignedVersion();
NegB = ConstantExpr::getCast(NegB, SignedTy);
TwoA = ConstantExpr::getCast(TwoA, SignedTy);
SqrtTerm = ConstantExpr::getCast(SqrtTerm, SignedTy);
-
+
Constant *Solution1 =
ConstantExpr::getDiv(ConstantExpr::getAdd(NegB, SqrtTerm), TwoA);
Constant *Solution2 =
@@ -2117,7 +2117,7 @@
R2->getValue()))) {
if (CB != ConstantBool::True)
std::swap(R1, R2); // R1 is the minimum root now.
-
+
// We can only use this value if the chrec ends up with an exact zero
// value at this index. When solving for "X*X != 5", for example, we
// should not accept a root of 2.
@@ -2128,7 +2128,7 @@
}
}
}
-
+
return UnknownValue;
}
@@ -2139,7 +2139,7 @@
// Loops that look like: while (X == 0) are very strange indeed. We don't
// handle them yet except for the trivial case. This could be expanded in the
// future as needed.
-
+
// If the value is a constant, check to see if it is known to be non-zero
// already. If so, the backedge will execute zero times.
if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) {
@@ -2149,7 +2149,7 @@
return getSCEV(Zero);
return UnknownValue; // Otherwise it will loop infinitely.
}
-
+
// We could implement others, but I really doubt anyone writes loops like
// this, and if they did, they would already be constant folded.
return UnknownValue;
@@ -2191,7 +2191,7 @@
// iteration exits.
ConstantInt *Zero = ConstantInt::get(getType(), 0);
if (!Range.contains(Zero)) return SCEVConstant::get(Zero);
-
+
if (isAffine()) {
// If this is an affine expression then we have this situation:
// Solve {0,+,A} in Range === Ax in Range
@@ -2246,7 +2246,7 @@
R2->getValue()))) {
if (CB != ConstantBool::True)
std::swap(R1, R2); // R1 is the minimum root now.
-
+
// Make sure the root is not off by one. The returned iteration should
// not be in the range, but the previous one should be. When solving
// for "X*X < 5", for example, we should not return a root of 2.
@@ -2257,13 +2257,13 @@
Constant *NextVal =
ConstantExpr::getAdd(R1->getValue(),
ConstantInt::get(R1->getType(), 1));
-
+
R1Val = EvaluateConstantChrecAtConstant(this, NextVal);
if (!Range.contains(R1Val))
return SCEVUnknown::get(NextVal);
return new SCEVCouldNotCompute(); // Something strange happened
}
-
+
// If R1 was not in the range, then it is a good return value. Make
// sure that R1-1 WAS in the range though, just in case.
Constant *NextVal =
@@ -2298,7 +2298,7 @@
// Increment to test the next index.
TestVal = cast<ConstantInt>(ConstantExpr::getAdd(TestVal, One));
} while (TestVal != EndVal);
-
+
return new SCEVCouldNotCompute();
}
@@ -2343,12 +2343,12 @@
return ((ScalarEvolutionsImpl*)Impl)->deleteInstructionFromRecords(I);
}
-static void PrintLoopInfo(std::ostream &OS, const ScalarEvolution *SE,
+static void PrintLoopInfo(std::ostream &OS, const ScalarEvolution *SE,
const Loop *L) {
// Print all inner loops first
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
PrintLoopInfo(OS, SE, *I);
-
+
std::cerr << "Loop " << L->getHeader()->getName() << ": ";
std::vector<BasicBlock*> ExitBlocks;
@@ -2377,7 +2377,7 @@
SCEVHandle SV = getSCEV(&*I);
SV->print(OS);
OS << "\t\t";
-
+
if ((*I).getType()->isIntegral()) {
ConstantRange Bounds = SV->getValueRange();
if (!Bounds.isFullSet())
Index: llvm/lib/Analysis/ValueNumbering.cpp
diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.14 llvm/lib/Analysis/ValueNumbering.cpp:1.15
--- llvm/lib/Analysis/ValueNumbering.cpp:1.14 Sat Jan 8 16:01:16 2005
+++ llvm/lib/Analysis/ValueNumbering.cpp Thu Apr 21 16:04:58 2005
@@ -1,10 +1,10 @@
//===- ValueNumbering.cpp - Value #'ing Implementation ----------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the non-abstract Value Numbering methods as well as a
@@ -103,7 +103,7 @@
Instruction &I = (Instruction&)CI;
Value *Op = I.getOperand(0);
Function *F = I.getParent()->getParent();
-
+
for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
UI != UE; ++UI)
if (CastInst *Other = dyn_cast<CastInst>(*UI))
@@ -130,12 +130,12 @@
if (I1.getOpcode() != I2->getOpcode() ||
I1.getParent()->getParent() != I2->getParent()->getParent())
return false;
-
+
// They are identical if both operands are the same!
if (I1.getOperand(0) == I2->getOperand(0) &&
I1.getOperand(1) == I2->getOperand(1))
return true;
-
+
// If the instruction is commutative, the instruction can match if the
// operands are swapped!
//
@@ -149,12 +149,12 @@
void BVNImpl::handleBinaryInst(Instruction &I) {
Value *LHS = I.getOperand(0);
-
+
for (Value::use_iterator UI = LHS->use_begin(), UE = LHS->use_end();
UI != UE; ++UI)
if (Instruction *Other = dyn_cast<Instruction>(*UI))
// Check to see if this new binary operator is not I, but same operand...
- if (Other != &I && isIdenticalBinaryInst(I, Other)) {
+ if (Other != &I && isIdenticalBinaryInst(I, Other)) {
// These instructions are identical. Handle the situation.
RetVals.push_back(Other);
}
@@ -164,7 +164,7 @@
// using a brute force comparison. This is useful for instructions with an
// arbitrary number of arguments.
//
-static inline bool IdenticalComplexInst(const Instruction *I1,
+static inline bool IdenticalComplexInst(const Instruction *I1,
const Instruction *I2) {
assert(I1->getOpcode() == I2->getOpcode());
// Equal if they are in the same function...
@@ -187,7 +187,7 @@
Op = I.getOperand(i);
break;
}
-
+
for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
UI != UE; ++UI)
if (GetElementPtrInst *Other = dyn_cast<GetElementPtrInst>(*UI))
More information about the llvm-commits
mailing list