-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[CodeGen][NFC] Remove redundant map lookup #125342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-regalloc Author: Balazs Benics (steakhal) ChangesFull diff: https://github.com/llvm/llvm-project/pull/125342.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index 33915d0f7f8297..cfd247e7c3caf6 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -1320,13 +1320,16 @@ void HoistSpillHelper::addToMergeableSpills(MachineInstr &Spill, int StackSlot,
LiveInterval &OrigLI = LIS.getInterval(Original);
// save a copy of LiveInterval in StackSlotToOrigLI because the original
// LiveInterval may be cleared after all its references are spilled.
- if (!StackSlotToOrigLI.contains(StackSlot)) {
+
+ auto [Place, Inserted] = StackSlotToOrigLI.try_emplace(StackSlot);
+ if (Inserted) {
auto LI = std::make_unique<LiveInterval>(OrigLI.reg(), OrigLI.weight());
LI->assign(OrigLI, Allocator);
- StackSlotToOrigLI[StackSlot] = std::move(LI);
+ Place->second = std::move(LI);
}
+
SlotIndex Idx = LIS.getInstructionIndex(Spill);
- VNInfo *OrigVNI = StackSlotToOrigLI[StackSlot]->getVNInfoAt(Idx.getRegSlot());
+ VNInfo *OrigVNI = Place->second->getVNInfoAt(Idx.getRegSlot());
std::pair<int, VNInfo *> MIdx = std::make_pair(StackSlot, OrigVNI);
MergeableSpills[MIdx].insert(&Spill);
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/12860 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/10819 Here is the relevant piece of the build log for the reference
|
No description provided.