36 #define DEBUG_TYPE "wasm-cfg-stackify" 38 STATISTIC(NumUnwindMismatches,
"Number of EH pad unwind mismatches found");
42 StringRef getPassName()
const override {
return "WebAssembly CFG Stackify"; }
102 ~WebAssemblyCFGStackify()
override { releaseMemory(); }
103 void releaseMemory()
override;
109 "Insert BLOCK/LOOP/TRY markers for WebAssembly scopes",
false,
113 return new WebAssemblyCFGStackify();
125 if (MO.isMBB() && MO.getMBB() == MBB)
139 auto InsertPos = MBB->
end();
140 while (InsertPos != MBB->
begin()) {
141 if (BeforeSet.
count(&*std::prev(InsertPos))) {
144 for (
auto Pos = InsertPos,
E = MBB->
begin(); Pos !=
E; --Pos)
163 auto InsertPos = MBB->
begin();
164 while (InsertPos != MBB->
end()) {
165 if (AfterSet.
count(&*InsertPos)) {
168 for (
auto Pos = InsertPos,
E = MBB->
end(); Pos !=
E; ++Pos)
178 void WebAssemblyCFGStackify::registerScope(
MachineInstr *Begin,
180 BeginToEnd[Begin] = End;
181 EndToBegin[End] = Begin;
184 void WebAssemblyCFGStackify::registerTryScope(
MachineInstr *Begin,
187 registerScope(Begin, End);
188 TryToEHPad[Begin] = EHPad;
189 EHPadToTry[EHPad] = Begin;
192 void WebAssemblyCFGStackify::unregisterScope(
MachineInstr *Begin) {
196 BeginToEnd.
erase(Begin);
197 EndToBegin.
erase(End);
201 TryToEHPad.
erase(Begin);
202 EHPadToTry.
erase(EHPad);
212 auto &MDT = getAnalysis<MachineDominatorTree>();
220 bool IsBranchedTo =
false;
221 bool IsBrOnExn =
false;
225 if (Pred->getNumber() < MBBNumber) {
226 Header = Header ? MDT.findNearestCommonDominator(Header, Pred) : Pred;
229 if (Pred->getFirstTerminator()->getOpcode() == WebAssembly::BR_ON_EXN) {
231 assert(!BrOnExn &&
"There should be only one br_on_exn per block");
232 BrOnExn = &*Pred->getFirstTerminator();
242 assert(&MBB != &MF.
front() &&
"Header blocks shouldn't have predecessors");
249 if (ScopeTop->getNumber() > Header->getNumber()) {
251 I = std::next(ScopeTop->getIterator());
266 for (
const auto &
MI : *Header) {
271 auto *LoopBottom = BeginToEnd[&
MI]->getParent()->getPrevNode();
272 if (MBB.
getNumber() > LoopBottom->getNumber())
282 if (
MI.getOpcode() == WebAssembly::BLOCK ||
283 MI.getOpcode() == WebAssembly::TRY)
289 MI.getOpcode() == WebAssembly::END_LOOP ||
290 MI.getOpcode() == WebAssembly::END_TRY)
295 if (
MI.isTerminator())
300 for (
auto I = Header->getFirstTerminator(),
E = Header->begin();
I !=
E;
302 if (std::prev(
I)->isDebugInstr() || std::prev(
I)->isPosition())
305 AfterSet.
insert(&*std::prev(
I));
322 if (std::strcmp(TagName,
"__cpp_exception") != 0)
329 BuildMI(*Header, InsertPos, Header->findDebugLoc(InsertPos),
330 TII.get(WebAssembly::BLOCK))
331 .addImm(int64_t(ReturnType));
336 for (
auto &
MI : MBB) {
340 MI.getOpcode() == WebAssembly::TRY)
348 if (
MI.getOpcode() == WebAssembly::END_LOOP ||
349 MI.getOpcode() == WebAssembly::END_TRY) {
350 if (EndToBegin[&
MI]->
getParent()->getNumber() >= Header->getNumber())
363 registerScope(Begin, End);
366 int Number = MBB.getNumber();
367 if (!ScopeTops[Number] ||
368 ScopeTops[Number]->getNumber() > Header->getNumber())
369 ScopeTops[Number] = Header;
375 const auto &MLI = getAnalysis<MachineLoopInfo>();
386 if (Iter == MF.
end()) {
387 getAppendixBlock(MF);
395 for (
const auto &
MI : MBB) {
398 if (
MI.getOpcode() == WebAssembly::END_LOOP)
416 for (
const auto &
MI : MBB)
418 if (
MI.getOpcode() == WebAssembly::END_LOOP)
425 DebugLoc EndDL = AfterLoop->pred_empty()
427 : (*AfterLoop->pred_rbegin())->findBranchDebugLoc();
429 BuildMI(*AfterLoop, InsertPos, EndDL, TII.
get(WebAssembly::END_LOOP));
430 registerScope(Begin, End);
432 assert((!ScopeTops[AfterLoop->getNumber()] ||
433 ScopeTops[AfterLoop->getNumber()]->getNumber() < MBB.getNumber()) &&
434 "With block sorting the outermost loop for a block should be first.");
435 if (!ScopeTops[AfterLoop->getNumber()])
436 ScopeTops[AfterLoop->getNumber()] = &MBB;
442 auto &MDT = getAnalysis<MachineDominatorTree>();
444 const auto &WEI = getAnalysis<WebAssemblyExceptionInfo>();
451 if (Pred->getNumber() < MBBNumber) {
452 Header = Header ? MDT.findNearestCommonDominator(Header, Pred) : Pred;
454 "Explicit branch to an EH pad!");
467 if (Iter == MF.end()) {
468 getAppendixBlock(MF);
473 assert(Cont != &MF.front());
480 if (ScopeTop->getNumber() > Header->getNumber()) {
482 I = std::next(ScopeTop->getIterator());
497 for (
const auto &
MI : *Header) {
502 auto *LoopBottom = BeginToEnd[&
MI]->getParent()->getPrevNode();
503 if (MBB.
getNumber() > LoopBottom->getNumber())
513 if (
MI.getOpcode() == WebAssembly::BLOCK ||
514 MI.getOpcode() == WebAssembly::TRY)
520 MI.getOpcode() == WebAssembly::END_LOOP ||
521 MI.getOpcode() == WebAssembly::END_TRY)
526 if (
MI.isTerminator())
537 auto TermPos = Header->getFirstTerminator();
538 if (TermPos == Header->end() ||
539 TermPos->getOpcode() != WebAssembly::RETHROW) {
546 if (
MI.getIterator() != Header->begin() &&
547 std::prev(
MI.getIterator())->isEHLabel()) {
548 AfterSet.
insert(&*std::prev(
MI.getIterator()));
549 ThrowingCall = &*std::prev(
MI.getIterator());
564 : Header->getFirstTerminator();
565 for (
auto I = SearchStartPt,
E = Header->begin();
I !=
E; --
I) {
566 if (std::prev(
I)->isDebugInstr() || std::prev(
I)->isPosition())
569 AfterSet.
insert(&*std::prev(
I));
577 BuildMI(*Header, InsertPos, Header->findDebugLoc(InsertPos),
578 TII.get(WebAssembly::TRY))
584 for (
const auto &
MI : *Cont) {
588 MI.getOpcode() == WebAssembly::BLOCK)
593 if (
MI.getOpcode() == WebAssembly::END_TRY)
601 if (
MI.getOpcode() == WebAssembly::END_LOOP) {
604 if (EndToBegin[&
MI]->
getParent()->getNumber() > Header->getNumber())
619 TII.
get(WebAssembly::END_TRY));
620 registerTryScope(Begin, End, &MBB);
635 ScopeTops[
Number]->getNumber() > Header->getNumber())
636 ScopeTops[
Number] = Header;
640 void WebAssemblyCFGStackify::removeUnnecessaryInstrs(
MachineFunction &MF) {
655 for (
auto &MBB : MF) {
664 if (Analyzable && ((Cond.
empty() && TBB && TBB == Cont) ||
665 (!Cond.
empty() && FBB && FBB == Cont)))
681 for (
auto &MBB : MF) {
682 for (
auto &
MI : MBB) {
683 if (
MI.getOpcode() != WebAssembly::TRY)
690 for (
auto B = Try->
getIterator(),
E = std::next(EndTry->getIterator());
692 std::prev(
B)->getOpcode() == WebAssembly::BLOCK &&
694 std::prev(
B)->getOperand(0).getImm() == RetType;
701 for (
auto *
MI : ToDelete) {
702 if (
MI->getOpcode() == WebAssembly::BLOCK)
704 MI->eraseFromParent();
714 for (
auto &
MI : Split) {
715 for (
auto &MO :
MI.explicit_uses()) {
719 if (
Def->getParent() == &MBB)
725 bool WebAssemblyCFGStackify::fixUnwindMismatches(
MachineFunction &MF) {
861 using TryRange = std::pair<MachineInstr *, MachineInstr *>;
871 for (
auto &MBB :
reverse(MF)) {
872 bool SeenThrowableInstInBB =
false;
874 if (
MI.getOpcode() == WebAssembly::TRY)
876 else if (
MI.getOpcode() == WebAssembly::CATCH)
886 SeenThrowableInstInBB =
true;
892 if (Succ->isEHPad()) {
897 if (EHPadStack.
back() == UnwindDest)
901 UnwindDestToTryRanges[UnwindDest].push_back(TryRange(&
MI, &
MI));
911 bool NeedAppendixBlock =
false;
912 for (
auto &MBB :
reverse(MF)) {
913 MachineInstr *RangeBegin =
nullptr, *RangeEnd =
nullptr;
915 if (
MI.getOpcode() == WebAssembly::TRY)
917 else if (
MI.getOpcode() == WebAssembly::CATCH)
927 NeedAppendixBlock =
true;
930 UnwindDestToTryRanges[
nullptr].push_back(
931 TryRange(RangeBegin, RangeEnd));
932 RangeBegin = RangeEnd =
nullptr;
944 RangeBegin = RangeEnd = &
MI;
950 NeedAppendixBlock =
true;
953 UnwindDestToTryRanges[
nullptr].push_back(TryRange(RangeBegin, RangeEnd));
954 RangeBegin = RangeEnd =
nullptr;
960 if (UnwindDestToTryRanges.
empty())
966 if (NeedAppendixBlock) {
967 auto *AppendixBB = getAppendixBlock(MF);
968 Register ExnReg = MRI.createVirtualRegister(&WebAssembly::EXNREFRegClass);
972 for (
auto Range : UnwindDestToTryRanges[
nullptr])
973 BrDestToTryRanges[AppendixBB].push_back(Range);
974 BrDestToExnReg[AppendixBB] = ExnReg;
998 for (
auto &
P : UnwindDestToTryRanges) {
999 NumUnwindMismatches +=
P.second.size();
1014 unsigned ExnReg = 0;
1015 for (
auto &
MI : *EHPad) {
1016 switch (
MI.getOpcode()) {
1017 case WebAssembly::CATCH:
1023 assert(Catch &&
"EH pad does not have a catch");
1024 assert(ExnReg != 0 &&
"Invalid register");
1034 MF.
insert(std::next(EHPad->getIterator()), BrDest);
1038 BrDest->splice(BrDest->end(), EHPad, SplitPos, EHPad->end());
1041 BrDest->transferSuccessors(EHPad);
1042 EHPad->addSuccessor(BrDest);
1046 for (
auto Range : UnwindDestToTryRanges[EHPad])
1047 BrDestToTryRanges[BrDest].push_back(Range);
1048 BrDestToExnReg[BrDest] = ExnReg;
1073 if (Analyzable && !TBB && !FBB) {
1076 : EHPadLayoutPred->
rbegin()->getDebugLoc();
1103 for (
auto &
P : BrDestToTryRanges) {
1105 auto &TryRanges =
P.second;
1106 unsigned ExnReg = BrDestToExnReg[BrDest];
1108 for (
auto Range : TryRanges) {
1109 MachineInstr *RangeBegin =
nullptr, *RangeEnd =
nullptr;
1110 std::tie(RangeBegin, RangeEnd) = Range;
1115 std::prev(RangeBegin->
getIterator())->isEHLabel())
1116 RangeBegin = &*std::prev(RangeBegin->
getIterator());
1117 if (std::next(RangeEnd->getIterator()) != MBB->
end() &&
1118 std::next(RangeEnd->getIterator())->isEHLabel())
1119 RangeEnd = &*std::next(RangeEnd->getIterator());
1123 if (Succ->isEHPad()) {
1132 TII.get(WebAssembly::TRY))
1138 NestedEHPad->setIsEHPad();
1139 NestedEHPad->setIsEHScopeEntry();
1140 BuildMI(NestedEHPad, RangeEnd->getDebugLoc(),
TII.get(WebAssembly::CATCH),
1147 MF.
insert(std::next(NestedEHPad->getIterator()), NestedCont);
1149 BuildMI(*NestedCont, NestedCont->
begin(), RangeEnd->getDebugLoc(),
1150 TII.get(WebAssembly::END_TRY));
1153 NestedCont->
splice(NestedCont->
end(), MBB,
1154 std::next(RangeEnd->getIterator()), MBB->
end());
1156 registerTryScope(NestedTry, NestedEndTry, NestedEHPad);
1164 NestedEHPad->addSuccessor(BrDest);
1173 for (
auto &MBB :
reverse(MF)) {
1177 switch (
MI.getOpcode()) {
1179 case WebAssembly::END_LOOP:
1180 case WebAssembly::END_TRY:
1181 ScopeTops[MBB.
getNumber()] = EndToBegin[&
MI]->getParent();
1183 case WebAssembly::CATCH:
1184 ScopeTops[MBB.
getNumber()] = EHPadToTry[&MBB]->getParent();
1191 getAnalysis<MachineDominatorTree>().runOnMachineFunction(MF);
1195 for (
auto &
P : BrDestToTryRanges)
1203 for (
auto *Dest : BrDests)
1204 placeBlockMarker(*Dest);
1218 assert(Depth < Stack.
size() &&
"Branch destination should be in scope");
1229 void WebAssemblyCFGStackify::fixEndsAtEndOfFunction(
MachineFunction &MF) {
1232 if (MFI.getResults().empty())
1245 if (
MI.isPosition() ||
MI.isDebugInstr())
1247 switch (
MI.getOpcode()) {
1249 case WebAssembly::END_LOOP:
1250 case WebAssembly::END_TRY:
1251 EndToBegin[&
MI]->getOperand(0).setImm(int32_t(RetType));
1267 TII.get(WebAssembly::END_FUNCTION));
1276 for (
auto &MBB : MF)
1277 placeLoopMarker(MBB);
1279 const MCAsmInfo *MCAI = MF.getTarget().getMCAsmInfo();
1280 for (
auto &MBB : MF) {
1284 MF.getFunction().hasPersonalityFn())
1285 placeTryMarker(MBB);
1288 placeBlockMarker(MBB);
1293 MF.getFunction().hasPersonalityFn())
1294 fixUnwindMismatches(MF);
1297 void WebAssemblyCFGStackify::rewriteDepthImmediates(
MachineFunction &MF) {
1300 for (
auto &MBB :
reverse(MF)) {
1304 case WebAssembly::BLOCK:
1305 case WebAssembly::TRY:
1306 assert(ScopeTops[Stack.
back()->getNumber()]->getNumber() <=
1308 "Block/try marker should be balanced");
1313 assert(Stack.
back() == &MBB &&
"Loop top should be balanced");
1318 case WebAssembly::END_TRY:
1322 case WebAssembly::END_LOOP:
1332 for (
auto MO : Ops) {
1342 assert(Stack.
empty() &&
"Control flow should be balanced");
1345 void WebAssemblyCFGStackify::releaseMemory() {
1351 AppendixBB =
nullptr;
1354 bool WebAssemblyCFGStackify::runOnMachineFunction(
MachineFunction &MF) {
1356 "********** Function: " 1371 removeUnnecessaryInstrs(MF);
1374 rewriteDepthImmediates(MF);
1378 fixEndsAtEndOfFunction(MF);
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
DILocation * get() const
Get the underlying DILocation.
static void appendEndToFunction(MachineFunction &MF, const WebAssemblyInstrInfo &TII)
This class represents lattice values for constants.
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them...
bool isMarker(unsigned Opc)
static bool explicitlyBranchesTo(MachineBasicBlock *Pred, MachineBasicBlock *MBB)
Test whether Pred has any terminators explicitly branching to MBB, as opposed to falling through...
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
void push_back(const T &Elt)
bool mayThrow(const MachineInstr &MI)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
void transferSuccessors(MachineBasicBlock *FromMBB)
Transfers all the successors from MBB to this machine basic block (i.e., copies all the successors Fr...
STATISTIC(NumFunctions, "Total number of functions")
iterator_range< mop_iterator > operands()
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
iterator_range< succ_iterator > successors()
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Analyze the branching code at the end of MBB, returning true if it cannot be understood (e...
AnalysisUsage & addRequired()
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
unsigned getNumOperands() const
Retuns the total number of operands.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isTerminator(QueryType Type=AnyInBundle) const
Returns true if this instruction part of the terminator for a basic block.
bool hasEHPadSuccessor() const
iterator_range< iterator > terminators()
static void unstackifyVRegsUsedInSplitBB(MachineBasicBlock &MBB, MachineBasicBlock &Split, WebAssemblyFunctionInfo &MFI, MachineRegisterInfo &MRI)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const char * getSymbolName() const
BlockT * getHeader() const
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
DebugLoc findPrevDebugLoc(instr_iterator MBBI)
Find the previous valid DebugLoc preceding MBBI, skipping and DBG_VALUE instructions.
static MachineBasicBlock::iterator getEarliestInsertPos(MachineBasicBlock *MBB, const SmallPtrSet< const MachineInstr *, 4 > &BeforeSet, const SmallPtrSet< const MachineInstr *, 4 > &AfterSet)
bool hasPersonalityFn() const
Check whether this function has a personality function.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
This file implements WebAssemblyException information analysis.
INITIALIZE_PASS(WebAssemblyCFGStackify, DEBUG_TYPE, "Insert BLOCK/LOOP/TRY markers for WebAssembly scopes", false, false) FunctionPass *llvm
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
wasm::ValType toValType(const MVT &Ty)
reverse_iterator rbegin()
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
WebAssembly Exception Handling.
This class is intended to be used as a base class for asm properties and features specific to the tar...
This file contains the declaration of the WebAssembly-specific utility functions. ...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
MachineInstrBundleIterator< MachineInstr > iterator
bool erase(const KeyT &Val)
Control flow instructions. These all have token chains.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const Triple & getTargetTriple() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
bool isPredecessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a predecessor of this block.
Represent the analysis usage information of a pass.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
FunctionPass class - This class is used to implement most global optimizations.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
self_iterator getIterator()
iterator_range< pred_iterator > predecessors()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void sort(IteratorTy Start, IteratorTy End)
This file declares the WebAssembly-specific subclass of TargetSubtarget.
Iterator for intrusive lists based on ilist_node.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static unsigned getDepth(const SmallVectorImpl< const MachineBasicBlock *> &Stack, const MachineBasicBlock *MBB)
void unstackifyVReg(unsigned VReg)
void invalidateLiveness()
invalidateLiveness - Indicates that register liveness is no longer being tracked accurately.
MachineInstr * getUniqueVRegDef(unsigned Reg) const
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or nul...
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Remove the branching code at the end of the specific MBB.
DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
void splice(iterator Where, MachineBasicBlock *Other, iterator From)
Take an instruction from MBB 'Other' at the position From, and insert it into this MBB right before '...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool isEHPad() const
Returns true if the block is a landing pad.
LLVM_NODISCARD bool empty() const
Represents a single loop in the control flow graph.
static MachineOperand CreateImm(int64_t Val)
BlockType
Used as immediate MachineOperands for block signatures.
This file declares WebAssembly-specific per-machine-function information.
const MachineBasicBlock & back() const
const std::vector< MVT > & getResults() const
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
MachineInstr * removeFromParent()
Unlink 'this' from the containing basic block, and return it without deleting it. ...
void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
LLVM_NODISCARD bool empty() const
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
FunctionPass * createWebAssemblyCFGStackify()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void insert(iterator MBBI, MachineBasicBlock *MBB)
static MachineBasicBlock::iterator getLatestInsertPos(MachineBasicBlock *MBB, const SmallPtrSet< const MachineInstr *, 4 > &BeforeSet, const SmallPtrSet< const MachineInstr *, 4 > &AfterSet)
MachineBasicBlock * getBottom(const T *Unit)
Return the "bottom" block of an entity, which can be either a MachineLoop or WebAssemblyException.
void push_back(MachineBasicBlock *MBB)
static const Function * getParent(const Value *V)
ExceptionHandling getExceptionHandlingType() const
StringRef - Represent a constant reference to a string, i.e.
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Register getReg() const
getReg - Returns the register number.
bool isChild(const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI)
Test whether MI is a child of some other node in an expression tree.
const MachineOperand & getOperand(unsigned i) const
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Wrapper class representing virtual and physical registers.