diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-02-17 10:00:11 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-02-17 10:00:11 +0300 |
commit | 238dcee0609b29afef350ad1ec1f11a5f77f3ddb (patch) | |
tree | 60c8fceccb240051282831ee7c022d5d13176497 /contrib/libs/llvm12/lib | |
parent | 6556439410107545365e31cda892ba81dbeb5b2e (diff) | |
download | ydb-238dcee0609b29afef350ad1ec1f11a5f77f3ddb.tar.gz |
intermediate changes
ref:9d0ab25c9bb4423427bb19b3ca25ded76535a4df
Diffstat (limited to 'contrib/libs/llvm12/lib')
-rw-r--r-- | contrib/libs/llvm12/lib/CodeGen/MachineBasicBlock.cpp | 18 | ||||
-rw-r--r-- | contrib/libs/llvm12/lib/CodeGen/RegAllocFast.cpp | 6 | ||||
-rw-r--r-- | contrib/libs/llvm12/lib/Target/X86/X86ISelLowering.cpp | 3 |
3 files changed, 22 insertions, 5 deletions
diff --git a/contrib/libs/llvm12/lib/CodeGen/MachineBasicBlock.cpp b/contrib/libs/llvm12/lib/CodeGen/MachineBasicBlock.cpp index b4187af0297..798484dd38e 100644 --- a/contrib/libs/llvm12/lib/CodeGen/MachineBasicBlock.cpp +++ b/contrib/libs/llvm12/lib/CodeGen/MachineBasicBlock.cpp @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SlotIndexes.h" #include "llvm/CodeGen/TargetInstrInfo.h" +#include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/Config/llvm-config.h" @@ -1569,6 +1570,23 @@ MachineBasicBlock::livein_iterator MachineBasicBlock::livein_begin() const { return LiveIns.begin(); } +MachineBasicBlock::liveout_iterator MachineBasicBlock::liveout_begin() const { + const MachineFunction &MF = *getParent(); + assert(MF.getProperties().hasProperty( + MachineFunctionProperties::Property::TracksLiveness) && + "Liveness information is accurate"); + + const TargetLowering &TLI = *MF.getSubtarget().getTargetLowering(); + MCPhysReg ExceptionPointer = 0, ExceptionSelector = 0; + if (MF.getFunction().hasPersonalityFn()) { + auto PersonalityFn = MF.getFunction().getPersonalityFn(); + ExceptionPointer = TLI.getExceptionPointerRegister(PersonalityFn); + ExceptionSelector = TLI.getExceptionSelectorRegister(PersonalityFn); + } + + return liveout_iterator(*this, ExceptionPointer, ExceptionSelector, false); +} + const MBBSectionID MBBSectionID::ColdSectionID(MBBSectionID::SectionType::Cold); const MBBSectionID MBBSectionID::ExceptionSectionID(MBBSectionID::SectionType::Exception); diff --git a/contrib/libs/llvm12/lib/CodeGen/RegAllocFast.cpp b/contrib/libs/llvm12/lib/CodeGen/RegAllocFast.cpp index 6e548d4a93c..1933c3d22bd 100644 --- a/contrib/libs/llvm12/lib/CodeGen/RegAllocFast.cpp +++ b/contrib/libs/llvm12/lib/CodeGen/RegAllocFast.cpp @@ -1425,10 +1425,8 @@ void RegAllocFast::allocateBasicBlock(MachineBasicBlock &MBB) { RegUnitStates.assign(TRI->getNumRegUnits(), regFree); assert(LiveVirtRegs.empty() && "Mapping not cleared from last block?"); - for (MachineBasicBlock *Succ : MBB.successors()) { - for (const MachineBasicBlock::RegisterMaskPair &LI : Succ->liveins()) - setPhysRegState(LI.PhysReg, regPreAssigned); - } + for (auto &LiveReg : MBB.liveouts()) + setPhysRegState(LiveReg.PhysReg, regPreAssigned); Coalesced.clear(); diff --git a/contrib/libs/llvm12/lib/Target/X86/X86ISelLowering.cpp b/contrib/libs/llvm12/lib/Target/X86/X86ISelLowering.cpp index 1e2407c7e7f..136b71d2cfb 100644 --- a/contrib/libs/llvm12/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/libs/llvm12/lib/Target/X86/X86ISelLowering.cpp @@ -26632,7 +26632,8 @@ Register X86TargetLowering::getExceptionPointerRegister( Register X86TargetLowering::getExceptionSelectorRegister( const Constant *PersonalityFn) const { // Funclet personalities don't use selectors (the runtime does the selection). - assert(!isFuncletEHPersonality(classifyEHPersonality(PersonalityFn))); + if (isFuncletEHPersonality(classifyEHPersonality(PersonalityFn))) + return X86::NoRegister; return Subtarget.isTarget64BitLP64() ? X86::RDX : X86::EDX; } |