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
5 changes: 2 additions & 3 deletions llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2261,11 +2261,10 @@ PtrParts SplitPtrStructs::visitIntrinsicInst(IntrinsicInst &I) {

void SplitPtrStructs::processFunction(Function &F) {
ST = &TM->getSubtarget<GCNSubtarget>(F);
SmallVector<Instruction *, 0> Originals;
SmallVector<Instruction *, 0> Originals(
llvm::make_pointer_range(instructions(F)));
LLVM_DEBUG(dbgs() << "Splitting pointer structs in function: " << F.getName()
<< "\n");
for (Instruction &I : instructions(F))
Originals.push_back(&I);
for (Instruction *I : Originals) {
auto [Rsrc, Off] = visit(I);
assert(((Rsrc && Off) || (!Rsrc && !Off)) &&
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ Type *AMDGPURewriteOutArguments::getStoredType(Value &Arg) const {
const int MaxUses = 10;
int UseCount = 0;

SmallVector<Use *> Worklist;
for (Use &U : Arg.uses())
Worklist.push_back(&U);
SmallVector<Use *> Worklist(llvm::make_pointer_range(Arg.uses()));

Type *StoredType = nullptr;
while (!Worklist.empty()) {
Expand Down
7 changes: 2 additions & 5 deletions llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,8 @@ bool GCNDPPCombine::combineDPPMov(MachineInstr &MovMI) const {

OrigMIs.push_back(&MovMI);
bool Rollback = true;
SmallVector<MachineOperand*, 16> Uses;

for (auto &Use : MRI->use_nodbg_operands(DPPMovReg)) {
Uses.push_back(&Use);
}
SmallVector<MachineOperand *, 16> Uses(
llvm::make_pointer_range(MRI->use_nodbg_operands(DPPMovReg)));

while (!Uses.empty()) {
MachineOperand *Use = Uses.pop_back_val();
Expand Down
15 changes: 6 additions & 9 deletions llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,8 @@ void SIFoldOperandsImpl::foldOperand(
unsigned RegSeqDstSubReg = UseMI->getOperand(UseOpIdx + 1).getImm();

// Grab the use operands first
SmallVector<MachineOperand *, 4> UsesToProcess;
for (auto &Use : MRI->use_nodbg_operands(RegSeqDstReg))
UsesToProcess.push_back(&Use);
SmallVector<MachineOperand *, 4> UsesToProcess(
llvm::make_pointer_range(MRI->use_nodbg_operands(RegSeqDstReg)));
for (auto *RSUse : UsesToProcess) {
MachineInstr *RSUseMI = RSUse->getParent();

Expand Down Expand Up @@ -1552,9 +1551,8 @@ bool SIFoldOperandsImpl::foldInstOperand(MachineInstr &MI,
}
}

SmallVector<MachineOperand *, 4> UsesToProcess;
for (auto &Use : MRI->use_nodbg_operands(Dst.getReg()))
UsesToProcess.push_back(&Use);
SmallVector<MachineOperand *, 4> UsesToProcess(
llvm::make_pointer_range(MRI->use_nodbg_operands(Dst.getReg())));
for (auto *U : UsesToProcess) {
MachineInstr *UseMI = U->getParent();
foldOperand(OpToFold, UseMI, UseMI->getOperandNo(U), FoldList,
Expand Down Expand Up @@ -2380,10 +2378,9 @@ bool SIFoldOperandsImpl::tryFoldLoad(MachineInstr &MI) {
if (DefReg.isPhysical() || !TRI->isVGPR(*MRI, DefReg))
return false;

SmallVector<const MachineInstr*, 8> Users;
SmallVector<const MachineInstr *, 8> Users(
llvm::make_pointer_range(MRI->use_nodbg_instructions(DefReg)));
SmallVector<Register, 8> MoveRegs;
for (const MachineInstr &I : MRI->use_nodbg_instructions(DefReg))
Users.push_back(&I);

if (Users.empty())
return false;
Expand Down
Loading