summaryrefslogtreecommitdiff
path: root/includes/compiler/CopyPropagation.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-12-14 00:16:59 +0000
committerAsh Wolf <ninji@wuffs.org>2022-12-14 00:16:59 +0000
commit25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22 (patch)
treec0ee632aa3752884b996c562622e2ece88216ea4 /includes/compiler/CopyPropagation.h
parent9d2728a5605f651934fe67a6fe6986b3e4a2c011 (diff)
downloadMWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.tar.gz
MWCC-25bab8b1fb2fc851ea3f1f630b3de65ca6afdc22.zip
haha it's been a while since i last committed, hasn't it
Diffstat (limited to '')
-rw-r--r--includes/compiler/CopyPropagation.h46
1 files changed, 46 insertions, 0 deletions
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