29 "ipt-expensive-asserts",
30 cl::desc(
"Perform expensive assert validation on every query to Instruction" 31 " Precedence Tracking"),
46 if (FirstSpecialInsts.find(BB) == FirstSpecialInsts.end()) {
48 assert(FirstSpecialInsts.find(BB) != FirstSpecialInsts.end() &&
"Must be!");
50 return FirstSpecialInsts[BB];
62 return MaybeFirstSpecial && OI.
dominates(MaybeFirstSpecial, Insn);
65 void InstructionPrecedenceTracking::fill(
const BasicBlock *BB) {
66 FirstSpecialInsts.erase(BB);
69 FirstSpecialInsts[BB] = &
I;
74 FirstSpecialInsts[BB] =
nullptr;
79 auto It = FirstSpecialInsts.find(BB);
81 if (It == FirstSpecialInsts.end())
86 assert(It->second == &Insn &&
87 "Cached first special instruction is wrong!");
91 assert(It->second ==
nullptr &&
92 "Block is marked as having special instructions but in fact it has " 96 void InstructionPrecedenceTracking::validateAll()
const {
98 for (
auto &It : FirstSpecialInsts)
106 FirstSpecialInsts.erase(BB);
112 FirstSpecialInsts.erase(Inst->
getParent());
117 for (
auto It : FirstSpecialInsts)
119 FirstSpecialInsts.clear();
142 if (isa<LoadInst>(Insn)) {
144 "Non-volatile load should transfer execution to successor!");
147 if (isa<StoreInst>(Insn)) {
149 "Non-volatile store should transfer execution to successor!");
158 if (
match(Insn, m_Intrinsic<Intrinsic::experimental_widenable_condition>()))
This class represents lattice values for constants.
bool dominates(const Instruction *, const Instruction *) const
Return true if first instruction dominates the second.
bool mayWriteToMemory() const
Return true if this instruction may modify memory.
void clear()
Invalidates all information from this tracking.
bool match(Val *V, const Pattern &P)
bool hasSpecialInstructions(const BasicBlock *BB)
Returns true iff at least one instruction from the basic block BB is special.
static cl::opt< bool > ExpensiveAsserts("ipt-expensive-asserts", cl::desc("Perform expensive assert validation on every query to Instruction" " Precedence Tracking"), cl::init(false), cl::Hidden)
virtual bool isSpecialInstruction(const Instruction *Insn) const
A predicate that defines whether or not the instruction Insn is considered special and needs to be tr...
initializer< Ty > init(const Ty &Val)
bool isGuaranteedToTransferExecutionToSuccessor(const Instruction *I)
Return true if this function can prove that the instruction I will always transfer execution to one o...
LLVM Basic Block Representation.
virtual bool isSpecialInstruction(const Instruction *Insn) const
A predicate that defines whether or not the instruction Insn is considered special and needs to be tr...
void invalidateBlock(const BasicBlock *BB)
Invalidate the OrderedBasicBlock cache when its basic block changes.
const Instruction * getFirstSpecialInstruction(const BasicBlock *BB)
Returns the topmost special instruction from the block BB.
void insertInstructionTo(const Instruction *Inst, const BasicBlock *BB)
Notifies this tracking that we are going to insert a new instruction Inst to the basic block BB...
void removeInstruction(const Instruction *Inst)
Notifies this tracking that we are going to remove the instruction Inst It makes all necessary update...
bool isPreceededBySpecialInstruction(const Instruction *Insn)
Returns true iff the first special instruction of Insn's block exists and dominates Insn...
virtual bool isSpecialInstruction(const Instruction *Insn) const =0
A predicate that defines whether or not the instruction Insn is considered special and needs to be tr...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isVolatile(Instruction *Inst)
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
const BasicBlock * getParent() const