|
LLVM
3.7.0
|
#include "llvm/CodeGen/ScheduleDAGInstrs.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallSet.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/CodeGen/LiveIntervalAnalysis.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineMemOperand.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/PseudoSourceValue.h"#include "llvm/CodeGen/RegisterPressure.h"#include "llvm/CodeGen/ScheduleDFS.h"#include "llvm/IR/Operator.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Format.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetRegisterInfo.h"#include "llvm/Target/TargetSubtargetInfo.h"#include <queue>Go to the source code of this file.
Classes | |
| class | llvm::SchedDFSImpl |
| Internal state used to compute SchedDFSResult. More... | |
Namespaces | |
| llvm | |
| Compute iterated dominance frontiers using a linear time algorithm. | |
Macros | |
| #define | DEBUG_TYPE "misched" |
Typedefs | |
| typedef PointerUnion< const Value *, const PseudoSourceValue * > | ValueType |
| typedef SmallVector < PointerIntPair< ValueType, 1, bool >, 4 > | UnderlyingObjectsVector |
Functions | |
| static const Value * | getUnderlyingObjectFromInt (const Value *V) |
| getUnderlyingObjectFromInt - This is the function that does the work of looking through basic ptrtoint+arithmetic+inttoptr sequences. More... | |
| static void | getUnderlyingObjects (const Value *V, SmallVectorImpl< Value * > &Objects, const DataLayout &DL) |
| getUnderlyingObjects - This is a wrapper around GetUnderlyingObjects and adds support for basic ptrtoint+arithmetic+inttoptr sequences. More... | |
| static void | getUnderlyingObjectsForInstr (const MachineInstr *MI, const MachineFrameInfo *MFI, UnderlyingObjectsVector &Objects, const DataLayout &DL) |
| getUnderlyingObjectsForInstr - If this machine instr has memory reference information and it can be tracked to a normal reference to a known object, return the Value for that object. More... | |
| static bool | isGlobalMemoryObject (AliasAnalysis *AA, MachineInstr *MI) |
| Return true if MI is an instruction we are unable to reason about (like a call or something with unmodeled side effects). More... | |
| static bool | isUnsafeMemoryObject (MachineInstr *MI, const MachineFrameInfo *MFI, const DataLayout &DL) |
| static bool | MIsNeedChainEdge (AliasAnalysis *AA, const MachineFrameInfo *MFI, const DataLayout &DL, MachineInstr *MIa, MachineInstr *MIb) |
| This returns true if the two MIs need a chain edge betwee them. More... | |
| static unsigned | iterateChainSucc (AliasAnalysis *AA, const MachineFrameInfo *MFI, const DataLayout &DL, SUnit *SUa, SUnit *SUb, SUnit *ExitSU, unsigned *Depth, SmallPtrSetImpl< const SUnit * > &Visited) |
| This recursive function iterates over chain deps of SUb looking for "latest" node that needs a chain edge to SUa. More... | |
| static void | adjustChainDeps (AliasAnalysis *AA, const MachineFrameInfo *MFI, const DataLayout &DL, SUnit *SU, SUnit *ExitSU, std::set< SUnit * > &CheckList, unsigned LatencyToLoad) |
| This function assumes that "downward" from SU there exist tail/leaf of already constructed DAG. More... | |
| static void | addChainDependency (AliasAnalysis *AA, const MachineFrameInfo *MFI, const DataLayout &DL, SUnit *SUa, SUnit *SUb, std::set< SUnit * > &RejectList, unsigned TrueMemOrderLatency=0, bool isNormalMemory=false) |
| Check whether two objects need a chain edge, if so, add it otherwise remember the rejected SU. More... | |
| static void | toggleBundleKillFlag (MachineInstr *MI, unsigned Reg, bool NewKillState) |
| If we change a kill flag on the bundle instruction implicit register operands, then we also need to propagate that to any instructions inside the bundle which had the same kill state. More... | |
| static bool | hasDataSucc (const SUnit *SU) |
| raw_ostream & | llvm::operator<< (raw_ostream &OS, const ILPValue &Val) |
Variables | |
| static cl::opt< bool > | EnableAASchedMI ("enable-aa-sched-mi", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable use of AA during MI DAG construction")) |
| static cl::opt< bool > | UseTBAA ("use-tbaa-in-sched-mi", cl::Hidden, cl::init(true), cl::desc("Enable use of TBAA during MI DAG construction")) |
| #define DEBUG_TYPE "misched" |
Definition at line 43 of file ScheduleDAGInstrs.cpp.
| typedef SmallVector<PointerIntPair<ValueType, 1, bool>, 4> UnderlyingObjectsVector |
Definition at line 129 of file ScheduleDAGInstrs.cpp.
| typedef PointerUnion<const Value *, const PseudoSourceValue *> ValueType |
Definition at line 127 of file ScheduleDAGInstrs.cpp.
|
inlinestatic |
Check whether two objects need a chain edge, if so, add it otherwise remember the rejected SU.
Definition at line 666 of file ScheduleDAGInstrs.cpp.
References llvm::SUnit::addPred(), llvm::SDep::Barrier, llvm::dbgs(), DEBUG, llvm::SUnit::getInstr(), llvm::SDep::MayAliasMem, MIsNeedChainEdge(), llvm::SUnit::NodeNum, and llvm::SDep::setLatency().
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph().
|
static |
This function assumes that "downward" from SU there exist tail/leaf of already constructed DAG.
It iterates downward and checks whether SU can be aliasing any node dominated by it.
Definition at line 634 of file ScheduleDAGInstrs.cpp.
References llvm::SUnit::getInstr(), I, llvm::ARM_PROC::IE, iterateChainSucc(), llvm::SDep::MayAliasMem, MIsNeedChainEdge(), and llvm::SDep::setLatency().
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph().
getUnderlyingObjectFromInt - This is the function that does the work of looking through basic ptrtoint+arithmetic+inttoptr sequences.
Definition at line 70 of file ScheduleDAGInstrs.cpp.
References llvm::Operator::getOpcode(), llvm::Value::getType(), and llvm::Type::isIntegerTy().
Referenced by getUnderlyingObjects().
|
static |
getUnderlyingObjects - This is a wrapper around GetUnderlyingObjects and adds support for basic ptrtoint+arithmetic+inttoptr sequences.
Definition at line 98 of file ScheduleDAGInstrs.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::Operator::getOpcode(), llvm::Value::getType(), getUnderlyingObjectFromInt(), llvm::GetUnderlyingObjects(), I, llvm::ARM_PROC::IE, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Type::isPointerTy(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by getUnderlyingObjectsForInstr(), and isUnsafeMemoryObject().
|
static |
getUnderlyingObjectsForInstr - If this machine instr has memory reference information and it can be tracked to a normal reference to a known object, return the Value for that object.
Definition at line 134 of file ScheduleDAGInstrs.cpp.
References llvm::SmallVectorImpl< T >::clear(), getUnderlyingObjects(), llvm::MachineInstr::hasOneMemOperand(), llvm::MachineFrameInfo::hasTailCall(), llvm::isIdentifiedObject(), isVolatile(), llvm::MayAlias, llvm::MachineInstr::memoperands_begin(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph().
Definition at line 1513 of file ScheduleDAGInstrs.cpp.
References llvm::SDep::Data, SI, and llvm::SUnit::Succs.
Referenced by llvm::SchedDFSResult::compute().
|
inlinestatic |
Return true if MI is an instruction we are unable to reason about (like a call or something with unmodeled side effects).
Definition at line 466 of file ScheduleDAGInstrs.cpp.
References llvm::MachineInstr::hasOrderedMemoryRef(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::MachineInstr::isCall(), llvm::MachineInstr::isInvariantLoad(), and llvm::MachineInstr::mayLoad().
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph(), and iterateChainSucc().
|
inlinestatic |
Definition at line 476 of file ScheduleDAGInstrs.cpp.
References getUnderlyingObjects(), llvm::MachineInstr::hasUnmodeledSideEffects(), llvm::isIdentifiedObject(), isVolatile(), llvm::MachineInstr::memoperands_begin(), and llvm::MachineInstr::memoperands_empty().
Referenced by MIsNeedChainEdge().
|
static |
This recursive function iterates over chain deps of SUb looking for "latest" node that needs a chain edge to SUa.
Definition at line 588 of file ScheduleDAGInstrs.cpp.
References llvm::SUnit::addPred(), llvm::SUnit::getInstr(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), isGlobalMemoryObject(), llvm::SUnit::isSucc(), llvm::SDep::MayAliasMem, MIsNeedChainEdge(), and llvm::SUnit::Succs.
Referenced by adjustChainDeps().
|
static |
This returns true if the two MIs need a chain edge betwee them.
If these are not even memory operations, we still may need chain deps between them. The question really is - could these two MIs be reordered during scheduling from memory dependency point of view.
Definition at line 516 of file ScheduleDAGInstrs.cpp.
References llvm::AliasAnalysis::alias(), llvm::TargetInstrInfo::areMemAccessesTriviallyDisjoint(), llvm::MachineMemOperand::getAAInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineMemOperand::getOffset(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineMemOperand::getSize(), llvm::MachineFunction::getSubtarget(), llvm::MachineMemOperand::getValue(), llvm::MachineInstr::hasOneMemOperand(), isUnsafeMemoryObject(), llvm::MachineInstr::mayLoad(), llvm::MachineInstr::mayStore(), llvm::MachineInstr::memoperands_begin(), fuzzer::min(), llvm::NoAlias, TII, and UseTBAA.
Referenced by addChainDependency(), adjustChainDeps(), and iterateChainSucc().
|
static |
If we change a kill flag on the bundle instruction implicit register operands, then we also need to propagate that to any instructions inside the bundle which had the same kill state.
Definition at line 1097 of file ScheduleDAGInstrs.cpp.
References llvm::TargetOpcode::BUNDLE, llvm::getBundleEnd(), llvm::MachineInstr::getOpcode(), and llvm::AArch64CC::MI.
Referenced by llvm::ScheduleDAGInstrs::toggleKillFlag().
|
static |
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph().
|
static |
Referenced by MIsNeedChainEdge().
1.8.6