diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-04-06 08:56:25 +0000 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-04-06 08:56:25 +0000 |
| commit | 537d7eee904d1bf9c819b4b3af96c3d9e4f60c61 (patch) | |
| tree | fddfdd569e17053b0392ef1df75d6fa6965f0ee4 | |
| parent | 54ca2d688aa001b08b9f147a448b478b2198fb77 (diff) | |
| download | bcm5719-llvm-537d7eee904d1bf9c819b4b3af96c3d9e4f60c61.tar.gz bcm5719-llvm-537d7eee904d1bf9c819b4b3af96c3d9e4f60c61.zip | |
[MIR] Add support for MachineFrameInfo::LocalFrameSize
MFI.LocalFrameSize was not serialized.
It is usually set from LocalStackSlotAllocation, so if that pass doesn't
run it is impossible do deduce it from the stack objects. Until now, this
information was lost.
llvm-svn: 329382
| -rw-r--r-- | llvm/include/llvm/CodeGen/MIRYamlMapping.h | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 1 | ||||
| -rw-r--r-- | llvm/test/CodeGen/MIR/Generic/frame-info.mir | 2 |
4 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MIRYamlMapping.h b/llvm/include/llvm/CodeGen/MIRYamlMapping.h index b75f9c8a693..be04fd591ab 100644 --- a/llvm/include/llvm/CodeGen/MIRYamlMapping.h +++ b/llvm/include/llvm/CodeGen/MIRYamlMapping.h @@ -417,6 +417,7 @@ struct MachineFrameInfo { bool HasOpaqueSPAdjustment = false; bool HasVAStart = false; bool HasMustTailInVarArgFunc = false; + unsigned LocalFrameSize = 0; StringValue SavePoint; StringValue RestorePoint; @@ -434,6 +435,7 @@ struct MachineFrameInfo { HasOpaqueSPAdjustment == Other.HasOpaqueSPAdjustment && HasVAStart == Other.HasVAStart && HasMustTailInVarArgFunc == Other.HasMustTailInVarArgFunc && + LocalFrameSize == Other.LocalFrameSize && SavePoint == Other.SavePoint && RestorePoint == Other.RestorePoint; } }; @@ -457,6 +459,7 @@ template <> struct MappingTraits<MachineFrameInfo> { YamlIO.mapOptional("hasVAStart", MFI.HasVAStart, false); YamlIO.mapOptional("hasMustTailInVarArgFunc", MFI.HasMustTailInVarArgFunc, false); + YamlIO.mapOptional("localFrameSize", MFI.LocalFrameSize, (unsigned)0); YamlIO.mapOptional("savePoint", MFI.SavePoint, StringValue()); // Don't print it out when it's empty. YamlIO.mapOptional("restorePoint", MFI.RestorePoint, diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 51e4948d228..378102403b3 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -582,6 +582,7 @@ bool MIRParserImpl::initializeFrameInfo(PerFunctionMIParsingState &PFS, MFI.setHasOpaqueSPAdjustment(YamlMFI.HasOpaqueSPAdjustment); MFI.setHasVAStart(YamlMFI.HasVAStart); MFI.setHasMustTailInVarArgFunc(YamlMFI.HasMustTailInVarArgFunc); + MFI.setLocalFrameSize(YamlMFI.LocalFrameSize); if (!YamlMFI.SavePoint.Value.empty()) { MachineBasicBlock *MBB = nullptr; if (parseMBBReference(PFS, MBB, YamlMFI.SavePoint)) diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 8452b4e3da7..15a6a578ce7 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -315,6 +315,7 @@ void MIRPrinter::convert(ModuleSlotTracker &MST, YamlMFI.HasOpaqueSPAdjustment = MFI.hasOpaqueSPAdjustment(); YamlMFI.HasVAStart = MFI.hasVAStart(); YamlMFI.HasMustTailInVarArgFunc = MFI.hasMustTailInVarArgFunc(); + YamlMFI.LocalFrameSize = MFI.getLocalFrameSize(); if (MFI.getSavePoint()) { raw_string_ostream StrOS(YamlMFI.SavePoint.Value); StrOS << printMBBReference(*MFI.getSavePoint()); diff --git a/llvm/test/CodeGen/MIR/Generic/frame-info.mir b/llvm/test/CodeGen/MIR/Generic/frame-info.mir index a467bfa3a1a..24c0ccde40b 100644 --- a/llvm/test/CodeGen/MIR/Generic/frame-info.mir +++ b/llvm/test/CodeGen/MIR/Generic/frame-info.mir @@ -41,6 +41,7 @@ tracksRegLiveness: true # CHECK-NEXT: hasOpaqueSPAdjustment: false # CHECK-NEXT: hasVAStart: false # CHECK-NEXT: hasMustTailInVarArgFunc: false +# CHECK-NEXT: localFrameSize: 0 # CHECK-NEXT: savePoint: '' # CHECK-NEXT: restorePoint: '' # CHECK: body @@ -85,6 +86,7 @@ frameInfo: hasOpaqueSPAdjustment: true hasVAStart: true hasMustTailInVarArgFunc: true + localFrameSize: 256 body: | bb.0.entry: ... |

