LLVM 19.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::BasicBlockInfo Struct Reference

BasicBlockInfo - Information about the offset and size of a single basic block. More...

#include "Target/ARM/ARMBasicBlockInfo.h"

Public Member Functions

 BasicBlockInfo ()=default
 
unsigned internalKnownBits () const
 Compute the number of known offset bits internally to this block.
 
unsigned postOffset (Align Alignment=Align(1)) const
 Compute the offset immediately following this block.
 
unsigned postKnownBits (Align Align=llvm::Align(1)) const
 Compute the number of known low bits of postOffset.
 

Public Attributes

unsigned Offset = 0
 Offset - Distance from the beginning of the function to the beginning of this basic block.
 
unsigned Size = 0
 Size - Size of the basic block in bytes.
 
uint8_t KnownBits = 0
 KnownBits - The number of low bits in Offset that are known to be exact.
 
uint8_t Unalign = 0
 Unalign - When non-zero, the block contains instructions (inline asm) of unknown size.
 
Align PostAlign
 PostAlign - When > 1, the block terminator contains a .align directive, so the end of the block is aligned to PostAlign bytes.
 

Detailed Description

BasicBlockInfo - Information about the offset and size of a single basic block.

Definition at line 41 of file ARMBasicBlockInfo.h.

Constructor & Destructor Documentation

◆ BasicBlockInfo()

llvm::BasicBlockInfo::BasicBlockInfo ( )
default

Member Function Documentation

◆ internalKnownBits()

unsigned llvm::BasicBlockInfo::internalKnownBits ( ) const
inline

Compute the number of known offset bits internally to this block.

This number should be used to predict worst case padding when splitting the block.

Definition at line 78 of file ARMBasicBlockInfo.h.

References llvm::countr_zero(), KnownBits, Size, and Unalign.

Referenced by postKnownBits(), and postOffset().

◆ postKnownBits()

unsigned llvm::BasicBlockInfo::postKnownBits ( Align  Align = llvm::Align(1)) const
inline

Compute the number of known low bits of postOffset.

If this block contains inline asm, the number of known bits drops to the instruction alignment. An aligned terminator may increase the number of know bits. If LogAlign is given, also consider the alignment of the next block.

Definition at line 104 of file ARMBasicBlockInfo.h.

References internalKnownBits(), llvm::Log2(), and PostAlign.

◆ postOffset()

unsigned llvm::BasicBlockInfo::postOffset ( Align  Alignment = Align(1)) const
inline

Compute the offset immediately following this block.

If Align is specified, return the offset the successor block will get if it has this alignment.

Definition at line 90 of file ARMBasicBlockInfo.h.

References internalKnownBits(), Offset, PostAlign, Size, and llvm::UnknownPadding().

Member Data Documentation

◆ KnownBits

uint8_t llvm::BasicBlockInfo::KnownBits = 0

KnownBits - The number of low bits in Offset that are known to be exact.

The remaining bits of Offset are an upper bound.

Definition at line 62 of file ARMBasicBlockInfo.h.

Referenced by internalKnownBits().

◆ Offset

unsigned llvm::BasicBlockInfo::Offset = 0

Offset - Distance from the beginning of the function to the beginning of this basic block.

Offsets are computed assuming worst case padding before an aligned block. This means that subtracting basic block offsets always gives a conservative estimate of the real distance which may be smaller.

Because worst case padding is used, the computed offset of an aligned block may not actually be aligned.

Definition at line 51 of file ARMBasicBlockInfo.h.

Referenced by postOffset().

◆ PostAlign

Align llvm::BasicBlockInfo::PostAlign

PostAlign - When > 1, the block terminator contains a .align directive, so the end of the block is aligned to PostAlign bytes.

Definition at line 71 of file ARMBasicBlockInfo.h.

Referenced by llvm::ARMBasicBlockUtils::computeBlockSize(), postKnownBits(), and postOffset().

◆ Size

unsigned llvm::BasicBlockInfo::Size = 0

Size - Size of the basic block in bytes.

If the block contains inline assembly, this is a worst case estimate.

The size does not include any alignment padding whether from the beginning of the block, or from an aligned jump table at the end.

Definition at line 58 of file ARMBasicBlockInfo.h.

Referenced by llvm::ARMBasicBlockUtils::computeBlockSize(), internalKnownBits(), and postOffset().

◆ Unalign

uint8_t llvm::BasicBlockInfo::Unalign = 0

Unalign - When non-zero, the block contains instructions (inline asm) of unknown size.

The real size may be smaller than Size bytes by a multiple of 1 << Unalign.

Definition at line 67 of file ARMBasicBlockInfo.h.

Referenced by llvm::ARMBasicBlockUtils::computeBlockSize(), and internalKnownBits().


The documentation for this struct was generated from the following file: