Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/RDFGraph.cpp
- This file was moved from llvm/lib/Target/Hexagon/RDFGraph.cpp.
//===- RDFGraph.cpp -------------------------------------------------------===// | //===- RDFGraph.cpp -------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Target-independent, SSA-based data flow graph for register data flow (RDF). | // Target-independent, SSA-based data flow graph for register data flow (RDF). | ||||
// | // | ||||
#include "RDFGraph.h" | |||||
#include "RDFRegisters.h" | |||||
#include "llvm/ADT/BitVector.h" | #include "llvm/ADT/BitVector.h" | ||||
#include "llvm/ADT/STLExtras.h" | #include "llvm/ADT/STLExtras.h" | ||||
#include "llvm/ADT/SetVector.h" | #include "llvm/ADT/SetVector.h" | ||||
#include "llvm/CodeGen/MachineBasicBlock.h" | #include "llvm/CodeGen/MachineBasicBlock.h" | ||||
#include "llvm/CodeGen/MachineDominanceFrontier.h" | #include "llvm/CodeGen/MachineDominanceFrontier.h" | ||||
#include "llvm/CodeGen/MachineDominators.h" | #include "llvm/CodeGen/MachineDominators.h" | ||||
#include "llvm/CodeGen/MachineFunction.h" | #include "llvm/CodeGen/MachineFunction.h" | ||||
#include "llvm/CodeGen/MachineInstr.h" | #include "llvm/CodeGen/MachineInstr.h" | ||||
#include "llvm/CodeGen/MachineOperand.h" | #include "llvm/CodeGen/MachineOperand.h" | ||||
#include "llvm/CodeGen/MachineRegisterInfo.h" | #include "llvm/CodeGen/MachineRegisterInfo.h" | ||||
#include "llvm/CodeGen/RDFGraph.h" | |||||
#include "llvm/CodeGen/RDFRegisters.h" | |||||
#include "llvm/CodeGen/TargetInstrInfo.h" | #include "llvm/CodeGen/TargetInstrInfo.h" | ||||
#include "llvm/CodeGen/TargetLowering.h" | #include "llvm/CodeGen/TargetLowering.h" | ||||
#include "llvm/CodeGen/TargetRegisterInfo.h" | #include "llvm/CodeGen/TargetRegisterInfo.h" | ||||
#include "llvm/CodeGen/TargetSubtargetInfo.h" | #include "llvm/CodeGen/TargetSubtargetInfo.h" | ||||
#include "llvm/IR/Function.h" | #include "llvm/IR/Function.h" | ||||
#include "llvm/MC/LaneBitmask.h" | #include "llvm/MC/LaneBitmask.h" | ||||
#include "llvm/MC/MCInstrDesc.h" | #include "llvm/MC/MCInstrDesc.h" | ||||
#include "llvm/MC/MCRegisterInfo.h" | #include "llvm/MC/MCRegisterInfo.h" | ||||
▲ Show 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | |||||
RegisterSet DataFlowGraph::getLandingPadLiveIns() const { | RegisterSet DataFlowGraph::getLandingPadLiveIns() const { | ||||
RegisterSet LR; | RegisterSet LR; | ||||
const Function &F = MF.getFunction(); | const Function &F = MF.getFunction(); | ||||
const Constant *PF = F.hasPersonalityFn() ? F.getPersonalityFn() | const Constant *PF = F.hasPersonalityFn() ? F.getPersonalityFn() | ||||
: nullptr; | : nullptr; | ||||
const TargetLowering &TLI = *MF.getSubtarget().getTargetLowering(); | const TargetLowering &TLI = *MF.getSubtarget().getTargetLowering(); | ||||
if (RegisterId R = TLI.getExceptionPointerRegister(PF)) | if (RegisterId R = TLI.getExceptionPointerRegister(PF)) | ||||
LR.insert(RegisterRef(R)); | LR.insert(RegisterRef(R)); | ||||
if (!isFuncletEHPersonality(classifyEHPersonality(PF))) { | |||||
if (RegisterId R = TLI.getExceptionSelectorRegister(PF)) | if (RegisterId R = TLI.getExceptionSelectorRegister(PF)) | ||||
LR.insert(RegisterRef(R)); | LR.insert(RegisterRef(R)); | ||||
} | |||||
zbrid: Thanks for this patch! Qq, is this some functionality change? Why does the refactor require… | |||||
Not Done ReplyInline ActionsThe original RDF implementation didn't need to handle Windows targets. The TLI::getExceptionSelectionRegister() method has an assertion testing that it is not called for Windows EH personality functions. There is no exception selector register on Windows. andrew.w.kaylor: The original RDF implementation didn't need to handle Windows targets. The TLI… | |||||
return LR; | return LR; | ||||
} | } | ||||
// Node management functions. | // Node management functions. | ||||
// Get the pointer to the node with the id N. | // Get the pointer to the node with the id N. | ||||
NodeBase *DataFlowGraph::ptr(NodeId N) const { | NodeBase *DataFlowGraph::ptr(NodeId N) const { | ||||
if (N == 0) | if (N == 0) | ||||
▲ Show 20 Lines • Show All 1,070 Lines • Show Last 20 Lines |
Thanks for this patch! Qq, is this some functionality change? Why does the refactor require this update?