BasicBlock.xcc

Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechin@st.com).

Copyright 2002 - 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

BasicBlock_Factory— IndexedFactory for BasicBlock(s).
extern IndexedFactory_ BasicBlock_Factory[1];
BasicBlockEdgeFlag— Enumerate BasicBlockEdge flags.
BasicBlockEdge— Control flow edge between two BasicBlock(s).
struct BasicBlockEdge_ {
  //@args       struct BasicBlock_ *origBlock, struct BasicBlock_ *destBlock, float probability
  struct BasicBlock_ *ORIGBLOCK;        // Origin BasicBlock of this BasicBlockEdge.
  struct BasicBlock_ *DESTBLOCK;        // Destination BasicBlock of this BasicBlockEdge.
  struct BasicBlockEdge_ *ENTERNEXT;    // Next BasicBlockEdge in destBlock ENTERFIRST.
  float PROBABILITY;                    // Probability to execute this BasicBlockEdge.
  int32_t INDEX;                        // Index of this BasicBlockEdge (user-defined).
  bool ISLOOP;                          // This BasicBlockEdge is Looping (LoopForest).
  bool ISJOIN;                          // This BasicBlockEdge is Joining (Dominance).
  bool ISBACK;                          // This BasicBlockEdge is back (CFG DFS).
  int8_t ELAPSED;                       // Cycles elapsed along this BasicBlockEdge.
  int32_t ARGINDEX;                     // Index for use by PHI arguments.
  int32_t RESINDEX;                     // Index for use by SIGMA results.
};
BasicBlockEdge_origBlock— BasicBlock this BasicBlockEdge leaves.
static inline struct BasicBlock_*
BasicBlockEdge_origBlock(BasicBlockEdge this)
{
  return BasicBlockEdge_ORIGBLOCK(this);
}
BasicBlockEdge_destBlock— BasicBlock this BasicBlockEdge enters.
static inline struct BasicBlock_*
BasicBlockEdge_destBlock(BasicBlockEdge this)
{
  return BasicBlockEdge_DESTBLOCK(this);
}
BasicBlockEdge_probability— Successor probability
static inline float
BasicBlockEdge_probability(BasicBlockEdge this)
{
  return BasicBlockEdge_PROBABILITY(this);
}
BasicBlockFlag— Enumerates the BasicBlock flags.
typedef enum {
  BasicBlockFlag_Entry = 0x1,           // BasicBlock is Procedure entry.
  BasicBlockFlag_Exit = 0x2,            // BasicBlock is Procedure exit.
  BasicBlockFlag_Start = 0x4,           // BasicBlock is CodeTrace start.
  BasicBlockFlag_GNUASM = 0x8,          // BasicBlock has GNU ASM operation
  BasicBlockFlag_Natural = 0x10,        // BasicBlock is a natural loop header.
  BasicBlockFlag_Widening = 0x20,       // BasicBlock is a forward widening point.
  BasicBlockFlag_Scheduled = 0x40,      // BasicBlock is instruction scheduled.
  BasicBlockFlag_Allocated = 0x80,      // BasicBlock is register allocated.
} enum_BasicBlockFlag;
typedef uint8_t BasicBlockFlags;
BasicBlockUnion_— Union for the variant part of BasicBlock.
union BasicBlockUnion_ {
  void *POINTER;                        // Client pointer.
  struct BasicBlockEdge_ **ENTEREDGES;  // The edges entering this BasicBlock in SSAForm.
  struct BasicBlock_ *CHAINNEXT;        // The next BasicBlock in chain in block layout.
  struct NativeBlock_ *NATIVEBLOCK;     // The associated NativeBlock.
  struct CFGNode_ *CFGNODE;             // The CFGNode of this BasicBlock (deprecated).
};
typedef union BasicBlockUnion_ BasicBlockUnion_, *BasicBlockUnion;
BasicBlock— Basic block of Operations.

A BasicBlock contains one control-flow operation at most, which must be last. This operation satisfies Operator_isControl(Operation_OPERATOR(operation)).

struct BasicBlock_ {
  //@args       Memory memory, void *procedure, Processor processor,
  //@args       struct CodeRegion_ *codeRegion, float frequency
  Indexed_ __;                          // A BasicBlock_ ISA Indexed_.
  //@access IDENTITY    Indexed_IDENTITY(BasicBlock____(this))
  //@access INDEX       Indexed_INDEX(BasicBlock____(this))
  //@mutate INDEX       Indexed__INDEX(BasicBlock____(this))
  Selector_ SELECTOR[1];                // Selector of this BasicBlock.
  //@access OPERATIONS  Selector_OPERATIONS(BasicBlock_SELECTOR(this))
  //@access PROCEDURE   Selector_PROCEDURE(BasicBlock_SELECTOR(this))
  //@access PROCESSOR   Selector_PROCESSOR(BasicBlock_SELECTOR(this))
  //@mutate PROCESSOR   Selector__PROCESSOR(BasicBlock_SELECTOR(this))
  //@access PHICOUNT    Selector_PHICOUNT(BasicBlock_SELECTOR(this))
  //@access MEMORY      Selector_MEMORY(BasicBlock_SELECTOR(this))
  IDList_ LEAVEEDGES[1];                // The edges leaving this BasicBlock.
  //@access LEAVECOUNT  IDList_count(BasicBlock_LEAVEEDGES(this))
  //@access LEAVEFIRST  IDList_firstItem(BasicBlock_LEAVEEDGES(this))
  struct BasicBlockEdge_ *ENTERFIRST;   // Start of BasicBlockEdge_ENTERNEXT list.
  int32_t ENTERCOUNT;                   // Count of entering BasicBlockEdge(s).
  int32_t FIRSTORDERING;                // ORDERING of Label and Phi Operation(s).
  int32_t EARLYORDERING;                // ORDERING of early COPY Operation(s).
  int32_t LATEORDERING;                 // ORDERING of late COPY Operation(s).
  int32_t LASTORDERING;                 // ORDERING of Control and Sigma Operation(s).
  struct CodeRegion_ *CODEREGION;       // This BasicBlock CodeRegion.
  struct LoopScope_ *LOOPSCOPE;         // LoopScope of this BasicBlock.
  intptr_t TRACEID;                     // TraceID also used to sort the BasicBlock(s).
  float FREQUENCY;                      // Execution frequency of this BasicBlock.
  BasicBlockUnion_ UNION_;
  //@access POINTER     (BasicBlock_UNION_(this).POINTER)
  //@mutate POINTER     (&BasicBlock_UNION_(this).POINTER)
  //@access ENTEREDGES  (BasicBlock_UNION_(this).ENTEREDGES)
  //@mutate ENTEREDGES  (&BasicBlock_UNION_(this).ENTEREDGES)
  //@access CHAINNEXT   (BasicBlock_UNION_(this).CHAINNEXT)
  //@mutate CHAINNEXT   (&BasicBlock_UNION_(this).CHAINNEXT)
  //@access NATIVEBLOCK (BasicBlock_UNION_(this).NATIVEBLOCK)
  //@mutate NATIVEBLOCK (&BasicBlock_UNION_(this).NATIVEBLOCK)
  //@access CFGNODE     (BasicBlock_UNION_(this).CFGNODE)
  //@mutate CFGNODE     (&BasicBlock_UNION_(this).CFGNODE)
  uint16_t UNROLLED;                    // BasicBlock iteration after unrolling.
  BasicBlockFlags FLAGS;                // This BasicBlock flags.
  //@access isEntry     ((BasicBlock_flags(this) & BasicBlockFlag_Entry) != 0)
  //@access isExit      ((BasicBlock_flags(this) & BasicBlockFlag_Exit) != 0)
  //@access isStart     ((BasicBlock_flags(this) & BasicBlockFlag_Start) != 0)
  //@access hasGNUASM   ((BasicBlock_flags(this) & BasicBlockFlag_GNUASM) != 0)
  //@access isNatural   ((BasicBlock_flags(this) & BasicBlockFlag_Natural) != 0)
  //@access isWidening  ((BasicBlock_flags(this) & BasicBlockFlag_Widening) != 0)
  //@access isScheduled ((BasicBlock_flags(this) & BasicBlockFlag_Scheduled) != 0)
  //@access isAllocated ((BasicBlock_flags(this) & BasicBlockFlag_Allocated) != 0)
  int8_t MARK;                          // For use by clients, must be cleared after use.
  uint16_t PADDING;                     // NOP padding at the end of this BasicBlock.
  int16_t LABELCOUNT;                   // Count of Label(s) for this BasicBlock.
  LabelVariant_ LABELVARIANT[1];        // Label(s) for this BasicBlock.
  Label LITERALSLABEL;                  // This BasicBlock literals label.
  IDList_ LITERALS[1];                  // This BasicBlock literals.
  //@access LITERALSCOUNT       IDList_count(BasicBlock_LITERALS(this))
};
BasicBlock_next— The next BasicBlock in Procedure.
static inline BasicBlock
BasicBlock_next(const_BasicBlock this)
{
  return (BasicBlock)IDListItem_NEXT(this);
}
BasicBlock_prev— The previous BasicBlock in Procedure.
static inline BasicBlock
BasicBlock_prev(const_BasicBlock this)
{
  return (BasicBlock)IDListItem_PREV(this);
}
BasicBlock_processor— the Processor of this BasicBlock.
static inline Processor
BasicBlock_processor(const_BasicBlock this)
{
  return BasicBlock_PROCESSOR(this);
}
BasicBlock_phiCount— This BasicBlock count of PHI-Operations.
static inline int
BasicBlock_phiCount(BasicBlock this)
{
  return BasicBlock_PHICOUNT(this);
}
BasicBlock_selector— the Selector of this BasicBlock.
static inline Selector
BasicBlock_selector(BasicBlock this)
{
  return BasicBlock_SELECTOR(this);
}
BasicBlock_operations— For use by BasicBlock_FOREACH_Operation.
static inline const_IDList
BasicBlock_operations(const_BasicBlock this)
{
  return BasicBlock_OPERATIONS(this);
}
BasicBlock_FOREACH_Operation— Iterate from first to last operation in this BasicBlock.
#define BasicBlock_FOREACH_Operation(this, operation) \
  IDList_FOREACH(BasicBlock_operations(this), Operation_, operation)
#define BasicBlock_FOREACH_Operation_SYNC IDList_FOREACH_SYNC
#define BasicBlock_ENDEACH_Operation \
  IDList_ENDEACH;
BasicBlock_FORBACK_Operation— Iterate from last to first operation in this BasicBlock.
#define BasicBlock_FORBACK_Operation(this, operation) \
  IDList_FORBACK(BasicBlock_operations(this), Operation_, operation)
#define BasicBlock_FORBACK_Operation_SYNC IDList_FORBACK_SYNC
#define BasicBlock_ENDBACK_Operation \
  IDList_ENDBACK;
BasicBlock_leaveEdges— For use by BasicBlock_LEAVE_FOREACH_BasicBlockEdge.
static inline const_IDList
BasicBlock_leaveEdges(const_BasicBlock this)
{
  return BasicBlock_LEAVEEDGES(this);
}
BasicBlock_LEAVE_FOREACH_BasicBlockEdge— Iterate the leaving BasicBlockEdge(s)
#define BasicBlock_LEAVE_FOREACH_BasicBlockEdge(this, edge) \
  IDList_FOREACH(BasicBlock_leaveEdges(this), BasicBlockEdge_, edge)
#define BasicBlock_LEAVE_ENDEACH_BasicBlockEdge \
  IDList_ENDEACH;
BasicBlock_LEAVE_FORBACK_BasicBlockEdge— Iterate from last to first leaving BasicBlockEdge.
#define BasicBlock_LEAVE_FORBACK_BasicBlockEdge(this, edge) \
  IDList_FORBACK(BasicBlock_leaveEdges(this), BasicBlockEdge_, edge)
#define BasicBlock_LEAVE_ENDBACK_BasicBlockEdge \
  IDList_ENDBACK;
BasicBlock_leaveCount— Count of leaveEdges of this BasicBlock.
static inline int32_t
BasicBlock_leaveCount(const_BasicBlock this)
{
  return BasicBlock_LEAVECOUNT(this);
}
BasicBlock_leaveFirst— First leaveEdge of this BasicBlock.
static inline struct BasicBlockEdge_ *
BasicBlock_leaveFirst(const_BasicBlock this)
{
  return BasicBlock_LEAVEFIRST(this);
}
BasicBlock_enterCount— Count of enterEdges of this BasicBlock.
static inline int32_t
BasicBlock_enterCount(const_BasicBlock this)
{
  return BasicBlock_ENTERCOUNT(this);
}
BasicBlock_enterFirst— For use by BasicBlock_ENTER_FOREACH_BasicBlockEdge
static inline struct BasicBlockEdge_ *
BasicBlock_enterFirst(const_BasicBlock this)
{
  return BasicBlock_ENTERFIRST(this);
}
BasicBlock_ENTER_FOREACH_BasicBlockEdge— Iterate the entering BasicBlockEdge(s)
#define BasicBlock_ENTER_FOREACH_BasicBlockEdge(this, edge) { \
  struct BasicBlockEdge_ *BasicBlock_ENTERNEXT = NULL; \
  struct BasicBlockEdge_ *edge = BasicBlock_enterFirst(this); \
  for (; edge != NULL; edge = BasicBlock_ENTERNEXT) { \
    BasicBlock_ENTERNEXT = BasicBlockEdge_ENTERNEXT(edge);
#define BasicBlock_ENTER_ENDEACH_BasicBlockEdge \
  } \
}
BasicBlock_identity— Identity of this BasicBlock.
static inline uint32_t
BasicBlock_identity(const_BasicBlock this)
{
  return BasicBlock_IDENTITY(this);
}
BasicBlock_index— Index of this BasicBlock within its CodeRegion.
static inline int32_t
BasicBlock_index(const_BasicBlock this)
{
  return BasicBlock_INDEX(this);
}
BasicBlock_codeRegion— This BasicBlock CodeRegion.
static inline struct CodeRegion_ *
BasicBlock_codeRegion(const_BasicBlock this)
{
  return BasicBlock_CODEREGION(this);
}
BasicBlock_regionId— This BasicBlock regionId.
intptr_t
BasicBlock_regionId(const_BasicBlock this);
BasicBlock_loopScope— This BasicBlock LoopScope.
static inline struct LoopScope_ *
BasicBlock_loopScope(const_BasicBlock this)
{
  return BasicBlock_LOOPSCOPE(this);
}
BasicBlock_setLoopScope— Set this BasicBlock LoopScope.
static inline void
BasicBlock_setLoopScope(BasicBlock this, struct LoopScope_ *loopScope)
{
  *BasicBlock__LOOPSCOPE(this) = loopScope;
}
BasicBlock_traceId— TraceId of this BasicBlock.
static inline intptr_t
BasicBlock_traceId(const_BasicBlock this)
{
  return BasicBlock_TRACEID(this);
}
BasicBlock_setTraceId— Set the traceId of this BasicBlock.
static inline void
BasicBlock_setTraceId(BasicBlock this, intptr_t traceId)
{
  *BasicBlock__TRACEID(this) = traceId;
}
BasicBlock_frequency— This BasicBlock frequency.
static inline float
BasicBlock_frequency(const_BasicBlock this)
{
  return BasicBlock_FREQUENCY(this);
}
BasicBlock_setFrequency— Set this BasicBlock frequency.
static inline void
BasicBlock_setFrequency(BasicBlock this, float frequency)
{
  *BasicBlock__FREQUENCY(this) = frequency;
}
BasicBlock_procedure— This BasicBlock Procedure.
static inline struct Procedure_ *
BasicBlock_procedure(const_BasicBlock this)
{
  return BasicBlock_PROCEDURE(this);
}
BasicBlock_nativeBlock— This BasicBlock NativeBlock.
static inline NativeBlock
BasicBlock_nativeBlock(const_BasicBlock this)
{
  return BasicBlock_NATIVEBLOCK(this);
}
BasicBlock_cfgNode— This BasicBlock CFGNode.
static inline struct CFGNode_ *
BasicBlock_cfgNode(const_BasicBlock this)
{
  return BasicBlock_CFGNODE(this);
}
BasicBlock_setCFGNode— Set this BasicBlock CFGNode.
static inline void
BasicBlock_setCFGNode(BasicBlock this, struct CFGNode_ *cfgNode)
{
  *BasicBlock__CFGNODE(this) = cfgNode;
}
BasicBlock_makeEdge— Make a successor BasicBlockEdge for this BasicBlock.
Require
this BasicBlock is already chained to the next in the Procedure.
Ensure
the first BasicBlockEdge is fall-through if any.
BasicBlockEdge
BasicBlock_makeEdge(BasicBlock this, BasicBlock that, float probability);
BasicBlock_killEdge— Kill a successor BasicBlockEdge of this BasicBlock.
void
BasicBlock_killEdge(BasicBlock this, BasicBlockEdge edge);
BasicBlock_getTargetEdge— Get the target BasicBlockEdge of this basic block.
Return
NULL if the target BasicBlockEdge does not exist.
BasicBlockEdge
BasicBlock_getTargetEdge(const_BasicBlock this);
BasicBlock_getDefaultEdge— Get the default BasicBlockEdge of this BasicBlock.
Return
NULL if default BasicBlockEdge does not exist.
BasicBlockEdge
BasicBlock_getDefaultEdge(const_BasicBlock this);
BasicBlock_getFallEdge— Get the fall-through BasicBlockEdge of this BasicBlock.
Return
NULL if the fall-through BasicBlockEdge does not exist.
BasicBlockEdge
BasicBlock_getFallEdge(const_BasicBlock this);
BasicBlock_makeEnterEdges— Fill this BasicBlock ENTEREDGES array.

For use by SSAForm only.

void
BasicBlock_makeEnterEdges(BasicBlock this, Memory memory, bool sort);
BasicBlock_killEnterEdges— Kill this BasicBlock ENTEREDGES array.

For use by SSAForm only.

static inline void
BasicBlock_killEnterEdges(BasicBlock this, Memory memory)
{
#ifndef ECL_NDTOR
  Memory_free(memory, BasicBlock_ENTEREDGES(this));
#endif//ECL_NDTOR
  *BasicBlock__ENTEREDGES(this) = NULL;
}
BasicBlock_getPhiEnterEdge— Get the BasicBlockEdge corresponding to a PHI argument.
static inline BasicBlockEdge
BasicBlock_getPhiEnterEdge(const_BasicBlock this, int32_t argIndex)
{
  BasicBlockEdge *enterEdges = BasicBlock_ENTEREDGES(this);
  Except_CHECK(argIndex >= 0 && argIndex < BasicBlock_ENTERCOUNT(this));
  return enterEdges[argIndex];
}
BasicBlock_liveInSet— The live-in for this BasicBlock.
TemporarySet
BasicBlock_liveInSet(const_BasicBlock this);
#define BasicBlock_isLiveIn(this, temporary) \
  TemporarySet_contains(BasicBlock_liveInSet(this), temporary)
BasicBlock_phiInSet— The phi-in for this BasicBlock.
TemporarySet
BasicBlock_phiInSet(const_BasicBlock this);
#define BasicBlock_isPhiIn(this, temporary) \
  TemporarySet_contains(BasicBlock_phiInSet(this), temporary)
BasicBlock_liveOutSet— The live-out for this BasicBlock.
TemporarySet
BasicBlock_liveOutSet(const_BasicBlock this);
#define BasicBlock_isLiveOut(this, temporary) \
  TemporarySet_contains(BasicBlock_liveOutSet(this), temporary)
BasicBlock_phiOutSet— The phi-out for this BasicBlock.
TemporarySet
BasicBlock_phiOutSet(const_BasicBlock this);
#define BasicBlock_isPhiOut(this, temporary) \
  TemporarySet_contains(BasicBlock_phiOutSet(this), temporary)
BasicBlock_flags— This BasicBlock flags.
static inline BasicBlockFlags
BasicBlock_flags(const_BasicBlock this)
{
  return BasicBlock_FLAGS(this);
}
BasicBlock_setFlags— Set this BasicBlock flags.
static inline void
BasicBlock_setFlags(BasicBlock this, BasicBlockFlags flags)
{
  *BasicBlock__FLAGS(this) |= flags;
}
BasicBlock_clearFlags— Clear this BasicBlock flags.
static inline void
BasicBlock_clearFlags(BasicBlock this, BasicBlockFlags flags)
{
  *BasicBlock__FLAGS(this) &= ~flags;
}
BasicBlock_mark— This BasicBlock mark.
static inline int
BasicBlock_mark(const_BasicBlock this)
{
  return BasicBlock_MARK(this);
}
BasicBlock_setMark— Set this BasicBlock mark address.
static inline void
BasicBlock_setMark(BasicBlock this, int mark)
{
  *BasicBlock__MARK(this) = mark;
}
BasicBlock_unrolled— This BasicBlock unrolled value.
static inline int
BasicBlock_unrolled(const_BasicBlock this)
{
  return BasicBlock_UNROLLED(this);
}
BasicBlock_setUnrolled— Set this BasicBlock unrolled value.
static inline void
BasicBlock_setUnrolled(BasicBlock this, int unrolled)
{
  *BasicBlock__UNROLLED(this) = unrolled;
  Except_ENSURE(BasicBlock_UNROLLED(this) == unrolled);
}
BasicBlock_padding— This BasicBlock NOP padding.
static inline int
BasicBlock_padding(const_BasicBlock this)
{
  return BasicBlock_PADDING(this);
}
BasicBlock_setPadding— Set this BasicBlock NOP padding.
static inline void
BasicBlock_setPadding(BasicBlock this, int padding)
{
  *BasicBlock__PADDING(this) = padding;
  Except_ENSURE(BasicBlock_PADDING(this) == padding);
}
BasicBlock_labelCount— Count of labels in this BasicBlock.
static inline int
BasicBlock_labelCount(const_BasicBlock this)
{
  return BasicBlock_LABELCOUNT(this);
}
BasicBlock_labelVariant— For use by BasicBlock_FOREACH_Label.
static inline const union LabelVariant_ *
BasicBlock_labelVariant(const_BasicBlock this)
{
  return BasicBlock_LABELVARIANT(this);
}
BasicBlock_FOREACH_Label— Iterate over this BasicBlock Label(s).
#define BasicBlock_FOREACH_Label(this, label) { \
  int BasicBlock_LABELCOUNT = BasicBlock_labelCount(this), BasicBlock_I = 0; \
  const union LabelVariant_ *BasicBlock_LABELVARIANT = BasicBlock_labelVariant(this); \
  const Label *BasicBlock_LABELARRAY = BasicBlock_LABELCOUNT > 1? \
                                       BasicBlock_LABELVARIANT->LABELS: \
                                       &BasicBlock_LABELVARIANT->LABEL; \
  for (; BasicBlock_I < BasicBlock_LABELCOUNT; BasicBlock_I++) { \
    Label label = BasicBlock_LABELARRAY[BasicBlock_I];
#define BasicBlock_ENDEACH_Label \
  } \
}
BasicBlock_makeLabel— Get the first label of this BasicBlock or create one if there is none.
Label
BasicBlock_makeLabel(BasicBlock this);
BasicBlock_hasLabel— Return whether label is a label for the basic block.
bool
BasicBlock_hasLabel(const_BasicBlock this, Label label);
BasicBlock_label— Return the first Label of this BasicBlock if any else NULL.
static inline Label
BasicBlock_label(const_BasicBlock this)
{
  int labelCount = BasicBlock_LABELCOUNT(this);
  const union LabelVariant_ *labelVariant = BasicBlock_LABELVARIANT(this);
  if (labelCount > 1) return labelVariant->LABELS[0];
  return labelVariant->LABEL;
}
BasicBlock_contributed— Static estimation of contributed execution cycles.
float
BasicBlock_contributed(const_BasicBlock this);
BasicBlock_pretty— Pretty-print this BasicBlock.
bool
BasicBlock_pretty(const_BasicBlock this, FILE *file);
BasicBlock_hasDedicatedEffects— Check if this BasicBlock has effects on Dedicated.
bool
BasicBlock_hasDedicatedEffects(const_BasicBlock this);
BasicBlock_isEmpty— Test if this BasicBlock is empty.
static inline bool
BasicBlock_isEmpty(const_BasicBlock this)
{
  return Selector_isEmpty(BasicBlock_SELECTOR(this));
}
BasicBlock_countOperations— Count of operations in this BasicBlock.
static inline uint32_t
BasicBlock_countOperations(const_BasicBlock this)
{
  return Selector_countOperations(BasicBlock_SELECTOR(this));
}
BasicBlock_firstOperation— First operation in this BasicBlock.
static inline Operation
BasicBlock_firstOperation(const_BasicBlock this)
{
  return Selector_firstOperation(BasicBlock_SELECTOR(this));
}
BasicBlock_lastOperation— Last operation in this BasicBlock.
static inline Operation
BasicBlock_lastOperation(const_BasicBlock this)
{
  return Selector_lastOperation(BasicBlock_SELECTOR(this));
}

BasicBlock_getControlOperation - Get the control operation of this BasicBlock.

static inline Operation
BasicBlock_getControlOperation(const_BasicBlock this)
{
  Operation last_operation = BasicBlock_lastOperation(this);
  if (last_operation != NULL &&
      Operator_isControl(Operation_OPERATOR(last_operation))) {
    return last_operation;
  }
  return NULL;
}
BasicBlock_hasControlOperation— Test if this BasicBlock has a control operation.
#define BasicBlock_hasControlOperation(this) \
  (BasicBlock_getControlOperation(this) != NULL)

BasicBlock_getRoutineOperation - Get the Routine operation of this BasicBlock.

static inline Operation
BasicBlock_getRoutineOperation(const_BasicBlock this)
{
  Operation last_operation = BasicBlock_lastOperation(this);
  if (last_operation != NULL &&
      Operator_isRoutine(Operation_OPERATOR(last_operation))) {
    return last_operation;
  }
  return NULL;
}

BasicBlock_getJumpOperation - Get the Jump operation of this BasicBlock.

static inline Operation
BasicBlock_getJumpOperation(const_BasicBlock this)
{
  Operation last_operation = BasicBlock_lastOperation(this);
  if (last_operation != NULL &&
      Operator_isJump(Operation_OPERATOR(last_operation))) {
    return last_operation;
  }
  return NULL;
}
BasicBlock_makeOperationPHI— Make a SSA Phi operation.
Operation
BasicBlock_makeOperationPHI(BasicBlock this, Temporary temporary);
BasicBlock_makeOperationSIGMA— Make a SSI Sigma operation.
Operation
BasicBlock_makeOperationSIGMA(BasicBlock this, Temporary temporary);
BasicBlock_earlyOperation— return this BasicBlock early Operation.

An early operation is the first that is not a PHI or a LABEL Operation.

Operation
BasicBlock_earlyOperation(const_BasicBlock this);
BasicBlock_moveOperationEarly— Move this BasicBlock Operation early.
Ensure
BasicBlock invariants.
void
BasicBlock_moveOperationEarly(BasicBlock this, Operation operation);
BasicBlock_lateOperation— return this BasicBlock late Operation.

A late operation is the last that is not a SIGMA or a Control Operation.

Operation
BasicBlock_lateOperation(const_BasicBlock this);
BasicBlock_moveOperationLate— Move this BasicBlock Operation late.
Ensure
BasicBlock invariants.
void
BasicBlock_moveOperationLate(BasicBlock this, Operation operation);
BasicBlock_makeOperationPCOPY— Make a parallel COPY Operation before or after point operation.
Operation
BasicBlock_makeOperationPCOPY(BasicBlock this, Operation point, bool before,
                              int32_t maxCount, int32_t increment);
BasicBlock_makeEarlyOperationCOPY— Make a sequential Operation at early position.
Operation
BasicBlock_makeEarlyOperationCOPY(BasicBlock this, Temporary result, Temporary argument);
BasicBlock_makeOperationECOPY— Make a parallel copy Operation at early position.
Operation
BasicBlock_makeOperationECOPY(BasicBlock this);
BasicBlock_makeLateOperationCOPY— Make a sequential copy Operation at late position.
Operation
BasicBlock_makeLateOperationCOPY(BasicBlock this, Temporary result, Temporary argument);
BasicBlock_makeOperationLCOPY— Make a parallel copy Operation at late position.
Operation
BasicBlock_makeOperationLCOPY(BasicBlock this);
BasicBlock_detachOperation— Remove an Operation from this BasicBlock.
void
BasicBlock_detachOperation(BasicBlock this, Operation operation);
BasicBlock_putSelector— Put the contents of a Selector first on this BasicBlock.
void
BasicBlock_putSelector(BasicBlock this, Selector selector);
BasicBlock_pushSelector— Push the contents of a Selector last on this BasicBlock.
void
BasicBlock_pushSelector(BasicBlock this, Selector selector);
BasicBlock_insertSelector— Insert a Selector before Operation in this BasicBlock.
void
BasicBlock_insertSelector(BasicBlock this, Operation before, Selector selector);
BasicBlock_appendSelector— Append a Selector after Operation in this BasicBlock.
void
BasicBlock_appendSelector(BasicBlock this, Operation after, Selector selector);
BasicBlock_makeOrderings— Make this BasicBlock Operation ORDERING(s).

The initial sequence of Label and Phi(s) get the same ordering. The terminal sequence of Control and Sigmas(s) get the same ordering.

int32_t
BasicBlock_makeOrderings(BasicBlock this, int32_t ordering, int32_t increment);
BasicBlock_checkOrderings— Check this BasicBlock Operation ORDERING(s).
bool
BasicBlock_checkOrderings(const_BasicBlock this);
BasicBlock_frequencyLT— True iff this FREQUENCY is less than that FREQUENCY.
bool
BasicBlock_frequencyLT(const_BasicBlock this, const_BasicBlock that);
BasicBlock_literalsLabel— this BasicBlock literals label.
static inline Label
BasicBlock_literalsLabel(BasicBlock this)
{
  return BasicBlock_LITERALSLABEL(this);
}
BasicBlock_setLiteralsLabel— set this BasicBlock literals label.
static inline void
BasicBlock_setLiteralsLabel(BasicBlock this, Label label)
{
  *BasicBlock__LITERALSLABEL(this) = label;
}
BasicBlockLiteral_temporary— this BasicBlockLiteral temporary.
static inline Temporary
BasicBlockLiteral_temporary(const_BasicBlockLiteral this)
{
    return BasicBlockLiteral_TEMPORARY(this);
}
BasicBlockLiteral_nativeType— this BasicBlockLiteral nativeType.
static inline NativeType
BasicBlockLiteral_nativeType(const_BasicBlockLiteral this)
{
    return BasicBlockLiteral_NATIVETYPE(this);
}
BasicBlock_literals— For use by BasicBlock_FOREACH_BasicBlockLiteral.
static inline const_IDList
BasicBlock_literals(const_BasicBlock this)
{
  return BasicBlock_LITERALS(this);
}
BasicBlock_FOREACH_BasicBlockLiteral— Iterate this BasicBlock Literal Temporary(ies).
#define BasicBlock_FOREACH_BasicBlockLiteral(this, literal) { \
  const_IDList BasicBlock_LITERALS = BasicBlock_literals(this); \
  IDList_FOREACH(BasicBlock_LITERALS, BasicBlockLiteral_, literal) {
#define BasicBlock_ENDEACH_BasicBlockLiteral \
  } IDList_ENDEACH; \
}
BasicBlock_literalsCount— Literals count of this BasicBlock.
static inline int32_t
BasicBlock_literalsCount(const_BasicBlock this)
{
  return BasicBlock_LITERALSCOUNT(this);
}
BasicBlock_pushLiteral— Create and push a BasicBlockLiteral on this BasicBlock.
static inline BasicBlockLiteral
BasicBlock_pushLiteral(BasicBlock this, Temporary temporary, NativeType nativeType)
{
  size_t size = BasicBlockLiteral_Size(temporary, nativeType);
  void *literal = IDList_push(BasicBlock_LITERALS(this), size);
  return BasicBlockLiteral_Ctor(literal, temporary, nativeType);
}
BasicBlock_transferLiterals— transfer all literals from this BasicBlock to that BasicBlock.
Require
that BasicBlock has no literals.
Ensure
all literals and the literals_label are transferred.
static inline void
BasicBlock_transferLiterals(BasicBlock this, BasicBlock that)
{
    Label literals_label = BasicBlock_literalsLabel(this);
    IDList this_literals = BasicBlock_LITERALS(this);
    IDList that_literals = BasicBlock_LITERALS(that);
    Except_REQUIRE(BasicBlock_literalsCount(that) == 0);
    Except_REQUIRE(BasicBlock_literalsLabel(that) == NULL);
    IDList_transfer(this_literals, that_literals);
    BasicBlock_setLiteralsLabel(that, literals_label);
    BasicBlock_setLiteralsLabel(this, NULL);
    Except_ENSURE(BasicBlock_literalsCount(this) == 0);
}
BasicBlockStack— Stack of BasicBlock(s).
struct BasicBlockStack_ {
  //@args       Memory memory, int maxCount
  PtrSeq_ __;           // Underlying PtrSeq.
};
BasicBlockStack_FOREACH_BasicBlock— Iterate over this BasicBlockStack BasicBlock(s).
#define BasicBlockStack_FOREACH_BasicBlock(this, basicBlock) { \
  const_PtrSeq BasicBlockStack____ = BasicBlockStack__const(this); \
  PtrSeq_FOREACH(BasicBlockStack____, BasicBlock, basicBlock) {
#define BasicBlockStack_ENDEACH_BasicBlock \
  } PtrSeq_ENDEACH \
}
BasicBlockStack_FORBACK_BasicBlock— Iterate over this BasicBlockStack BasicBlock(s).
#define BasicBlockStack_FORBACK_BasicBlock(this, basicBlock) { \
  const_PtrSeq BasicBlockStack____ = BasicBlockStack__const(this); \
  PtrSeq_FORBACK(BasicBlockStack____, BasicBlock, basicBlock) {
#define BasicBlockStack_ENDBACK_BasicBlock \
  } PtrSeq_ENDBACK \
}
BasicBlockStack_sort— Sort this BasicBlockStack.

See the en.wikibook.org heapsort.

typedef bool (*BasicBlockLT)(const_BasicBlock, const_BasicBlock);
void
BasicBlockStack_sort(BasicBlockStack this, BasicBlockLT lt);
BasicBlockTable— Specialization of IndexedTable for BasicBlock(s).
struct BasicBlockTable_ {
  //@args       Memory memory, int32_t estimate
  IndexedTable_ __;
  //@access MEMORY      IndexedTable_memory(BasicBlockTable____(this))
  //@access COUNT       IndexedTable_count(BasicBlockTable____(this))
  //@access BASE        (const BasicBlock *)IndexedTable_base(BasicBlockTable____(this))
};
BasicBlockTable_FOREACH_BasicBlock— Iterate this BasicBlockTable BasicBlock(ies).
#define BasicBlockTable_FOREACH_BasicBlock(this, basicBlock) { \
  IndexedTable_FOREACH_Indexed(BasicBlockTable__const(this), \
                                   BasicBlock, basicBlock) { \
    int32_t BasicBlockTable_BasicBlock_INDEX = IndexedTable_INDEX;
#define BasicBlockTable_ENDEACH_BasicBlock \
  } IndexedTable_ENDEACH_Indexed; \
}
BasicBlockEdge_isBack— Test if this is a back edge?
extern bool
BasicBlockEdge_isBack(BasicBlockEdge edge);

this = (A,B) check that B follows A in memory (codeRegion)

extern bool
BasicBlockEdge_isFalse(BasicBlockEdge this, float *weight);

this=(A,B) check that B has only one predecessor

extern bool
BasicBlockEdge_isSweetBottom(BasicBlockEdge this, float *weight);

this=(A,B) check if A has only one successor

extern bool
BasicBlockEdge_isSweetTop(BasicBlockEdge this, float *weight);

Check if an edge is bottom-weak thisE(A,B) check that each incomming edge of B is SweetTop or false but E

extern bool
BasicBlockEdge_isWeakBottom(BasicBlockEdge this, float *weight);

Same with Top thisE(A,B) check that each outgoing edge of A is SweetBottom or false but E

extern bool
BasicBlockEdge_isWeakTop (BasicBlockEdge this, float *weight);

Check if an edge is critical, thas is if this = (A,B), that A has more than one successor and B has more than one predecessor.

extern bool
BasicBlockEdge_isCritical (BasicBlockEdge this);

strong critical edge?

extern bool
BasicBlockEdge_isStrong (BasicBlockEdge this);

Is this edge suitable for conditional parallel copy.

extern bool
BasicBlockEdge_isConditional(BasicBlockEdge E);

this = E = (A,B). Create C on E

extern BasicBlock
BasicBlockEdge_splitFalse(struct CodeRegion_* codeRegion, BasicBlockEdge this);

this = E = (A,B). Create C on E

extern BasicBlock
BasicBlockEdge_splitCritical(struct CodeRegion_* codeRegion, BasicBlockEdge this);

BasicBlockEdge_split(BasicBlockEdge edge) -- split the edge if the destination has several predecessors

extern void
BasicBlockEdge_split(BasicBlockEdge edge);