Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化:循环变换 #58

Open
6 of 9 tasks
OldDriverTree opened this issue Jul 23, 2022 · 0 comments
Open
6 of 9 tasks

优化:循环变换 #58

OldDriverTree opened this issue Jul 23, 2022 · 0 comments
Assignees

Comments

@OldDriverTree
Copy link
Contributor

OldDriverTree commented Jul 23, 2022

  • 循环展开
  • 交换循环次序(stencil缓存优化)
  • 循环合并(spmv)/分裂
  • 循环相关的数据依赖分析
  • 归纳变量发现
  • 循环相关的各种命题推断(例如 for(int i=0;i<n;++i) 可以确定 i 的范围是 0~n-1
  • 删除空循环
  • 循环累加变量的化简
  • 只含0/1的数组可以用更少的位表示每个元素,相应可以改变循环
    ...
@Steaunk Steaunk pinned this issue Aug 1, 2022
@OldDriverTree OldDriverTree self-assigned this Aug 3, 2022
Cydiater added a commit that referenced this issue Aug 6, 2022
* merge IR::UnaryOp::ID

* merge inst b=constexpr; c=a+b;

* merge inst b=constexpr; c=a-b;

* merge inst: a+b*4

* fix merge_inst

* merge inst: a+c1*c2

* feat: backend dce

* fix: backend dce

* feat: optimize a[*|/|%](1<<c)

* feat: optimize a/c

* feat: optimize a%c

* feat: optimize a*((1<<c1)[+|-](1<<c2))

* optimize GVN

* warn

* fix

* fix

* format

* fix

* feat: support LoadArg and ArrayIndex in gvn, simplify load store

* feat: support LoadAddr in gvn

* feat: dse in BB

* run gvn aftere simple_load_store

* fix: gvn constexpr compute

* feat: simplify add expr

* format

* fix: simplify add expr

* feat: support more general simplify_load_store on DAG subgraph of CFG

* feat: merge pure func

* fix: unsafe merge pure call

* fix: side effect analysis

* feat: const prop for functions that called once

* feat: remove unused MemObject

* feat: add remove_unused_BB

* expose remove_unused_BB

* feat: remove trivial jumps, and reorder code before backend

* feat: remove unused return value

* fix: remove LocalVarDef

* feat: support phi identity in gvn

* fix: remove trivial BB

* feat: tail_rec_to_loop, to debug

* fix: remove trivial BB

* fix: tail_call_to_loop

* do $bench

* feat: simplify branch
fix: ir exec phi
fix: remove trivial bb
fix: tail rec to loop

* test: no inline

* fix format

* feat: add CondProp

* fix: precondition of gcm & PointerBase
feat: gvn remove phi like a=phi(b,b,a,a)

* fix

* feat: remove unreturnable BB $bench

* feat: remove unused func (this fix CE on 95_float backend, but there may be other bugs)

* feat: typecheck (float,int,addr)
fix: float as condition
$bench

* fix: translate phi to mov

* fix: disable dag_ir instead of assert(0) when type check Int/Addr fail
$bench

* feat: schedule phi

* fix: [#106] ssa destruction
$bench

* $bench

* fix: [#106] ssa_destruction
$bench

* feat: better RemoveUnusedStore (testcase sl)
fix: frontend gen ArrayIndex by correct order
$bench

* chore: add .clang-format
$bench

* chore: split dag_ir.cpp into files

* chore: split dag_ir.cpp into files

* feat: add interface for visit DAG_IR::LoopTreeNode directly
fix: update clang-format to 13
$bench

* fix: use clang-format-13
$bench

* fix: add gvn between global_var_to_local and mem2reg
$bench

* format

* fix: reorder passes into correct order
$bench

* feat: inference loop var
feat: (GlobalInitProp) propegate value of global init
bug: GlobalInitProp for Float

* feat: unroll: for(i=c1; i ? c2; i ??= c3)
$bench

* fix: optimize_ir
$bench

* fix: simplify BB after loop unroll

* feat: local array init to global
feat: a[0] == a in gvn
$bench

* feat: global init to global
$bench

* feat: a%b = a-a/b*b
$bench

* refactor debug output

* feat: loop unroll for(i=l;i<r;i+=1){...} => for(i=l;i+4<r;i+=4){...} for(;i<r;i+=4){...}
feat: check IR properties everywhere
$bench

* test unroll(2)
$bench

* change exit hash to debug

* fix CE

* fix CE

* feat: use args to set unroll parameters
change exit hash to debug

* disable optimizer for some functional testcases
$bench

* feat: inference const MemObject
fix: SideEffect::mustbe

* feat: const not in may_read
$bench

Co-authored-by: Cydiater <[email protected]>
@Cydiater Cydiater unpinned this issue Aug 8, 2022
Cydiater pushed a commit that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant