Skip to content
Snippets Groups Projects

Fork reshape

Merged Aaron Councilman requested to merge fork-reshape into main
1 file
+ 19
44
Compare changes
  • Side-by-side
  • Inline
macro optimize!(X) {
gvn(X);
phi-elim(X);
dce(X);
ip-sroa(X);
sroa(X);
dce(X);
gvn(X);
phi-elim(X);
dce(X);
}
macro codegen!(X) {
gcm(*);
float-collections(*);
dce(*);
gcm(*);
}
phi-elim(*);
optimize!(*);
forkify(*);
fork-guard-elim(*);
dce(*);
fixpoint panic after 20 {
forkify(matmul);
fork-guard-elim(matmul);
fixpoint {
reduce-slf(*);
slf(*);
infer-schedules(*);
}
optimize!(*);
fixpoint panic after 20 {
reduce-slf(matmul);
slf(matmul);
infer-schedules(matmul);
fork-coalesce(*);
infer-schedules(*);
dce(*);
rewrite(*);
fixpoint {
simplify-cfg(*);
dce(*);
}
dce(matmul);
// Tile outer and middle loops into 32x32 sized blocks
fork-tile[32, 0, false, true](matmul@outer \ matmul@inner);
// Merge outer and middle loops and interchange so blocks are first
fork-coalesce(matmul@outer \ matmul@inner);
fork-interchange[1, 2](matmul@outer \ matmul@inner);
// Split forks
let split = fork-split(matmul);
// Join the threads and then blocks into a single fork each
fork-coalesce(split.matmul.fj2 \ matmul@inner);
fork-coalesce(split.matmul.fj0 \ split.matmul.fj2);
ip-sroa(*);
sroa(*);
dce(*);
let auto = auto-outline(*);
float-collections(*);
gpu(auto.matmul);
codegen!(*);
gcm(*);
Loading