Keep SwitchInst branch‐weight metadata in sync when editing cases.
Synopsis
Declared in <llvm/IR/Instructions.h>
class SwitchInstProfUpdateWrapper;
Description
A wrapper class to simplify modification of SwitchInst cases along with their prof branch_weights metadata.
Type Aliases
Name |
Description |
Optional profile weight for one switch successor. |
Member Functions
Name |
Description |
|
Construct a wrapper that keeps branch weights in sync for |
|
Write updated branch weights back to the switch if needed. |
Add case |
|
Delegate eraseFromParent to the wrapped switch and skip destructor updates. |
|
Return the profile weight of successor |
|
Return a reference to the wrapped switch instruction. |
|
Return a pointer to the wrapped switch instruction. |
|
Remove case |
|
Replace the default destination with the case referenced by |
|
Set the profile weight of successor |
|
Convert to a pointer to the wrapped switch instruction. |
Static Member Functions
Name |
Description |
Return the profile weight of successor |