summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetRegisterInfo.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
committerFlorian Mayer <fmayer@google.com>2024-08-07 14:00:51 -0700
commit10fbc246b146dbdf6b7cd9083bf392505c534fbc (patch)
tree898a2504a8bc941166603c77021937fd995e79ce /llvm/lib/CodeGen/TargetRegisterInfo.cpp
parent191d02015fba3458bdf6381ee93c32e485daf25e (diff)
parenta05fa131db58f2d66a1f9e68fea74068f9218c2b (diff)
Created using spr 1.3.4
Diffstat (limited to 'llvm/lib/CodeGen/TargetRegisterInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetRegisterInfo.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetRegisterInfo.cpp b/llvm/lib/CodeGen/TargetRegisterInfo.cpp
index ffc8055dd27e..16dab974efac 100644
--- a/llvm/lib/CodeGen/TargetRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/TargetRegisterInfo.cpp
@@ -421,13 +421,16 @@ bool TargetRegisterInfo::getRegAllocationHints(
SmallVectorImpl<MCPhysReg> &Hints, const MachineFunction &MF,
const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const {
const MachineRegisterInfo &MRI = MF.getRegInfo();
- const std::pair<unsigned, SmallVector<Register, 4>> &Hints_MRI =
+ const std::pair<unsigned, SmallVector<Register, 4>> *Hints_MRI =
MRI.getRegAllocationHints(VirtReg);
+ if (!Hints_MRI)
+ return false;
+
SmallSet<Register, 32> HintedRegs;
// First hint may be a target hint.
- bool Skip = (Hints_MRI.first != 0);
- for (auto Reg : Hints_MRI.second) {
+ bool Skip = (Hints_MRI->first != 0);
+ for (auto Reg : Hints_MRI->second) {
if (Skip) {
Skip = false;
continue;