Add deadcode examples

This commit is contained in:
Jeehoon Kang
2020-05-03 06:01:46 +00:00
parent f4dc5e426c
commit 9a2dd840d2
6 changed files with 86 additions and 3 deletions

View File

@@ -238,7 +238,7 @@ peg::parser! {
}
/
"unit" {
Constant::undef(Dtype::unit()) // TODO
Constant::unit()
}
/
"<constant>" {

View File

@@ -2,7 +2,7 @@ use crate::ir::*;
use crate::opt::FunctionPass;
use crate::*;
pub type Deadcode = FunctionPass<DeadcodeInner>;
pub type Deadcode = FunctionPass<Repeat<DeadcodeInner>>;
#[derive(Default)]
pub struct DeadcodeInner {}

View File

@@ -20,7 +20,7 @@ pub trait Optimize<T> {
}
pub type O0 = Null;
pub type O1 = Repeat<(SimplifyCfg, (Mem2reg, (Deadcode, Gvn)))>;
pub type O1 = Repeat<(SimplifyCfg, (Mem2reg, (Gvn, Deadcode)))>;
#[derive(Default)]
pub struct Null {}