Return an iterator to the last non‐debug instruction, or end().
Synopsis
Declared in <llvm/CodeGen/MachineBasicBlock.h>
iterator
getLastNonDebugInstr(bool SkipPseudoOp = true);
Description
Skip any pseudo operation if SkipPseudoOp is true. Pseudo probes are like debug instructions which do not turn into real machine code. We try to use the function to skip both debug instructions and pseudo probe operations to avoid API proliferation. This should work most of the time when considering optimizing the rest of code in the block, except for certain cases where pseudo probes are designed to block the optimizations. For example, code merge like optimizations are supposed to be blocked by pseudo probes for better AutoFDO profile quality. Therefore, they should be considered as a valid instruction when this function is called in a context of such optimizations. On the other hand, SkipPseudoOp should be true when it's used in optimizations that unlikely hurt profile quality, e.g., without block merging. The default value of SkipPseudoOp is set to true to maximize code quality in general, with an explict false value passed in in a few places like branch folding and if‐conversion to favor profile quality.
Return Value
An iterator to the last non‐debug instruction, or end().
Parameters
Name |
Description |
SkipPseudoOp |
If true, also skip pseudo‐probe instructions. |
Created with MrDocs