Files
ldc/backend/go.h
Alexey Prokhin caad8cde58 Squashed 'dmd2/' content from commit 10017d5
git-subtree-dir: dmd2
git-subtree-split: 10017d50eaaff4ecdc37a0153b6c37ea0b004c81
2012-04-05 11:10:48 +04:00

99 lines
3.2 KiB
C
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright (C) 1985-1998 by Symantec
// Copyright (C) 2000-2009 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
/*
* This source file is made available for personal use
* only. The license is in /dmd/src/dmd/backendlicense.txt
* or /dm/src/dmd/backendlicense.txt
* For any other uses, please contact Digital Mars.
*/
#if __SC__
#pragma once
#endif
#ifndef GO_H
#define GO_H 1
/***************************************
* Bit masks for various optimizations.
*/
typedef unsigned mftype; /* a type big enough for all the flags */
#define MFdc 1 // dead code
#define MFda 2 // dead assignments
#define MFdv 4 // dead variables
#define MFreg 8 // register variables
#define MFcse 0x10 // global common subexpressions
#define MFvbe 0x20 // very busy expressions
#define MFtime 0x40 // favor time (speed) over space
#define MFli 0x80 // loop invariants
#define MFliv 0x100 // loop induction variables
#define MFcp 0x200 // copy propagation
#define MFcnp 0x400 // constant propagation
#define MFloop 0x800 // loop till no more changes
#define MFtree 0x1000 // optelem (tree optimization)
#define MFlocal 0x2000 // localize expressions
#define MFall (~0) // do everything
/**********************************
* Definition elem vector, used for reaching definitions.
*/
typedef struct DN
{
elem *DNelem; // pointer to definition elem
block *DNblock; // pointer to block that the elem is in
} dn;
/* Global Variables */
extern unsigned optab[];
extern mftype mfoptim;
extern unsigned changes; /* # of optimizations performed */
extern struct DN *defnod; /* array of definition elems */
extern unsigned deftop; /* # of entries in defnod[] */
extern elem **expnod; /* array of expression elems */
extern unsigned exptop; /* top of expnod[] */
extern block **expblk; /* parallel array of block pointers */
extern vec_t defkill; /* vector of AEs killed by an ambiguous */
/* definition */
extern vec_t starkill; /* vector of AEs killed by a definition */
/* of something that somebody could be */
/* pointing to */
extern vec_t vptrkill; /* vector of AEs killed by an access */
/* gdag.c */
void builddags(void);
void boolopt(void);
void opt_arraybounds();
/* gflow.c */
void flowrd(),flowlv(),flowae(),flowvbe(),
flowcp(),flowae(),genkillae(),flowarraybounds();
int ae_field_affect(elem *lvalue,elem *e);
/* glocal.c */
void localize(void);
/* gloop.c */
int blockinit(void);
void compdom(void);
void loopopt(void);
void updaterd(elem *n,vec_t GEN,vec_t KILL);
/* gother.c */
void rd_arraybounds(void);
void rd_free();
void constprop(void);
void copyprop(void);
void rmdeadass(void);
void elimass(elem *);
void deadvar(void);
void verybusyexp(void);
list_t listrds(vec_t, elem *, vec_t);
#endif /* GO_H */