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 llvm/docs/CodingStandards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ something notionally equivalent. Examples:
};

// The Foo constructor call is reading a file, don't use braces to call it.
std::fill(foo.begin(), foo.end(), Foo("name"));
llvm::fill(foo, Foo("name"));

// The pair is being constructed like an aggregate, use braces.
bar_map.insert({my_key, my_value});
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/ADT/BitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,7 @@ class BitVector {
set_unused_bits(false);
}

void init_words(bool t) {
std::fill(Bits.begin(), Bits.end(), 0 - (BitWord)t);
}
void init_words(bool t) { llvm::fill(Bits, 0 - (BitWord)t); }

template<bool AddBits, bool InvertMask>
void applyMask(const uint32_t *Mask, unsigned MaskWords) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/Bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Bitset {
}

Bitset &set() {
std::fill(std::begin(Bits), std::end(Bits), -BitWord(0));
llvm::fill(Bits, -BitWord(0));
return *this;
}

Expand Down
5 changes: 1 addition & 4 deletions llvm/include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,7 @@ class LLVM_ABI TargetLoweringBase {
LegalizeTypeAction ValueTypeActions[MVT::VALUETYPE_SIZE];

public:
ValueTypeActionImpl() {
std::fill(std::begin(ValueTypeActions), std::end(ValueTypeActions),
TypeLegal);
}
ValueTypeActionImpl() { llvm::fill(ValueTypeActions, TypeLegal); }

LegalizeTypeAction getTypeAction(MVT VT) const {
return ValueTypeActions[VT.SimpleTy];
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/SubtargetFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FeatureBitset {
}

FeatureBitset &set() {
std::fill(std::begin(Bits), std::end(Bits), -1ULL);
llvm::fill(Bits, -1ULL);
return *this;
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachineLICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ bool MachineLICMImpl::run(MachineFunction &MF) {
// Estimate register pressure during pre-regalloc pass.
unsigned NumRPS = TRI->getNumRegPressureSets();
RegPressure.resize(NumRPS);
std::fill(RegPressure.begin(), RegPressure.end(), 0);
llvm::fill(RegPressure, 0);
RegLimit.resize(NumRPS);
for (unsigned i = 0, e = NumRPS; i != e; ++i)
RegLimit[i] = TRI->getRegPressureSetLimit(MF, i);
Expand Down Expand Up @@ -941,7 +941,7 @@ static bool isOperandKill(const MachineOperand &MO, MachineRegisterInfo *MRI) {
/// initialize the starting "register pressure". Note this does not count live
/// through (livein but not used) registers.
void MachineLICMImpl::InitRegPressure(MachineBasicBlock *BB) {
std::fill(RegPressure.begin(), RegPressure.end(), 0);
llvm::fill(RegPressure, 0);

// If the preheader has only a single predecessor and it ends with a
// fallthrough or an unconditional branch, then scan its predecessor for live
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ ResourcePriorityQueue::ResourcePriorityQueue(SelectionDAGISel *IS)
unsigned NumRC = TRI->getNumRegClasses();
RegLimit.resize(NumRC);
RegPressure.resize(NumRC);
std::fill(RegLimit.begin(), RegLimit.end(), 0);
std::fill(RegPressure.begin(), RegPressure.end(), 0);
llvm::fill(RegLimit, 0);
llvm::fill(RegPressure, 0);
for (const TargetRegisterClass *RC : TRI->regclasses())
RegLimit[RC->getID()] = TRI->getRegPressureLimit(RC, *IS->MF);

Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1769,8 +1769,8 @@ class RegReductionPQBase : public SchedulingPriorityQueue {
unsigned NumRC = TRI->getNumRegClasses();
RegLimit.resize(NumRC);
RegPressure.resize(NumRC);
std::fill(RegLimit.begin(), RegLimit.end(), 0);
std::fill(RegPressure.begin(), RegPressure.end(), 0);
llvm::fill(RegLimit, 0);
llvm::fill(RegPressure, 0);
for (const TargetRegisterClass *RC : TRI->regclasses())
RegLimit[RC->getID()] = tri->getRegPressureLimit(RC, MF);
}
Expand All @@ -1793,7 +1793,7 @@ class RegReductionPQBase : public SchedulingPriorityQueue {
void releaseState() override {
SUnits = nullptr;
SethiUllmanNumbers.clear();
std::fill(RegPressure.begin(), RegPressure.end(), 0);
llvm::fill(RegPressure, 0);
}

unsigned getNodePriority(const SUnit *SU) const;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,8 +1457,8 @@ void SelectionDAG::clear() {
TargetExternalSymbols.clear();
MCSymbols.clear();
SDEI.clear();
std::fill(CondCodeNodes.begin(), CondCodeNodes.end(), nullptr);
std::fill(ValueTypeNodes.begin(), ValueTypeNodes.end(), nullptr);
llvm::fill(CondCodeNodes, nullptr);
llvm::fill(ValueTypeNodes, nullptr);

EntryNode.UseList = nullptr;
InsertNode(&EntryNode);
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/TargetLoweringBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,8 @@ void TargetLoweringBase::initActions() {
memset(TruncStoreActions, 0, sizeof(TruncStoreActions));
memset(IndexedModeActions, 0, sizeof(IndexedModeActions));
memset(CondCodeActions, 0, sizeof(CondCodeActions));
std::fill(std::begin(RegClassForVT), std::end(RegClassForVT), nullptr);
std::fill(std::begin(TargetDAGCombineArray),
std::end(TargetDAGCombineArray), 0);
llvm::fill(RegClassForVT, nullptr);
llvm::fill(TargetDAGCombineArray, 0);

// Let extending atomic loads be unsupported by default.
for (MVT ValVT : MVT::all_valuetypes())
Expand Down
9 changes: 3 additions & 6 deletions llvm/lib/ExecutionEngine/ExecutionEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
if (CAZ) {
GenericValue floatZero;
floatZero.FloatVal = 0.f;
std::fill(Result.AggregateVal.begin(), Result.AggregateVal.end(),
floatZero);
llvm::fill(Result.AggregateVal, floatZero);
break;
}
if(CV) {
Expand All @@ -974,8 +973,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
if (CAZ) {
GenericValue doubleZero;
doubleZero.DoubleVal = 0.0;
std::fill(Result.AggregateVal.begin(), Result.AggregateVal.end(),
doubleZero);
llvm::fill(Result.AggregateVal, doubleZero);
break;
}
if(CV) {
Expand All @@ -996,8 +994,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
if (CAZ) {
GenericValue intZero;
intZero.IntVal = APInt(ElemTy->getScalarSizeInBits(), 0ull);
std::fill(Result.AggregateVal.begin(), Result.AggregateVal.end(),
intZero);
llvm::fill(Result.AggregateVal, intZero);
break;
}
if(CV) {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Scalar/LoopDeletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ static LoopDeletionResult deleteLoopIfDead(Loop *L, DominatorTree &DT,
SE.forgetLoop(L);
// Set incoming value to poison for phi nodes in the exit block.
for (PHINode &P : ExitBlock->phis()) {
std::fill(P.incoming_values().begin(), P.incoming_values().end(),
PoisonValue::get(P.getType()));
llvm::fill(P.incoming_values(), PoisonValue::get(P.getType()));
}
ORE.emit([&]() {
return OptimizationRemark(DEBUG_TYPE, "NeverExecutes", L->getStartLoc(),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ class LowerMatrixIntrinsics {
llvm::copy(C.vectors(), std::back_inserter(CondV));
} else {
CondV.resize(A.getNumVectors());
std::fill(CondV.begin(), CondV.end(), Cond);
llvm::fill(CondV, Cond);
}

for (auto [CV, AV, BV] : llvm::zip_equal(CondV, A.vectors(), B.vectors()))
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/LoopUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ Value *llvm::getShuffleReduction(IRBuilderBase &Builder, Value *Src,
SmallVector<int, 32> ShuffleMask(VF);
for (unsigned stride = 1; stride < VF; stride <<= 1) {
// Initialise the mask with undef.
std::fill(ShuffleMask.begin(), ShuffleMask.end(), -1);
llvm::fill(ShuffleMask, -1);
for (unsigned j = 0; j < VF; j += stride << 1) {
ShuffleMask[j] = j + stride;
}
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5443,7 +5443,7 @@ BoUpSLP::findReusedOrderedScalars(const BoUpSLP::TreeEntry &TE,
MutableArrayRef<unsigned> Slice = CurrentOrder.slice(I * PartSz, Limit);
// Shuffle of at least 2 vectors - ignore.
if (any_of(Slice, [&](unsigned I) { return I != NumScalars; })) {
std::fill(Slice.begin(), Slice.end(), NumScalars);
llvm::fill(Slice, NumScalars);
ShuffledSubMasks.set(I);
continue;
}
Expand Down Expand Up @@ -5471,7 +5471,7 @@ BoUpSLP::findReusedOrderedScalars(const BoUpSLP::TreeEntry &TE,
FirstMin = (FirstMin / PartSz) * PartSz;
// Shuffle of at least 2 vectors - ignore.
if (SecondVecFound) {
std::fill(Slice.begin(), Slice.end(), NumScalars);
llvm::fill(Slice, NumScalars);
ShuffledSubMasks.set(I);
continue;
}
Expand All @@ -5492,7 +5492,7 @@ BoUpSLP::findReusedOrderedScalars(const BoUpSLP::TreeEntry &TE,
}
// Shuffle of at least 2 vectors - ignore.
if (SecondVecFound) {
std::fill(Slice.begin(), Slice.end(), NumScalars);
llvm::fill(Slice, NumScalars);
ShuffledSubMasks.set(I);
continue;
}
Expand Down
3 changes: 1 addition & 2 deletions llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ PressureTracker::PressureTracker(const MCSchedModel &Model)
}

ResourceUsers.resize(NextResourceUsersIdx);
std::fill(ResourceUsers.begin(), ResourceUsers.end(),
std::make_pair<unsigned, unsigned>(~0U, 0U));
llvm::fill(ResourceUsers, std::make_pair<unsigned, unsigned>(~0U, 0U));
}

void PressureTracker::getResourceUsers(uint64_t ResourceMask,
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-mca/Views/RegisterFileStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ RegisterFileStatistics::RegisterFileStatistics(const MCSubtargetInfo &sti)
unsigned NumRegFiles = std::max(PI.NumRegisterFiles, 1U);

PRFUsage.resize(NumRegFiles);
std::fill(PRFUsage.begin(), PRFUsage.end(), RFUEmpty);
llvm::fill(PRFUsage, RFUEmpty);

MoveElimInfo.resize(NumRegFiles);
std::fill(MoveElimInfo.begin(), MoveElimInfo.end(), MEIEmpty);
llvm::fill(MoveElimInfo, MEIEmpty);
}

void RegisterFileStatistics::updateRegisterFileUsage(
Expand Down
6 changes: 3 additions & 3 deletions llvm/tools/llvm-mca/Views/TimelineView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ TimelineView::TimelineView(const MCSubtargetInfo &sti, MCInstPrinter &Printer,
NumInstructions *= Iterations;
Timeline.resize(NumInstructions);
TimelineViewEntry InvalidTVEntry = {-1, 0, 0, 0, 0};
std::fill(Timeline.begin(), Timeline.end(), InvalidTVEntry);
llvm::fill(Timeline, InvalidTVEntry);

WaitTimeEntry NullWTEntry = {0, 0, 0};
std::fill(WaitTime.begin(), WaitTime.end(), NullWTEntry);
llvm::fill(WaitTime, NullWTEntry);

std::pair<unsigned, int> NullUsedBufferEntry = {/* Invalid resource ID*/ 0,
/* unknown buffer size */ -1};
std::fill(UsedBuffer.begin(), UsedBuffer.end(), NullUsedBufferEntry);
llvm::fill(UsedBuffer, NullUsedBufferEntry);
}

void TimelineView::onReservedBuffers(const InstRef &IR,
Expand Down
6 changes: 3 additions & 3 deletions llvm/unittests/Support/ParallelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ TEST(Parallel, TransformReduce) {

// Check that we handle non-divisible task sizes as above.
uint32_t range[2050];
std::fill(std::begin(range), std::end(range), 1);
llvm::fill(range, 1);
sum = parallelTransformReduce(range, 0U, std::plus<uint32_t>(), identity);
EXPECT_EQ(sum, 2050U);

std::fill(std::begin(range), std::end(range), 2);
llvm::fill(range, 2);
sum = parallelTransformReduce(range, 0U, std::plus<uint32_t>(), identity);
EXPECT_EQ(sum, 4100U);

// Avoid one large task.
uint32_t range2[3060];
std::fill(std::begin(range2), std::end(range2), 1);
llvm::fill(range2, 1);
sum = parallelTransformReduce(range2, 0U, std::plus<uint32_t>(), identity);
EXPECT_EQ(sum, 3060U);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ TreePatternNodePtr TreePatternNode::clone() const {
/// RemoveAllTypes - Recursively strip all the types of this tree.
void TreePatternNode::RemoveAllTypes() {
// Reset to unknown type.
std::fill(Types.begin(), Types.end(), TypeSetByHwMode());
llvm::fill(Types, TypeSetByHwMode());
if (isLeaf())
return;
for (TreePatternNode &Child : children())
Expand Down
Loading