Untabify and whitespace cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2014-10-28 11:53:30 +00:00
parent 693bfa58d3
commit 0f06462959
7 changed files with 46 additions and 48 deletions

View File

@ -199,9 +199,9 @@ AliasAnalysis::getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) {
Location CS1Loc = Location CS1Loc =
getArgLocation(CS1, (unsigned) std::distance(CS1.arg_begin(), I), getArgLocation(CS1, (unsigned) std::distance(CS1.arg_begin(), I),
ArgMask); ArgMask);
// ArgMask indicates what CS1 might do to CS1Loc; if CS1 might Mod // ArgMask indicates what CS1 might do to CS1Loc; if CS1 might Mod
// CS1Loc, then we care about either a Mod or a Ref by CS2. If CS1 // CS1Loc, then we care about either a Mod or a Ref by CS2. If CS1
// might Ref, then we care only about a Mod by CS2. // might Ref, then we care only about a Mod by CS2.
ModRefResult ArgR = getModRefInfo(CS2, CS1Loc); ModRefResult ArgR = getModRefInfo(CS2, CS1Loc);
if (((ArgMask & Mod) != NoModRef && (ArgR & ModRef) != NoModRef) || if (((ArgMask & Mod) != NoModRef && (ArgR & ModRef) != NoModRef) ||
((ArgMask & Ref) != NoModRef && (ArgR & Mod) != NoModRef)) ((ArgMask & Ref) != NoModRef && (ArgR & Mod) != NoModRef))
@ -293,7 +293,7 @@ AliasAnalysis::getLocation(const AtomicRMWInst *RMWI) {
getTypeStoreSize(RMWI->getValOperand()->getType()), AATags); getTypeStoreSize(RMWI->getValOperand()->getType()), AATags);
} }
AliasAnalysis::Location AliasAnalysis::Location
AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) { AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) {
uint64_t Size = UnknownSize; uint64_t Size = UnknownSize;
if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength())) if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
@ -303,11 +303,11 @@ AliasAnalysis::getLocationForSource(const MemTransferInst *MTI) {
// to both the source and the destination. // to both the source and the destination.
AAMDNodes AATags; AAMDNodes AATags;
MTI->getAAMetadata(AATags); MTI->getAAMetadata(AATags);
return Location(MTI->getRawSource(), Size, AATags); return Location(MTI->getRawSource(), Size, AATags);
} }
AliasAnalysis::Location AliasAnalysis::Location
AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) { AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) {
uint64_t Size = UnknownSize; uint64_t Size = UnknownSize;
if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength())) if (ConstantInt *C = dyn_cast<ConstantInt>(MTI->getLength()))
@ -317,7 +317,7 @@ AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) {
// to both the source and the destination. // to both the source and the destination.
AAMDNodes AATags; AAMDNodes AATags;
MTI->getAAMetadata(AATags); MTI->getAAMetadata(AATags);
return Location(MTI->getRawDest(), Size, AATags); return Location(MTI->getRawDest(), Size, AATags);
} }
@ -440,7 +440,7 @@ AliasAnalysis::callCapturesBefore(const Instruction *I,
// assume that the call could touch the pointer, even though it doesn't // assume that the call could touch the pointer, even though it doesn't
// escape. // escape.
if (isNoAlias(AliasAnalysis::Location(*CI), if (isNoAlias(AliasAnalysis::Location(*CI),
AliasAnalysis::Location(Object))) AliasAnalysis::Location(Object)))
continue; continue;
if (CS.doesNotAccessMemory(ArgNo)) if (CS.doesNotAccessMemory(ArgNo))
continue; continue;
@ -557,4 +557,3 @@ bool llvm::isIdentifiedFunctionLocal(const Value *V)
{ {
return isa<AllocaInst>(V) || isNoAliasCall(V) || isNoAliasArgument(V); return isa<AllocaInst>(V) || isNoAliasCall(V) || isNoAliasArgument(V);
} }

View File

@ -2957,9 +2957,9 @@ const SCEV *DependenceAnalysis::addToCoefficient(const SCEV *Expr,
} }
if (SE->isLoopInvariant(AddRec, TargetLoop)) if (SE->isLoopInvariant(AddRec, TargetLoop))
return SE->getAddRecExpr(AddRec, return SE->getAddRecExpr(AddRec,
Value, Value,
TargetLoop, TargetLoop,
SCEV::FlagAnyWrap); SCEV::FlagAnyWrap);
return SE->getAddRecExpr(addToCoefficient(AddRec->getStart(), return SE->getAddRecExpr(addToCoefficient(AddRec->getStart(),
TargetLoop, Value), TargetLoop, Value),
AddRec->getStepRecurrence(*SE), AddRec->getStepRecurrence(*SE),

View File

@ -91,7 +91,7 @@ namespace {
continue; continue;
} }
makeVisible(*I, Delete); makeVisible(*I, Delete);
if (Delete) if (Delete)
I->setInitializer(nullptr); I->setInitializer(nullptr);
@ -106,7 +106,7 @@ namespace {
continue; continue;
} }
makeVisible(*I, Delete); makeVisible(*I, Delete);
if (Delete) if (Delete)
I->deleteBody(); I->deleteBody();
@ -118,8 +118,8 @@ namespace {
Module::alias_iterator CurI = I; Module::alias_iterator CurI = I;
++I; ++I;
bool Delete = deleteStuff == (bool)Named.count(CurI); bool Delete = deleteStuff == (bool)Named.count(CurI);
makeVisible(*CurI, Delete); makeVisible(*CurI, Delete);
if (Delete) { if (Delete) {
Type *Ty = CurI->getType()->getElementType(); Type *Ty = CurI->getType()->getElementType();
@ -148,7 +148,7 @@ namespace {
char GVExtractorPass::ID = 0; char GVExtractorPass::ID = 0;
} }
ModulePass *llvm::createGVExtractionPass(std::vector<GlobalValue*>& GVs, ModulePass *llvm::createGVExtractionPass(std::vector<GlobalValue*>& GVs,
bool deleteFn) { bool deleteFn) {
return new GVExtractorPass(GVs, deleteFn); return new GVExtractorPass(GVs, deleteFn);
} }

View File

@ -392,11 +392,11 @@ static Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
/// ///
/// This also tries to turn /// This also tries to turn
/// --- Single bit tests: /// --- Single bit tests:
/// if ((x & C) == 0) x |= C to x |= C /// if ((x & C) == 0) x |= C to x |= C
/// if ((x & C) != 0) x ^= C to x &= ~C /// if ((x & C) != 0) x ^= C to x &= ~C
/// if ((x & C) == 0) x ^= C to x |= C /// if ((x & C) == 0) x ^= C to x |= C
/// if ((x & C) != 0) x &= ~C to x &= ~C /// if ((x & C) != 0) x &= ~C to x &= ~C
/// if ((x & C) == 0) x &= ~C to nothing /// if ((x & C) == 0) x &= ~C to nothing
static Value *foldSelectICmpAndOr(SelectInst &SI, Value *TrueVal, static Value *foldSelectICmpAndOr(SelectInst &SI, Value *TrueVal,
Value *FalseVal, Value *FalseVal,
InstCombiner::BuilderTy *Builder) { InstCombiner::BuilderTy *Builder) {

View File

@ -238,7 +238,7 @@ protected:
if (PossibleReds[i].size() % Scale == 0) { if (PossibleReds[i].size() % Scale == 0) {
PossibleRedLastSet.insert(PossibleReds[i].getReducedValue()); PossibleRedLastSet.insert(PossibleReds[i].getReducedValue());
PossibleRedPHISet.insert(PossibleReds[i].getPHI()); PossibleRedPHISet.insert(PossibleReds[i].getPHI());
PossibleRedSet.insert(PossibleReds[i].getPHI()); PossibleRedSet.insert(PossibleReds[i].getPHI());
PossibleRedIdx[PossibleReds[i].getPHI()] = i; PossibleRedIdx[PossibleReds[i].getPHI()] = i;
for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(), for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(),
@ -487,7 +487,7 @@ void LoopReroll::collectInLoopUserSet(Loop *L,
if (PN->getIncomingBlock(U) == L->getHeader()) if (PN->getIncomingBlock(U) == L->getHeader())
continue; continue;
} }
if (L->contains(User) && !Exclude.count(User)) { if (L->contains(User) && !Exclude.count(User)) {
Queue.push_back(User); Queue.push_back(User);
} }
@ -661,9 +661,9 @@ bool LoopReroll::ReductionTracker::validateSelected() {
int PrevIter = 0, BaseCount = 0, Count = 0; int PrevIter = 0, BaseCount = 0, Count = 0;
for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(), for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(),
JE = PossibleReds[i].end(); J != JE; ++J) { JE = PossibleReds[i].end(); J != JE; ++J) {
// Note that all instructions in the chain must have been found because // Note that all instructions in the chain must have been found because
// all instructions in the function must have been assigned to some // all instructions in the function must have been assigned to some
// iteration. // iteration.
int Iter = PossibleRedIter[*J]; int Iter = PossibleRedIter[*J];
if (Iter != PrevIter && Iter != PrevIter + 1 && if (Iter != PrevIter && Iter != PrevIter + 1 &&
!PossibleReds[i].getReducedValue()->isAssociative()) { !PossibleReds[i].getReducedValue()->isAssociative()) {
@ -881,7 +881,7 @@ bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header,
// needed because otherwise isSafeToSpeculativelyExecute returns // needed because otherwise isSafeToSpeculativelyExecute returns
// false on PHI nodes. // false on PHI nodes.
if (!isSimpleLoadStore(J2) && !isSafeToSpeculativelyExecute(J2, DL)) if (!isSimpleLoadStore(J2) && !isSafeToSpeculativelyExecute(J2, DL))
FutureSideEffects = true; FutureSideEffects = true;
} }
++J2; ++J2;
@ -952,9 +952,9 @@ bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header,
for (unsigned j = 0; j < J1->getNumOperands() && !MatchFailed; ++j) { for (unsigned j = 0; j < J1->getNumOperands() && !MatchFailed; ++j) {
Value *Op2 = J2->getOperand(j); Value *Op2 = J2->getOperand(j);
// If this is part of a reduction (and the operation is not // If this is part of a reduction (and the operation is not
// associatve), then we match all operands, but not those that are // associatve), then we match all operands, but not those that are
// part of the reduction. // part of the reduction.
if (InReduction) if (InReduction)
if (Instruction *Op2I = dyn_cast<Instruction>(Op2)) if (Instruction *Op2I = dyn_cast<Instruction>(Op2))
if (Reductions.isPairInSame(J2, Op2I)) if (Reductions.isPairInSame(J2, Op2I))
@ -968,11 +968,11 @@ bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header,
Op2 = IV; Op2 = IV;
if (J1->getOperand(Swapped ? unsigned(!j) : j) != Op2) { if (J1->getOperand(Swapped ? unsigned(!j) : j) != Op2) {
// If we've not already decided to swap the matched operands, and // If we've not already decided to swap the matched operands, and
// we've not already matched our first operand (note that we could // we've not already matched our first operand (note that we could
// have skipped matching the first operand because it is part of a // have skipped matching the first operand because it is part of a
// reduction above), and the instruction is commutative, then try // reduction above), and the instruction is commutative, then try
// the swapped match. // the swapped match.
if (!Swapped && J1->isCommutative() && !SomeOpMatched && if (!Swapped && J1->isCommutative() && !SomeOpMatched &&
J1->getOperand(!j) == Op2) { J1->getOperand(!j) == Op2) {
Swapped = true; Swapped = true;
@ -1069,7 +1069,7 @@ bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header,
continue; continue;
} }
++J; ++J;
} }
// Insert the new induction variable. // Insert the new induction variable.
@ -1110,7 +1110,7 @@ bool LoopReroll::reroll(Instruction *IV, Loop *L, BasicBlock *Header,
ICMinus1 = Expander.expandCodeFor(ICMinus1SCEV, NewIV->getType(), ICMinus1 = Expander.expandCodeFor(ICMinus1SCEV, NewIV->getType(),
Preheader->getTerminator()); Preheader->getTerminator());
} }
Value *Cond = new ICmpInst(BI, CmpInst::ICMP_EQ, NewIV, ICMinus1, Value *Cond = new ICmpInst(BI, CmpInst::ICMP_EQ, NewIV, ICMinus1,
"exitcond"); "exitcond");
BI->setCondition(Cond); BI->setCondition(Cond);
@ -1182,4 +1182,3 @@ bool LoopReroll::runOnLoop(Loop *L, LPPassManager &LPM) {
return Changed; return Changed;
} }

View File

@ -1074,9 +1074,9 @@ bool llvm::LowerDbgDeclare(Function &F) {
else if (LoadInst *LI = dyn_cast<LoadInst>(U)) else if (LoadInst *LI = dyn_cast<LoadInst>(U))
ConvertDebugDeclareToDebugValue(DDI, LI, DIB); ConvertDebugDeclareToDebugValue(DDI, LI, DIB);
else if (CallInst *CI = dyn_cast<CallInst>(U)) { else if (CallInst *CI = dyn_cast<CallInst>(U)) {
// This is a call by-value or some other instruction that // This is a call by-value or some other instruction that
// takes a pointer to the variable. Insert a *value* // takes a pointer to the variable. Insert a *value*
// intrinsic that describes the alloca. // intrinsic that describes the alloca.
auto DbgVal = DIB.insertDbgValueIntrinsic( auto DbgVal = DIB.insertDbgValueIntrinsic(
AI, 0, DIVariable(DDI->getVariable()), AI, 0, DIVariable(DDI->getVariable()),
DIExpression(DDI->getExpression()), CI); DIExpression(DDI->getExpression()), CI);
@ -1204,7 +1204,7 @@ static bool markAliveBlocks(BasicBlock *BB,
dyn_cast<ConstantInt>(II->getArgOperand(0))) dyn_cast<ConstantInt>(II->getArgOperand(0)))
MakeUnreachable = Cond->isZero(); MakeUnreachable = Cond->isZero();
if (MakeUnreachable) { if (MakeUnreachable) {
// Don't insert a call to llvm.trap right before the unreachable. // Don't insert a call to llvm.trap right before the unreachable.
changeToUnreachable(BBI, false); changeToUnreachable(BBI, false);
Changed = true; Changed = true;

View File

@ -2981,7 +2981,7 @@ void InnerLoopVectorizer::fixLCSSAPHIs() {
LCSSAPhi->addIncoming(UndefValue::get(LCSSAPhi->getType()), LCSSAPhi->addIncoming(UndefValue::get(LCSSAPhi->getType()),
LoopMiddleBlock); LoopMiddleBlock);
} }
} }
InnerLoopVectorizer::VectorParts InnerLoopVectorizer::VectorParts
InnerLoopVectorizer::createEdgeMask(BasicBlock *Src, BasicBlock *Dst) { InnerLoopVectorizer::createEdgeMask(BasicBlock *Src, BasicBlock *Dst) {
@ -3250,7 +3250,7 @@ void InnerLoopVectorizer::vectorizeBlockInLoop(BasicBlock *BB, PhiVector *PV) {
if (BinaryOperator *VecOp = dyn_cast<BinaryOperator>(V)) if (BinaryOperator *VecOp = dyn_cast<BinaryOperator>(V))
VecOp->copyIRFlags(BinOp); VecOp->copyIRFlags(BinOp);
Entry[Part] = V; Entry[Part] = V;
} }
@ -4268,8 +4268,8 @@ void AccessAnalysis::processMemAccesses() {
if (IsWrite) if (IsWrite)
SetHasWrite = true; SetHasWrite = true;
// Create sets of pointers connected by a shared alias set and // Create sets of pointers connected by a shared alias set and
// underlying object. // underlying object.
typedef SmallVector<Value*, 16> ValueVector; typedef SmallVector<Value*, 16> ValueVector;
ValueVector TempObjects; ValueVector TempObjects;
GetUnderlyingObjects(Ptr, TempObjects, DL); GetUnderlyingObjects(Ptr, TempObjects, DL);
@ -5396,7 +5396,7 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize) {
// If the trip count that we found modulo the vectorization factor is not // If the trip count that we found modulo the vectorization factor is not
// zero then we require a tail. // zero then we require a tail.
if (VF < 2) { if (VF < 2) {
emitAnalysis(Report() << "cannot optimize for size and vectorize at the same time. Enable vectorization of this loop with '#pragma clang loop vectorize(enable)' when compiling with -Os"); emitAnalysis(Report() << "cannot optimize for size and vectorize at the same time. Enable vectorization of this loop with '#pragma clang loop vectorize(enable)' when compiling with -Os");
DEBUG(dbgs() << "LV: Aborting. A tail loop is required in Os.\n"); DEBUG(dbgs() << "LV: Aborting. A tail loop is required in Os.\n");
return Factor; return Factor;
} }