diff options
Diffstat (limited to 'backend/lib/CodeGen')
| -rw-r--r-- | backend/lib/CodeGen/LiveVariables.cpp | 20 | ||||
| -rw-r--r-- | backend/lib/CodeGen/MIRPrinter.cpp | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/backend/lib/CodeGen/LiveVariables.cpp b/backend/lib/CodeGen/LiveVariables.cpp index 201e09e..8bdd23e 100644 --- a/backend/lib/CodeGen/LiveVariables.cpp +++ b/backend/lib/CodeGen/LiveVariables.cpp @@ -441,10 +441,11 @@ struct LivenessRebuildPlan final { std::vector<OperandFlagPlan> Operands; }; -[[nodiscard]] Expected<bool> -liveSetIntersects(const MachineOperand &Operand, const RegisterLaneSet &Virtual, - const LiveRegUnits &Physical, const MachineFunction &Function, - const TargetDescription &Target, bool TreatReservedAsLive) { +[[nodiscard]] Expected<bool> liveSetIntersects(const MachineOperand &Operand, + const RegisterLaneSet &Virtual, + const LiveRegUnits &Physical, + const MachineFunction &Function, + const TargetDescription &Target) { const Register *Reg = Operand.getIf<Register>(); if (Reg == nullptr || Reg->isNoRegister()) return false; @@ -454,8 +455,6 @@ liveSetIntersects(const MachineOperand &Operand, const RegisterLaneSet &Virtual, return std::unexpected(Lanes.error()); return Virtual.intersects(*Reg, *Lanes); } - if (TreatReservedAsLive && isReservedPhysicalRegister(*Reg, Function, Target)) - return true; auto Units = physicalOperandUnits(Operand, Target); if (!Units) return std::unexpected(Units.error()); @@ -546,6 +545,11 @@ liveSetIntersects(const MachineOperand &Operand, const RegisterLaneSet &Virtual, for (const MachineOperand &Operand : Instruction->operands()) { if (!Operand.isRegister() || !Operand.isUse()) continue; + const Register *Reg = Operand.getIf<Register>(); + if (Reg != nullptr && Reg->isPhysical() && + isReservedPhysicalRegister(*Reg, Function, Target)) { + continue; + } auto Added = addOperandToLiveSet(Operand, Virtual, Physical, Function, Target); if (!Added) return std::unexpected(Added.error()); @@ -600,7 +604,7 @@ buildLivenessRebuildPlan(const MachineFunction &Function, const TargetDescriptio const MachineOperand *Operand = Instruction->operandAt(Index); if (Operand == nullptr || !Operand->isRegister() || !Operand->isDef()) continue; - auto IsLive = liveSetIntersects(*Operand, Virtual, Physical, Function, Target, false); + auto IsLive = liveSetIntersects(*Operand, Virtual, Physical, Function, Target); if (!IsLive) return std::unexpected(IsLive.error()); RegisterOperandFlags Flags = Operand->registerFlags(); @@ -656,7 +660,7 @@ buildLivenessRebuildPlan(const MachineFunction &Function, const TargetDescriptio !Operand->registerValue()->isNoRegister(); bool IsKill = false; if (IsSemanticUse) { - auto IsLive = liveSetIntersects(*Operand, Virtual, Physical, Function, Target, true); + auto IsLive = liveSetIntersects(*Operand, Virtual, Physical, Function, Target); if (!IsLive) return std::unexpected(IsLive.error()); IsKill = !*IsLive; diff --git a/backend/lib/CodeGen/MIRPrinter.cpp b/backend/lib/CodeGen/MIRPrinter.cpp index 4683a81..3708053 100644 --- a/backend/lib/CodeGen/MIRPrinter.cpp +++ b/backend/lib/CodeGen/MIRPrinter.cpp @@ -1530,7 +1530,7 @@ namespace { [[nodiscard]] std::string hexadecimalWords(std::span<const std::uint64_t> Words, std::uint32_t BitWidth) { - constexpr std::string_view Hex = "0123456789ABCDEF"; + constexpr std::string_view Hex = "0123456789abcdef"; const std::size_t DigitCount = (static_cast<std::size_t>(BitWidth) + 3U) / 4U; std::string Result(DigitCount, '0'); for (std::size_t Digit = 0; Digit < DigitCount; ++Digit) { |
