summaryrefslogtreecommitdiff
path: root/includes/compiler/CopyPropagation.h
blob: 8d80067287df901bdd0a6891c900fdf4b1094108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef COMPILER_COPYPROPAGATION_H
#define COMPILER_COPYPROPAGATION_H

#include "compiler/common.h"
#include "compiler/UseDefChains.h"

typedef int (*IsCandidateFunc)(PCode *);
typedef int (*PropagatesToUseFunc)(int a, int b);
typedef void (*PropagateAndFinishFunc)(int id);

#ifdef __MWERKS__
#pragma options align=mac68k
#endif
typedef struct Propagation {
    IsCandidateFunc is_candidate;
    PropagatesToUseFunc propagatestouse;
    PropagateAndFinishFunc propagateandfinish;
    char *name;
    char *nameplural;
    char *format;
    Boolean computesUseDefChains;
} Propagation;

typedef struct Candidate {
    PCode *pcode;
    RegUseOrDef *list;
} Candidate;

typedef struct PropInfo {
    UInt32 *vec0;
    UInt32 *vec4;
    UInt32 *vec8;
    UInt32 *vecC;
} PropInfo;
#ifdef __MWERKS__
#pragma options align=reset
#endif

extern int propagatedcopies;
extern int propagated_instructions;
extern int recursive_propagation;
extern int number_of_candidates;
extern Candidate *Candidates;
extern PropInfo *propinfo;
extern int *ncandidatesinblock;
extern int *firstcandidateinblock;

extern int precedes(PCode *a, PCode *b);
extern void propagateinstructions(Object *proc, Propagation *config, int passCount, Boolean localflag);
extern void propagatecopyinstructions(Object *proc, int flag);

#endif