Skip to content
Merged
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
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/MachineCopyPropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ static std::optional<DestSourcePair> isCopyInstr(const MachineInstr &MI,

class CopyTracker {
struct CopyInfo {
MachineInstr *MI, *LastSeenUseInCopy;
MachineInstr *MI = nullptr;
MachineInstr *LastSeenUseInCopy = nullptr;
SmallVector<MCRegister, 4> DefRegs;
bool Avail;
bool Avail = false;
};

DenseMap<MCRegUnit, CopyInfo> Copies;
Expand Down Expand Up @@ -240,8 +241,7 @@ class CopyTracker {
// Remember source that's copied to Def. Once it's clobbered, then
// it's no longer available for copy propagation.
for (MCRegUnit Unit : TRI.regunits(Src)) {
auto I = Copies.insert({Unit, {nullptr, nullptr, {}, false}});
auto &Copy = I.first->second;
auto &Copy = Copies[Unit];
if (!is_contained(Copy.DefRegs, Def))
Copy.DefRegs.push_back(Def);
Copy.LastSeenUseInCopy = MI;
Expand Down