mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Add deadcode examples
This commit is contained in:
@@ -238,7 +238,7 @@ peg::parser! {
|
||||
}
|
||||
/
|
||||
"unit" {
|
||||
Constant::undef(Dtype::unit()) // TODO
|
||||
Constant::unit()
|
||||
}
|
||||
/
|
||||
"<constant>" {
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user