2024-10-06 19:58:11 +02:00
|
|
|
# MiniC Compiler
|
2024-11-25 23:50:51 +01:00
|
|
|
LAB5a (Control Flow Graph in SSA Form) & LAB5b (Smart Register Allocation), CAP 2023-24
|
2024-10-06 19:58:11 +02:00
|
|
|
|
|
|
|
# Authors
|
|
|
|
|
2024-11-25 23:50:51 +01:00
|
|
|
Augustin LUCAS
|
2024-10-06 19:58:11 +02:00
|
|
|
|
|
|
|
# Contents
|
|
|
|
|
2024-11-25 23:50:51 +01:00
|
|
|
Extension implemented : Optimizing swap
|
|
|
|
- Cycles of size 1 : skip
|
|
|
|
- Cycles of size 2 : use 3 XOR operations to swap the registers values without any temporary register use
|
2024-10-06 19:58:11 +02:00
|
|
|
|
|
|
|
# Test design
|
|
|
|
|
2024-11-25 23:50:51 +01:00
|
|
|
No tests were added since some of the `students`' tests from lab4 still failed to execute properly.
|
2024-10-06 19:58:11 +02:00
|
|
|
|
|
|
|
# Known bugs
|
|
|
|
|
2024-11-25 23:50:51 +01:00
|
|
|
Failing tests:
|
|
|
|
- `./TP04/tests/students/ext-for-fortran/test_imbricated_for.c`
|
|
|
|
- `./TP04/tests/students/ext-for-fortran/test_for.c`
|
|
|
|
- `./TP04/tests/students/base/test_nested_while.c`
|
|
|
|
- `./TP04/tests/students/base/test_fibonacci.c`
|
|
|
|
- `./TP04/tests/provided/dataflow/df03.c`
|
|
|
|
|
|
|
|
The bug seems to be related to the handling of Offsets because a lot more tests will fail if temporaries are only assigned to memory (no registers).
|
|
|
|
This can be done by commenting `TP05/SmartAllocator.py:124`.
|
|
|
|
|
|
|
|
This seems to affect `while` and `for` loops as well as regular variables (because variables may not be stored/loaded correctly).
|