aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp11
-rw-r--r--llvm/lib/Target/AArch64/AArch64FrameLowering.cpp6
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp5
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterInfo.h2
4 files changed, 20 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index bc74daf..8abeb56 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1318,8 +1318,10 @@ void CodeViewDebug::collectVariableInfoFromMFTable(
TFI->getFrameIndexReference(*Asm->MF, VI.getStackSlot(), FrameReg);
uint16_t CVReg = TRI->getCodeViewRegNum(FrameReg);
- assert(!FrameOffset.getScalable() &&
- "Frame offsets with a scalable component are not supported");
+ if (FrameOffset.getScalable()) {
+ // No encoding currently exists for scalable offsets; bail out.
+ continue;
+ }
// Calculate the label ranges.
LocalVarDef DefRange =
@@ -1410,6 +1412,11 @@ void CodeViewDebug::calculateRanges(
if (Location->FragmentInfo->OffsetInBits % 8)
continue;
+ if (TRI->isIgnoredCVReg(Location->Register)) {
+ // No encoding currently exists for this register; bail out.
+ continue;
+ }
+
LocalVarDef DR;
DR.CVRegister = TRI->getCodeViewRegNum(Location->Register);
DR.InMemory = !Location->LoadChain.empty();
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
index 0179be4..885f2a9 100644
--- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -3043,9 +3043,11 @@ StackOffset AArch64FrameLowering::resolveFrameOffsetReference(
StackOffset::get(MFI.getStackSize() - AFI->getCalleeSavedStackSize(),
ObjectOffset);
if (FPAfterSVECalleeSaves) {
- assert(-ObjectOffset > (int64_t)AFI->getSVECalleeSavedStackSize() &&
- "Math isn't correct for CSRs with FPAfterSVECalleeSaves");
FPOffset += StackOffset::getScalable(AFI->getSVECalleeSavedStackSize());
+ if (-ObjectOffset <= (int64_t)AFI->getSVECalleeSavedStackSize()) {
+ FPOffset += StackOffset::getFixed(AFI->getCalleeSavedStackSize());
+ SPOffset += StackOffset::getFixed(AFI->getCalleeSavedStackSize());
+ }
}
// Always use the FP for SVE spills if available and beneficial.
if (hasFP(MF) && (SPOffset.getFixed() ||
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
index dd23bf5..77dfab8 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
@@ -1370,3 +1370,8 @@ bool AArch64RegisterInfo::shouldAnalyzePhysregInMachineLoopInfo(
MCRegister R) const {
return R == AArch64::VG;
}
+
+bool AArch64RegisterInfo::isIgnoredCVReg(MCRegister LLVMReg) const {
+ return (LLVMReg >= AArch64::Z0 && LLVMReg <= AArch64::Z31) ||
+ (LLVMReg >= AArch64::P0 && LLVMReg <= AArch64::P15);
+}
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.h b/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
index cc94be6..1ed8e95 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
@@ -154,6 +154,8 @@ public:
SmallVectorImpl<uint64_t> &Ops) const override;
bool shouldAnalyzePhysregInMachineLoopInfo(MCRegister R) const override;
+
+ virtual bool isIgnoredCVReg(MCRegister LLVMReg) const override;
};
} // end namespace llvm