diff options
author | Philip Reames <listmail@philipreames.com> | 2019-12-19 14:03:19 -0800 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-12-19 14:05:30 -0800 |
commit | 8277c91cf3427347626e276fec20a68c0662e49d (patch) | |
tree | 9770eac17faa9ecf967931f9a04e91f604d84921 /llvm/lib/CodeGen/StackMaps.cpp | |
parent | 85cb560b8a421d950ccea593b4ee0569249dc136 (diff) | |
download | bcm5719-llvm-8277c91cf3427347626e276fec20a68c0662e49d.tar.gz bcm5719-llvm-8277c91cf3427347626e276fec20a68c0662e49d.zip |
[StackMaps] Be explicit about label formation [NFC] (try 2)
Recommit after making the same API change in non-x86 targets. This has been build for all targets, and tested for effected ones. Why the difference? Because my disk filled up when I tried make check for all.
For auto-padding assembler support, we'll need to bundle the label with the instructions (nops or call sequences) so that they don't get separated. This just rearranges the code to make the upcoming change more obvious.
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackMaps.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp index 23a3cb7cc7f..e16587c44a5 100644 --- a/llvm/lib/CodeGen/StackMaps.cpp +++ b/llvm/lib/CodeGen/StackMaps.cpp @@ -294,14 +294,13 @@ StackMaps::parseRegisterLiveOutMask(const uint32_t *Mask) const { return LiveOuts; } -void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID, +void StackMaps::recordStackMapOpers(const MCSymbol &MILabel, + const MachineInstr &MI, uint64_t ID, MachineInstr::const_mop_iterator MOI, MachineInstr::const_mop_iterator MOE, bool recordResult) { MCContext &OutContext = AP.OutStreamer->getContext(); - MCSymbol *MILabel = OutContext.createTempSymbol(); - AP.OutStreamer->EmitLabel(MILabel); - + LocationVec Locations; LiveOutVec LiveOuts; @@ -340,7 +339,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID, // Create an expression to calculate the offset of the callsite from function // entry. const MCExpr *CSOffsetExpr = MCBinaryExpr::createSub( - MCSymbolRefExpr::create(MILabel, OutContext), + MCSymbolRefExpr::create(&MILabel, OutContext), MCSymbolRefExpr::create(AP.CurrentFnSymForSize, OutContext), OutContext); CSInfos.emplace_back(CSOffsetExpr, ID, std::move(Locations), @@ -360,22 +359,23 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID, FnInfos.insert(std::make_pair(AP.CurrentFnSym, FunctionInfo(FrameSize))); } -void StackMaps::recordStackMap(const MachineInstr &MI) { +void StackMaps::recordStackMap(const MCSymbol &L, const MachineInstr &MI) { assert(MI.getOpcode() == TargetOpcode::STACKMAP && "expected stackmap"); StackMapOpers opers(&MI); const int64_t ID = MI.getOperand(PatchPointOpers::IDPos).getImm(); - recordStackMapOpers(MI, ID, std::next(MI.operands_begin(), opers.getVarIdx()), + recordStackMapOpers(L, MI, ID, std::next(MI.operands_begin(), + opers.getVarIdx()), MI.operands_end()); } -void StackMaps::recordPatchPoint(const MachineInstr &MI) { +void StackMaps::recordPatchPoint(const MCSymbol &L, const MachineInstr &MI) { assert(MI.getOpcode() == TargetOpcode::PATCHPOINT && "expected patchpoint"); PatchPointOpers opers(&MI); const int64_t ID = opers.getID(); auto MOI = std::next(MI.operands_begin(), opers.getStackMapStartIdx()); - recordStackMapOpers(MI, ID, MOI, MI.operands_end(), + recordStackMapOpers(L, MI, ID, MOI, MI.operands_end(), opers.isAnyReg() && opers.hasDef()); #ifndef NDEBUG @@ -390,14 +390,14 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) { #endif } -void StackMaps::recordStatepoint(const MachineInstr &MI) { +void StackMaps::recordStatepoint(const MCSymbol &L, const MachineInstr &MI) { assert(MI.getOpcode() == TargetOpcode::STATEPOINT && "expected statepoint"); StatepointOpers opers(&MI); // Record all the deopt and gc operands (they're contiguous and run from the // initial index to the end of the operand list) const unsigned StartIdx = opers.getVarIdx(); - recordStackMapOpers(MI, opers.getID(), MI.operands_begin() + StartIdx, + recordStackMapOpers(L, MI, opers.getID(), MI.operands_begin() + StartIdx, MI.operands_end(), false); } |