Go to the first, previous, next, last section, table of contents.


Functions

extern void Usage()

Print Alto usage information

extern void ParseCommandLine(int argc, char *argv[])

Parse command line and set internal flags accordingly. Allocate space for main datastructures (the size of which should evetually be configurable by commandline options)

extern NUMBER AfunRegisterSaveOffset(INDEX ifun, REG reg)

Assuming register reg is a saved register of ifun find its stack offset. NEEDS WORK!

extern INDEX AfunRegSaveIns(INDEX ifun, REG reg)

Assuming register reg is a saved register of ifun find its save instruction. NEEDS WORK!

extern void AfunBypassSaveRegister(INDEX ifun,REG reg_saved, REG reg_bypass)

Assuming register reg_saved is a saved register of ifun avoid the save and restore operations by bypassing it through reg_bypass

extern void AfunKillLoadStoreSaveRegister(INDEX ifun,REG reg)

Assuming reg is a saved register in ifun delete its save/restore pair.

extern REGLIST AfunScratchRegisters(INDEX ifun)

Find the registers in ifun which are neither used nore defined

extern BOOL AfunIsLeaf(INDEX ifun)

Return True if ifun does not call any other function.

extern BOOL AfunIsLoopAnalyzable(INDEX ifun)

Return True if ifun can be loop-optimized without making the optimizer go into an infinite loop

extern NUMBER AfunReachableFirst(INDEX ifun)

Return True if all bbls of ifun can be reached from the first (init) bbl

extern NUMBER AfunReachableLast(INDEX ifun)

Return True if all bbls of ifun can be (back) reached from the last (exit) bbl

extern NUMBER AfunNSwitches(INDEX ifun)

Return the number of bbls of type BT_SWITCH in ifun

extern NUMBER AfunNSwitchesCritical(INDEX ifun)

Return the number of critical bbls of type BT_SWITCH in ifun

extern NUMBER AfunNJumps(INDEX ifun)

Return the number of bbls of type BT_JUMP in ifun

extern NUMBER AfunNJumpsCritical(INDEX ifun)

Return the number of critical bbls of type BT_JUMP in ifun

extern BOOL AfunHasEsc2(INDEX ifun)

Return True if ifun has outgoing escaping edges

extern BOOL AfunHasEsc2Critical(INDEX ifun)

Return True if ifun has outgoing escaping edges from critical bbls

extern BOOL AfunHas2Esc(INDEX ifun)

Return True if ifun has incoming escaping edges

extern BOOL AfunHas2EscNotFirst(INDEX ifun)

Return True if ifun has incoming escaping edges to bbls other than the init bbl

extern BOOL AfunIsSetjmp(INDEX ifun)

obsolete

extern BOOL AfunIsLongjmp(INDEX ifun)

obsolete

extern REG AfunReturnRegister(INDEX ifun)

Return the return register of ifun

extern NUMBER AfunNCriticalCallSites(INDEX ifun)

Return the number of call edges calling ifun from critical bbls, does include incoming escapes.

extern NUMBER AfunNHotCallSites(INDEX ifun)

Return the number of call edges calling ifun from hot bbls, does include incoming escapes.

extern NUMBER AfunNCallSites(INDEX ifun)

Return the number of call edges calling ifun, does include incoming escapes.

extern NUMBER AfunNInssCritical(INDEX ifun)

Return the number of critical inss in ifun

extern NUMBER AfunNInss(INDEX ifun)

Return the number of inss in ifun

extern NUMBER AfunNBblsCritical(INDEX ifun)

Return the number of critical bbls in ifun

extern NUMBER AfunNBblsHot(INDEX ifun)

Return the number of hot bbls in ifun

extern NUMBER AfunNBbls(INDEX ifun)

Return the number of bbls in ifun

extern void AfunKill(INDEX ifun)

Kill the function including it bbls edgs and ins.

extern INDEX AfunNewFancy()

Create a new essentially empty function.

extern void AbblBranchTwist(INDEX ibbl)

Assumning that ibbl has a conditional branch reverse the true and false branch.

extern BOOL OptBranchForwarding(FILE *fp)

Follow chains of empty basic blocks until a nonempty basic block is found which is returned.

extern INDEX AfunDupCriticalPath(INDEX ifun,double flow_frac)

Duplicate The Critical Path of a Function

extern INDEX AfunDup(INDEX ifun, double flow_frac)

Duplicate (Clone) a Function

extern BOOL OptDuplicateFunctions(FILE *fp)

Inline a function "callee" at the basic block "callsite"

extern BOOL AbblIsReachable(INDEX callfrom, INDEX callto)

Returns TRUE if it is possible to reach callto from callfrom via a sequence of function calls followed backwards, i.e., from callee to caller. This code is not very efficient, but can (and should) be made faster if it's found to be a bottleneck.

extern NUMBER AedgMarkRecursiveCalls()

extern BOOL AfunWillNotBeInlined(INDEX ifun,BOOL usepath)

extern INT32 AbblLoopNCriticalInss(INDEX loophdr)

extern INT32 AfunNCriticalInss(INDEX ifun)

extern BOOL AfunNotRecursivelyInlinable(INDEX callee, BOOL usepath)

Returns TRUE if function callee should not be considered for recursive inlining. At this time, a recursive function callee is not considered for inlining if any of the following hold:

(1) callee is a pseudo-function (shouldn't happen, but included for safety);

(2) callee contains a setjmp or longjmp;

(3) callee does not have a "good" callsite (hence, noweher for it to be inlined to);

(4) callee contains an indirect jump;

(5) callee contains a jump through a jump table (i.e., a switch);

(6) callee contains an "escaping" edge to another function;

If the boolean argument usepath is TRUE, only the critical path is considered.

extern REG RegsGetFirst(REGLIST rl)

Return the lowest positon of a set bit in rl.

extern BOOL AfunCallsBadFunction(INDEX ifun)

obsolete

extern BOOL OptimizeEasy(FILE *fp)

Iteratively Execute Easy Optimization This function calls all the easy optimizations.

extern BOOL OptimizeHard(FILE *fp)

The Hard Optimization. This function is called only once sandwiched between calls to OptimizeEasy. It calls all the optimizations that should be applied only once. Because of problems with jumptable an ugly call to OptimizeEasy was necessary.


Go to the first, previous, next, last section, table of contents.