Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3077,7 +3077,7 @@ END_CAN_TYPE_WRAPPER(FunctionType, AnyFunctionType)
/// Map the given parameter list onto a bitvector describing whether
/// the argument type at each index has a default argument associated with
/// it.
llvm::SmallBitVector
SmallBitVector
computeDefaultMap(ArrayRef<AnyFunctionType::Param> params,
const ValueDecl *paramOwner, unsigned level);

Expand Down
2 changes: 2 additions & 0 deletions include/swift/Basic/LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace llvm {
template<typename T> class TinyPtrVector;
template<typename T> class Optional;
template <typename PT1, typename PT2> class PointerUnion;
class SmallBitVector;

// Other common classes.
class raw_ostream;
Expand Down Expand Up @@ -76,6 +77,7 @@ namespace swift {
using llvm::TinyPtrVector;
using llvm::PointerUnion;
using llvm::SmallSetVector;
using llvm::SmallBitVector;

// Other common classes.
using llvm::APFloat;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/EscapeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
/// Information where the node's value is used in its function.
/// Each bit corresponds to an argument/instruction where the value is used.
/// The UsePoints on demand when calling ConnectionGraph::getUsePoints().
llvm::SmallBitVector UsePoints;
SmallBitVector UsePoints;

/// The actual result of the escape analysis. It tells if and how (global or
/// through arguments) the value escapes.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Utils/Generics.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void trySpecializeApplyOfGeneric(
class ReabstractionInfo {
/// A 1-bit means that this parameter/return value is converted from indirect
/// to direct.
llvm::SmallBitVector Conversions;
SmallBitVector Conversions;

/// If set, indirect to direct conversions should be performed by the generic
/// specializer.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Utils/StackNesting.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace swift {
///
class StackNesting {

typedef llvm::SmallBitVector BitVector;
typedef SmallBitVector BitVector;

/// Data stored for each block (actually for each block which is not dead).
struct BlockInfo {
Expand Down
4 changes: 2 additions & 2 deletions lib/AST/ASTVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Verifier : public ASTWalker {
/// use the explicit closure sequence (false) or the implicit
/// closure sequence (true).
typedef llvm::PointerIntPair<DeclContext *, 1, bool> ClosureDiscriminatorKey;
llvm::DenseMap<ClosureDiscriminatorKey, llvm::SmallBitVector>
llvm::DenseMap<ClosureDiscriminatorKey, SmallBitVector>
ClosureDiscriminators;
DeclContext *CanonicalTopLevelContext = nullptr;

Expand Down Expand Up @@ -830,7 +830,7 @@ class Verifier : public ASTWalker {
}

/// Return the appropriate discriminator set for a closure expression.
llvm::SmallBitVector &getClosureDiscriminators(AbstractClosureExpr *closure) {
SmallBitVector &getClosureDiscriminators(AbstractClosureExpr *closure) {
auto dc = getCanonicalDeclContext(closure->getParent());
bool isAutoClosure = isa<AutoClosureExpr>(closure);
return ClosureDiscriminators[ClosureDiscriminatorKey(dc, isAutoClosure)];
Expand Down
4 changes: 2 additions & 2 deletions lib/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,10 @@ Type TypeBase::replaceCovariantResultType(Type newResultType,
return FunctionType::get(inputType, resultType, fnType->getExtInfo());
}

llvm::SmallBitVector
SmallBitVector
swift::computeDefaultMap(ArrayRef<AnyFunctionType::Param> params,
const ValueDecl *paramOwner, unsigned level) {
llvm::SmallBitVector resultVector(params.size());
SmallBitVector resultVector(params.size());
// No parameter owner means no parameter list means no default arguments
// - hand back the zeroed bitvector.
//
Expand Down
4 changes: 2 additions & 2 deletions lib/ClangImporter/ClangAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ using namespace importer;

/// Get a bit vector indicating which arguments are non-null for a
/// given function or method.
llvm::SmallBitVector
SmallBitVector
importer::getNonNullArgs(const clang::Decl *decl,
ArrayRef<const clang::ParmVarDecl *> params) {
llvm::SmallBitVector result;
SmallBitVector result;
if (!decl)
return result;

Expand Down
2 changes: 1 addition & 1 deletion lib/ClangImporter/ClangAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ clang::SwiftNewtypeAttr *getSwiftNewtypeAttr(const clang::TypedefNameDecl *decl,

/// Retrieve a bit vector containing the non-null argument
/// annotations for the given declaration.
llvm::SmallBitVector
SmallBitVector
getNonNullArgs(const clang::Decl *decl,
ArrayRef<const clang::ParmVarDecl *> params);

Expand Down
2 changes: 1 addition & 1 deletion lib/ClangImporter/ImportName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ static bool shouldImportAsInitializer(const clang::ObjCMethodDecl *method,
static bool omitNeedlessWordsInFunctionName(
StringRef &baseName, SmallVectorImpl<StringRef> &argumentNames,
ArrayRef<const clang::ParmVarDecl *> params, clang::QualType resultType,
const clang::DeclContext *dc, const llvm::SmallBitVector &nonNullArgs,
const clang::DeclContext *dc, const SmallBitVector &nonNullArgs,
Optional<unsigned> errorParamIndex, bool returnsSelf, bool isInstanceMethod,
NameImporter &nameImporter) {
clang::ASTContext &clangCtx = nameImporter.getClangContext();
Expand Down
4 changes: 2 additions & 2 deletions lib/ClangImporter/ImportType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ ParameterList *ClangImporter::Implementation::importFunctionParameterList(
// Import the parameters.
SmallVector<ParamDecl *, 4> parameters;
unsigned index = 0;
llvm::SmallBitVector nonNullArgs = getNonNullArgs(clangDecl, params);
SmallBitVector nonNullArgs = getNonNullArgs(clangDecl, params);

for (auto param : params) {
auto paramTy = param->getType();
Expand Down Expand Up @@ -2009,7 +2009,7 @@ ImportedType ClangImporter::Implementation::importMethodType(

CanType errorParamType;

llvm::SmallBitVector nonNullArgs = getNonNullArgs(clangDecl, params);
SmallBitVector nonNullArgs = getNonNullArgs(clangDecl, params);

// Import the parameters.
SmallVector<ParamDecl*, 4> swiftParams;
Expand Down
2 changes: 1 addition & 1 deletion lib/IDE/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@ protocolForLiteralKind(CodeCompletionLiteralKind kind) {
/// that is of type () -> ().
static bool hasTrivialTrailingClosure(const FuncDecl *FD,
AnyFunctionType *funcType) {
llvm::SmallBitVector defaultMap =
SmallBitVector defaultMap =
computeDefaultMap(funcType->getParams(), FD,
/*level*/ FD->isInstanceMember() ? 1 : 0);

Expand Down
4 changes: 2 additions & 2 deletions lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace {
// F,F -> No
// F,T -> Yes
// T,F -> Partial
llvm::SmallBitVector Data;
SmallBitVector Data;
public:
AvailabilitySet(unsigned NumElts) {
Data.resize(NumElts*2, true);
Expand Down Expand Up @@ -2711,7 +2711,7 @@ AvailabilitySet LifetimeChecker::getLivenessAtInst(SILInstruction *Inst,

// Check locally to see if any elements are satisfied within the block, and
// keep track of which ones are still needed in the NeededElements set.
llvm::SmallBitVector NeededElements(TheMemory.NumElements);
SmallBitVector NeededElements(TheMemory.NumElements);
NeededElements.set(FirstElt, FirstElt+NumElts);

// If there is a store in the current block, scan the block to see if the
Expand Down
38 changes: 19 additions & 19 deletions lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ class AvailableValueDataflowContext {
bool computeAvailableValues(SILInstruction *StartingFrom,
unsigned FirstEltOffset,
unsigned NumLoadSubElements,
llvm::SmallBitVector &RequiredElts,
SmallBitVector &RequiredElts,
SmallVectorImpl<AvailableValue> &Result);

/// Return true if the box has escaped at the specified instruction. We are
Expand All @@ -615,16 +615,16 @@ class AvailableValueDataflowContext {
SILModule &getModule() const { return TheMemory->getModule(); }

void updateAvailableValues(SILInstruction *Inst,
llvm::SmallBitVector &RequiredElts,
SmallBitVector &RequiredElts,
SmallVectorImpl<AvailableValue> &Result,
llvm::SmallBitVector &ConflictingValues);
SmallBitVector &ConflictingValues);
void computeAvailableValuesFrom(
SILBasicBlock::iterator StartingFrom, SILBasicBlock *BB,
llvm::SmallBitVector &RequiredElts,
SmallBitVector &RequiredElts,
SmallVectorImpl<AvailableValue> &Result,
llvm::SmallDenseMap<SILBasicBlock *, llvm::SmallBitVector, 32>
llvm::SmallDenseMap<SILBasicBlock *, SmallBitVector, 32>
&VisitedBlocks,
llvm::SmallBitVector &ConflictingValues);
SmallBitVector &ConflictingValues);
};

} // end anonymous namespace
Expand Down Expand Up @@ -661,9 +661,9 @@ AvailableValueDataflowContext::AvailableValueDataflowContext(
}

void AvailableValueDataflowContext::updateAvailableValues(
SILInstruction *Inst, llvm::SmallBitVector &RequiredElts,
SILInstruction *Inst, SmallBitVector &RequiredElts,
SmallVectorImpl<AvailableValue> &Result,
llvm::SmallBitVector &ConflictingValues) {
SmallBitVector &ConflictingValues) {
// Handle store.
if (auto *SI = dyn_cast<StoreInst>(Inst)) {
unsigned StartSubElt = computeSubelement(SI->getDest(), TheMemory);
Expand Down Expand Up @@ -739,23 +739,23 @@ void AvailableValueDataflowContext::updateAvailableValues(
// Otherwise, this is some unknown instruction, conservatively assume that all
// values are clobbered.
RequiredElts.clear();
ConflictingValues = llvm::SmallBitVector(Result.size(), true);
ConflictingValues = SmallBitVector(Result.size(), true);
return;
}

bool AvailableValueDataflowContext::computeAvailableValues(
SILInstruction *StartingFrom, unsigned FirstEltOffset,
unsigned NumLoadSubElements, llvm::SmallBitVector &RequiredElts,
unsigned NumLoadSubElements, SmallBitVector &RequiredElts,
SmallVectorImpl<AvailableValue> &Result) {
llvm::SmallDenseMap<SILBasicBlock*, llvm::SmallBitVector, 32> VisitedBlocks;
llvm::SmallBitVector ConflictingValues(Result.size());
llvm::SmallDenseMap<SILBasicBlock*, SmallBitVector, 32> VisitedBlocks;
SmallBitVector ConflictingValues(Result.size());

computeAvailableValuesFrom(StartingFrom->getIterator(),
StartingFrom->getParent(), RequiredElts, Result,
VisitedBlocks, ConflictingValues);
// If there are no values available at this load point, then we fail to
// promote this load and there is nothing to do.
llvm::SmallBitVector AvailableValueIsPresent(NumMemorySubElements);
SmallBitVector AvailableValueIsPresent(NumMemorySubElements);

for (unsigned i :
range(FirstEltOffset, FirstEltOffset + NumLoadSubElements)) {
Expand Down Expand Up @@ -792,10 +792,10 @@ bool AvailableValueDataflowContext::computeAvailableValues(

void AvailableValueDataflowContext::computeAvailableValuesFrom(
SILBasicBlock::iterator StartingFrom, SILBasicBlock *BB,
llvm::SmallBitVector &RequiredElts, SmallVectorImpl<AvailableValue> &Result,
llvm::SmallDenseMap<SILBasicBlock *, llvm::SmallBitVector, 32>
SmallBitVector &RequiredElts, SmallVectorImpl<AvailableValue> &Result,
llvm::SmallDenseMap<SILBasicBlock *, SmallBitVector, 32>
&VisitedBlocks,
llvm::SmallBitVector &ConflictingValues) {
SmallBitVector &ConflictingValues) {
assert(!RequiredElts.none() && "Scanning with a goal of finding nothing?");

// If there is a potential modification in the current block, scan the block
Expand Down Expand Up @@ -853,7 +853,7 @@ void AvailableValueDataflowContext::computeAvailableValuesFrom(
}

// Make sure to pass in the same set of required elements for each pred.
llvm::SmallBitVector Elts = RequiredElts;
SmallBitVector Elts = RequiredElts;
computeAvailableValuesFrom(PredBB->end(), PredBB, Elts, Result,
VisitedBlocks, ConflictingValues);

Expand Down Expand Up @@ -1103,7 +1103,7 @@ bool AllocOptimize::promoteLoad(SILInstruction *Inst) {
unsigned NumLoadSubElements = getNumSubElements(LoadTy, Module);

// Set up the bitvector of elements being demanded by the load.
llvm::SmallBitVector RequiredElts(NumMemorySubElements);
SmallBitVector RequiredElts(NumMemorySubElements);
RequiredElts.set(FirstElt, FirstElt+NumLoadSubElements);

SmallVector<AvailableValue, 8> AvailableValues;
Expand Down Expand Up @@ -1172,7 +1172,7 @@ bool AllocOptimize::canPromoteDestroyAddr(
unsigned NumLoadSubElements = getNumSubElements(LoadTy, Module);

// Set up the bitvector of elements being demanded by the load.
llvm::SmallBitVector RequiredElts(NumMemorySubElements);
SmallBitVector RequiredElts(NumMemorySubElements);
RequiredElts.set(FirstElt, FirstElt+NumLoadSubElements);

// Find out if we have any available values. If no bits are demanded, we
Expand Down
14 changes: 7 additions & 7 deletions lib/SILOptimizer/Transforms/ARCCodeMotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ struct BlockState {
/// NOTE: we could do the data flow with BBSetIn or BBSetOut, but that would
/// require us to create a temporary copy to check whether the BBSet has
/// changed after the genset and killset has been applied.
llvm::SmallBitVector BBSetIn;
SmallBitVector BBSetIn;

/// A bit vector for which the ith bit represents the ith refcounted root in
/// RCRootVault.
llvm::SmallBitVector BBSetOut;
SmallBitVector BBSetOut;

/// A bit vector for which the ith bit represents the ith refcounted root in
/// RCRootVault. If the bit is set, that means this basic block creates a
/// retain which can be sunk or a release which can be hoisted.
llvm::SmallBitVector BBGenSet;
SmallBitVector BBGenSet;

/// A bit vector for which the ith bit represents the ith refcounted root in
/// RCRootVault. If this bit is set, that means this basic block stops retain
/// or release of the refcounted root to be moved across.
llvm::SmallBitVector BBKillSet;
SmallBitVector BBKillSet;

/// A bit vector for which the ith bit represents the ith refcounted root in
/// RCRootVault. If this bit is set, that means this is potentially a retain
Expand All @@ -130,7 +130,7 @@ struct BlockState {
///
/// NOTE: this vector contains an approximation of whether there will be a
/// retain or release to a certain point of a basic block.
llvm::SmallBitVector BBMaxSet;
SmallBitVector BBMaxSet;
};

/// CodeMotionContext - This is the base class which retain code motion and
Expand Down Expand Up @@ -267,7 +267,7 @@ class RetainBlockState : public BlockState {
public:
/// Check whether the BBSetOut has changed. If it does, we need to rerun
/// the data flow on this block's successors to reach fixed point.
bool updateBBSetOut(llvm::SmallBitVector &X) {
bool updateBBSetOut(SmallBitVector &X) {
if (BBSetOut == X)
return false;
BBSetOut = X;
Expand Down Expand Up @@ -619,7 +619,7 @@ class ReleaseBlockState : public BlockState {
public:
/// Check whether the BBSetIn has changed. If it does, we need to rerun
/// the data flow on this block's predecessors to reach fixed point.
bool updateBBSetIn(llvm::SmallBitVector &X) {
bool updateBBSetIn(SmallBitVector &X) {
if (BBSetIn == X)
return false;
BBSetIn = X;
Expand Down
Loading