From 25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Dec 2022 00:16:59 +0000 Subject: haha it's been a while since i last committed, hasn't it --- includes/compiler/CopyPropagation.h | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'includes/compiler/CopyPropagation.h') diff --git a/includes/compiler/CopyPropagation.h b/includes/compiler/CopyPropagation.h index 841f8dc..8d80067 100644 --- a/includes/compiler/CopyPropagation.h +++ b/includes/compiler/CopyPropagation.h @@ -2,5 +2,51 @@ #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 -- cgit v1.2.3