Skip to content

Commit df7f36f

Browse files
committedMay 29, 2024·
compiler: super early exploration of instruction reordering
See comments in InstructionReordering.ts. This needs substantial iteration before landing in some form, just putting up to share for discussion. ghstack-source-id: 153eca4485d6f19e71423547af806f7b4aca8bc7 Pull Request resolved: #29579
1 parent 867edc6 commit df7f36f

File tree

59 files changed

+862
-800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+862
-800
lines changed
 

Diff for: ‎compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
deadCodeElimination,
4242
pruneMaybeThrows,
4343
} from "../Optimization";
44+
import { instructionReordering } from "../Optimization/InstructionReordering";
4445
import {
4546
CodegenFunction,
4647
alignObjectMethodScopes,
@@ -195,6 +196,9 @@ function* runWithEnvironment(
195196
deadCodeElimination(hir);
196197
yield log({ kind: "hir", name: "DeadCodeElimination", value: hir });
197198

199+
instructionReordering(hir);
200+
yield log({ kind: "hir", name: "InstructionReordering", value: hir });
201+
198202
pruneMaybeThrows(hir);
199203
yield log({ kind: "hir", name: "PruneMaybeThrows", value: hir });
200204

Diff for: ‎compiler/packages/babel-plugin-react-compiler/src/Inference/InferReferenceEffects.ts

+6
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,12 @@ class InferenceState {
737737
* For debugging purposes, dumps the state to a plain
738738
* object so that it can printed as JSON.
739739
*/
740+
inspect(): any {
741+
return {
742+
values: this.#values,
743+
variables: this.#variables,
744+
};
745+
}
740746
debug(): any {
741747
const result: any = { values: {}, variables: {} };
742748
const objects: Map<InstructionValue, number> = new Map();

0 commit comments

Comments
 (0)
Please sign in to comment.