-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate SSA-based middle-end and snapshot tests #85
Conversation
The GitHub Action reports the broken pipe if the snapshot testing failed. It works fine on my local PC and only reports https://github.com/vacantron/shecc/actions/runs/6834732304/job/18587784272#step:3:467 |
It is a bit confusing that there are 'check' and 'test' targets which deal with the test suite. Can you clarify? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename src/SSA.c
to src/ssa.c
(lowercase).
Don't check in JSON files which are generated by snapshot.
I got the following messages from CI:
|
I forgot to provide the error messages from GitHub Action: tests/check-snapshots.sh
Files /dev/fd/63 and /dev/fd/62 differ
Error: writing output failed: Broken pipe
cat: write error: Broken pipe
Files /dev/fd/63 and /dev/fd/62 differ
make: *** [Makefile:54: check] Error 1
Error: writing output failed: Broken pipe
cat: write error: Broken pipe
Error: Process completed with exit code 1.
That message was caused by the mentioned control-flow change. The snapshot testing had been passed. I edited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the generated JSON file and update .gitignore
.
We need some JSON files as the baseline of tests in |
755d450
to
e771c22
Compare
The instructions which loads/stores with a huge offset also need to be modified when self-hosting. |
The current unit test only covers the end to end case. It is hard the classify which part went wrong in the compilation. The new middle end can dump the IR with the dot file as a snapshot. We can also use the tool like `graphviz` to check the flow during the compilation. Use `make check-snapshots` to invoke the snapshot test, and use `tests/update-snapshots.sh` to update the snapshots if there's any change for the cfont.
4b823b3
to
e525a94
Compare
- add TODO - refine debug message - move lengthy logic out of `bb_dump` - move common statement out of if-else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's unify our terminology. From now on, use insn
as the abbreviation for "Instruction," rather than "inst."
377e6f4
to
4d49176
Compare
Thank @vacantron for contributing! |
The current cfront and IR generation are high coupling that making the flow analysis harder. To introduce the further optimizations, the static single assignment (SSA) is imperative. This patch introduces the minimal changes for it, and also keeps the old first phase IR (ph1_ir) for the compatibility to the upcoming works.
The current unit test only covers the end to end case. It is hard the classify which part went wrong in the compilation. The new middle end can dump the IR with the dot file as a snapshot. We can also use the tool like
graphviz
to check the flow during the compilation.Use
make check-snapshots
to invoke the snapshot test, and usetests/update-snapshots.sh
to update the snapshots if there's any change for the cfont.Notice: The snapshots should be updated under the ARM configure.