Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit aba3df7

Browse files
committed
Start converting MIR to SSA TIR.
This change: - Starts adding support for statements to TIR. Only simple assignments are translated. Everything else is made into an "unimplemented" statement. - Does the first part of the SSA conversion, namely: * Computes the dominance frontier. * Inserts PHI nodes in the right place and for the correct TIR variables. So what we get is a CFG with PHIs, but which is not yet in SSA. The remaining step is to walk the dominator tree and assign each definition of a variable with a new SSA variable name. Manual inspection of CFG graphs with assignments and PHIs shown look good, but tests will follow later.
1 parent 579fb1d commit aba3df7

File tree

6 files changed

+336
-29
lines changed

6 files changed

+336
-29
lines changed

.buildbot.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
./x.py clean # We don't clone afresh to save time and bandwidth.
66
git clean -dffx # If upstream removes a submodule, remove the files from disk.
77

8+
# Ensure the build fails if it uses excessive amounts of memory.
9+
ulimit -d $((1024 * 1024 * 8)) # 8 GiB
10+
811
# Note that the gdb must be Python enabled.
9-
PATH=/opt/gdb-8.2/bin:${PATH} RUST_BACKTRACE=1 YK_DEBUG_SECTIONS=1 \
10-
./x.py test --config .buildbot.toml
12+
/usr/bin/time -v env PATH=/opt/gdb-8.2/bin:${PATH} \
13+
RUST_BACKTRACE=1 ./x.py test --config .buildbot.toml

Cargo.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3062,8 +3062,10 @@ version = "0.0.0"
30623062
name = "rustc_yk_sections"
30633063
version = "0.0.0"
30643064
dependencies = [
3065+
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
30653066
"rustc 0.0.0",
30663067
"rustc_codegen_utils 0.0.0",
3068+
"rustc_data_structures 0.0.0",
30673069
"rustc_yk_link 0.0.0",
30683070
"ykpack 0.1.0 (git+https://github.com/softdevteam/ykpack)",
30693071
]
@@ -4044,7 +4046,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
40444046
[[package]]
40454047
name = "ykpack"
40464048
version = "0.1.0"
4047-
source = "git+https://github.com/softdevteam/ykpack#e0fd6162b9522fd04b6bbb77a232986c4ea5c257"
4049+
source = "git+https://github.com/softdevteam/ykpack#358a7403a5b8c03809f5c5b07933a6850060afa4"
40484050
dependencies = [
40494051
"fallible-iterator 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
40504052
"rmp-serde 0.14.0 (git+https://github.com/3Hren/msgpack-rust?rev=40b3d480b20961e6eeceb416b32bcd0a3383846a)",

src/librustc_yk_sections/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ rustc = { path = "../librustc" }
1414
rustc_yk_link = { path = "../librustc_yk_link" }
1515
ykpack = { git = "https://github.com/softdevteam/ykpack" }
1616
rustc_codegen_utils = { path = "../librustc_codegen_utils" }
17+
rustc_data_structures = { path = "../librustc_data_structures" }
18+
log = "0.4.5"

src/librustc_yk_sections/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ extern crate rustc;
1313
extern crate rustc_yk_link;
1414
extern crate rustc_codegen_utils;
1515
extern crate ykpack;
16+
extern crate rustc_data_structures;
17+
#[macro_use] extern crate log;
1618

1719
pub mod mir_cfg;

0 commit comments

Comments
 (0)