LICM pass (#87)

* LICM pass

* Uses loop analysis to detect loop tree
* For each loop (starting with the inner ones), create a pre-header and move there loop-invariant instructions
* An instruction is loop invariant if it does not use as argument a value defined earlier in the loop
* File tests to check LICM's correctness
* Optimized pre-header creation
If the loop already has a natural pre-header, we use it instead of creating a new one.
The natural pre-header of a loop is the only predecessor of the header it doesn't dominate.
This commit is contained in:
Denis Merigoux
2017-06-07 11:27:22 -07:00
committed by Jakob Stoklund Olesen
parent 402cb8e1f6
commit e47f4a49fb
10 changed files with 487 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ mod binemit;
mod concurrent;
mod domtree;
mod legalizer;
mod licm;
mod regalloc;
mod runner;
mod runone;
@@ -61,6 +62,7 @@ fn new_subtest(parsed: &TestCommand) -> subtest::Result<Box<subtest::SubTest>> {
"domtree" => domtree::subtest(parsed),
"verifier" => verifier::subtest(parsed),
"legalizer" => legalizer::subtest(parsed),
"licm" => licm::subtest(parsed),
"regalloc" => regalloc::subtest(parsed),
"binemit" => binemit::subtest(parsed),
"simple-gvn" => simple_gvn::subtest(parsed),