├── core2MLIR ├── LICENSE ├── Core2MLIR │ ├── Parser.hs │ ├── HaskMLIR.hs │ └── HaskMLIRDialect.hs ├── Setup.hs ├── Main.hs ├── CHANGELOG.md ├── .gitignore ├── test-programs │ ├── .gitignore │ ├── fibstrict.hs │ └── dataconstructors.hs ├── stack.yaml.lock └── matmul-mlir.hs ├── test ├── test-ops.mlir ├── test-ops-roundtrip.mlir ├── .gitignore ├── playground.mlir ├── playground-roundtrip.mlir ├── CMakeLists.txt ├── case-usage-roundtrip.mlir └── makefile ├── nofib ├── real │ ├── gg │ │ ├── gg.stderr │ │ ├── NofibUtils.hs │ │ ├── gg.stdin-2.Z │ │ ├── example │ │ │ ├── README.nofib │ │ │ ├── report │ │ │ └── Report.tex │ │ ├── Makefile │ │ ├── report │ │ └── Report.tex │ ├── fem │ │ ├── inC │ │ │ ├── FEM_MODEL_DATA │ │ │ ├── run │ │ │ ├── database │ │ │ ├── data.1 │ │ │ ├── internalforce.c │ │ │ └── assemble_loadvec.c │ │ ├── NofibUtils.hs │ │ ├── data.0 │ │ ├── Makefile │ │ └── data.1 │ ├── bspt │ │ ├── bspt.stdin │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── Libfuns.lhs │ │ └── Main.hs │ ├── hidden │ │ ├── hidden.stdin │ │ ├── NofibUtils.hs │ │ ├── runtime_files │ │ │ ├── pyramid.plate │ │ │ └── cube.plate │ │ ├── Makefile │ │ ├── Rotate.lhs │ │ ├── Matrices.hs │ │ └── Main.hs │ ├── anna │ │ ├── NofibUtils.hs │ │ ├── anna.prescript │ │ ├── anna.postscript │ │ ├── cor_files │ │ │ ├── bomb.cor │ │ │ ├── parallelOr.cor │ │ │ ├── bug_Anna6.cor │ │ │ ├── append.cor │ │ │ ├── bomb2.cor │ │ │ ├── bug_Anna2.cor │ │ │ ├── realNasties.cor │ │ │ ├── concat.cor │ │ │ ├── concat22.cor │ │ │ ├── eta.cor │ │ │ ├── bug_types2.cor │ │ │ ├── reverse.cor │ │ │ ├── foldrFoldl.cor │ │ │ ├── mutualRec.cor │ │ │ ├── pairid.cor │ │ │ ├── bury.cor │ │ │ ├── john.cor │ │ │ ├── concat24.cor │ │ │ ├── bug_Anna5.cor │ │ │ ├── concat44.cor │ │ │ ├── bug_types1.cor │ │ │ ├── bug_Anna1.cor │ │ │ ├── ap_Unzip.cor │ │ │ ├── filter.cor │ │ │ ├── treeDepth.cor │ │ │ ├── poly_loseGain.cor │ │ │ ├── sebastian1.cor │ │ │ ├── sebastian2.cor │ │ │ ├── coreExpr0.cor │ │ │ └── bug.cor │ │ ├── nofib_driver │ │ ├── Makefile │ │ ├── Monstermakefile │ │ ├── runtime_files │ │ │ └── anna_table │ │ └── anna.faststdin │ ├── fluid │ │ ├── NofibUtils.hs │ │ ├── README │ │ ├── Makefile │ │ └── res8 │ ├── fulsom │ │ ├── NofibUtils.hs │ │ ├── pics │ │ │ └── sphere.gif │ │ ├── README.nofib │ │ └── Makefile │ ├── gamteb │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── inFortran │ │ │ └── fact.f │ │ ├── Main.hs │ │ └── inLML │ │ │ ├── gamteb.doc │ │ │ └── floatop.m.97 │ ├── grep │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── hpg │ │ ├── NofibUtils.hs │ │ ├── README.nofib │ │ └── Makefile │ ├── infer │ │ ├── NofibUtils.hs │ │ ├── TestTerm.hs │ │ ├── TestType.hs │ │ ├── Makefile │ │ ├── MyList.hs │ │ ├── infer.faststdin │ │ ├── StateX.hs │ │ └── infer.stdin │ ├── lift │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── linear │ │ ├── NofibUtils.hs │ │ ├── Absmatlib.lhs │ │ ├── AbsCg.lhs │ │ ├── Makefile │ │ └── Utils.lhs │ ├── mkhprog │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── parser │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── pic │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── Consts.hs │ │ ├── Main.hs │ │ └── PicType.hs │ ├── prolog │ │ ├── NofibUtils.hs │ │ ├── Version.hs │ │ ├── README.nofib │ │ ├── Makefile │ │ └── runtime_files │ │ │ └── stdlib │ ├── reptile │ │ ├── NofibUtils.hs │ │ ├── reptile.faststdin │ │ ├── Makefile │ │ ├── reptile.stdin │ │ ├── Interstate.hs │ │ ├── Diff.hs │ │ └── Main.hs │ ├── rsa │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── rsa.faststdin │ │ └── Main.hs │ ├── symalg │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── Ast.hs │ │ └── Env.hs │ ├── veritas │ │ ├── NofibUtils.hs │ │ ├── Tags.hs │ │ ├── grip-in │ │ ├── ThmTactics.hs │ │ ├── veritas.stdin │ │ ├── Makefile │ │ └── Globals.hs │ ├── compress │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ ├── README.nofib │ │ ├── BinTest.hs │ │ ├── Defaults.hs │ │ ├── PTTrees.hs │ │ └── Uncompress.hs │ ├── compress2 │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ └── inC │ │ │ ├── io_copy.c │ │ │ └── bin_conv.c │ ├── maillist │ │ ├── runtime_files │ │ │ └── fast │ │ └── Makefile │ ├── cacheprof │ │ └── Makefile │ ├── eff │ │ ├── FS │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ ├── CSD │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ ├── Makefile │ │ ├── CS │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ ├── VS │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ ├── S │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ ├── VSD │ │ │ ├── Makefile │ │ │ └── Main.hs │ │ └── VSM │ │ │ ├── Makefile │ │ │ └── Main.hs │ ├── Makefile │ └── scs │ │ └── runtime_files │ │ └── inverter.in ├── COMMIT ├── spectral │ ├── sorting │ │ ├── NofibUtils.hs │ │ ├── Makefile │ │ └── Main.hs │ ├── banner │ │ └── banner.stdin.template │ ├── para │ │ ├── c++ │ │ │ ├── part2 │ │ │ ├── Thin.h │ │ │ ├── Queue.h │ │ │ └── Para.h │ │ └── Makefile │ ├── scc │ │ ├── Makefile │ │ └── Main.hs │ ├── fft2 │ │ ├── old │ │ │ ├── fft2.stdout2 │ │ │ ├── fft2.stdout3 │ │ │ ├── fft2.stdout5 │ │ │ ├── fft2.stdout6 │ │ │ ├── fft2.stdout7 │ │ │ ├── fft2.stdout-mingw │ │ │ ├── fft2.stdout1 │ │ │ ├── fft2.stdout4 │ │ │ ├── fft2.slowstdout-x86-linux │ │ │ ├── fft2.slowstdout-x86_64 │ │ │ ├── fft2.stdout-x86_64 │ │ │ ├── fft2.slowstdout-x86-mingw │ │ │ └── Makefile │ │ ├── Makefile │ │ ├── README.nofib │ │ └── Complex_Vectors.lhs │ ├── pretty │ │ ├── Makefile │ │ └── Main.hs │ ├── cichelli │ │ ├── Interval.hs │ │ ├── Main.hs │ │ └── Makefile │ ├── expert │ │ ├── expert.stdin │ │ ├── Makefile │ │ └── runtime_files │ │ │ └── animals │ ├── puzzle │ │ └── Makefile │ ├── secretary │ │ └── Makefile │ ├── fish │ │ └── Makefile │ ├── gcd │ │ └── Makefile │ ├── atom │ │ └── Makefile │ ├── cryptarithm1 │ │ └── Makefile │ ├── eliza │ │ ├── Makefile │ │ └── eliza.stdin │ ├── exact-reals │ │ └── Makefile │ ├── last-piece │ │ └── Makefile │ ├── boyer │ │ └── Makefile │ ├── life │ │ ├── Makefile │ │ └── life.test │ ├── ansi │ │ └── Makefile │ ├── clausify │ │ └── Makefile │ ├── constraints │ │ └── Makefile │ ├── primetest │ │ ├── Makefile │ │ ├── Readme │ │ ├── mersenne607 │ │ └── primetest.faststdin │ ├── sphere │ │ └── Makefile │ ├── boyer2 │ │ ├── Makefile │ │ └── README │ ├── mandel2 │ │ └── Makefile │ ├── multiplier │ │ └── Makefile │ ├── cse │ │ └── Makefile │ ├── power │ │ └── Makefile │ ├── rewrite │ │ └── Makefile │ ├── minimax │ │ ├── Makefile │ │ ├── Main.hs │ │ ├── Prog.hs │ │ ├── Tree.hs │ │ └── Wins.hs │ ├── lcss │ │ └── Makefile │ ├── knights │ │ └── Makefile │ ├── fibheaps │ │ └── Makefile │ ├── lambda │ │ └── Makefile │ ├── hartel │ │ ├── fft │ │ │ └── Makefile │ │ ├── genfft │ │ │ └── Makefile │ │ ├── nucleic2 │ │ │ └── Makefile │ │ ├── solid │ │ │ └── Makefile │ │ ├── comp_lab_zift │ │ │ └── Makefile │ │ ├── wang │ │ │ └── Makefile │ │ ├── listcompr │ │ │ └── Makefile │ │ ├── listcopy │ │ │ └── Makefile │ │ ├── parstof │ │ │ └── Makefile │ │ ├── wave4main │ │ │ └── Makefile │ │ ├── event │ │ │ └── Makefile │ │ ├── sched │ │ │ └── Makefile │ │ ├── transform │ │ │ └── Makefile │ │ ├── typecheck │ │ │ └── Makefile │ │ ├── Makefile │ │ └── ida │ │ │ └── Makefile │ ├── cryptarithm2 │ │ └── Makefile │ ├── calendar │ │ └── Makefile │ ├── circsim │ │ └── Makefile │ ├── integer │ │ └── Makefile │ ├── mate │ │ ├── runtime_files │ │ │ ├── kohtz.soln │ │ │ ├── simple.soln │ │ │ ├── simple.prob │ │ │ ├── holzhausen.prob │ │ │ ├── kohtz.prob │ │ │ ├── marin.prob │ │ │ ├── shinkman.soln │ │ │ ├── heathcote3.prob │ │ │ ├── wurzburg.prob │ │ │ ├── kidson.prob │ │ │ ├── ellerman.prob │ │ │ ├── shinkman.prob │ │ │ ├── fridlizius.prob │ │ │ ├── heathcote3.soln │ │ │ ├── wurzburg.soln │ │ │ └── ellerman.soln │ │ ├── Main.hs │ │ └── Makefile │ ├── treejoin │ │ └── Makefile │ ├── simple │ │ └── Makefile │ ├── mandel │ │ └── Makefile │ ├── Makefile │ └── dom-lt │ │ ├── Makefile │ │ └── Main.hs ├── imaginary │ ├── bernouilli │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── digits-of-e1 │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── digits-of-e2 │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── gen_regexps │ │ ├── NofibUtils.hs │ │ └── Makefile │ ├── rfib │ │ ├── Makefile │ │ └── Main.hs │ ├── x2n1 │ │ └── Makefile │ ├── tak │ │ ├── Makefile │ │ └── Main.hs │ ├── wheel-sieve1 │ │ └── Makefile │ ├── integrate │ │ └── Makefile │ ├── queens │ │ ├── Makefile │ │ └── Main.hs │ ├── kahan │ │ └── Makefile │ ├── Makefile │ ├── primes │ │ ├── Makefile │ │ ├── Main.hs │ │ └── csieve.c │ ├── wheel-sieve2 │ │ └── Makefile │ ├── paraffins │ │ └── Makefile │ └── exp3_8 │ │ └── Makefile ├── smp │ ├── callback001 │ │ ├── cbits.h │ │ ├── cbits.c │ │ └── Makefile │ ├── callback002 │ │ ├── cbits.h │ │ ├── cbits.c │ │ ├── Makefile │ │ └── Main.hs │ ├── stm001 │ │ └── Makefile │ ├── threads007 │ │ ├── Makefile │ │ └── Main.hs │ ├── threads003 │ │ └── Makefile │ ├── threads004 │ │ └── Makefile │ ├── threads006 │ │ └── Makefile │ ├── threads002 │ │ └── Makefile │ ├── threads001 │ │ ├── Makefile │ │ └── Main.hs │ ├── chan │ │ ├── Makefile │ │ └── chan.hs │ ├── sieve │ │ └── Makefile │ ├── tchan │ │ └── Makefile │ ├── Makefile │ └── smpbench.sh ├── gc │ ├── happy │ │ ├── happy.expected │ │ ├── happy.stderr │ │ ├── Makefile │ │ ├── Target.lhs │ │ └── Paths_happy.hs │ ├── spellcheck │ │ ├── input │ │ ├── words │ │ ├── Makefile │ │ └── spellcheck.hs │ ├── fulsom │ │ ├── pics │ │ │ └── sphere.gif │ │ ├── README.nofib │ │ └── Makefile │ ├── mutstore1 │ │ ├── Makefile │ │ ├── Main.hs │ │ └── Store1.hs │ ├── mutstore2 │ │ ├── Makefile │ │ ├── Store2.hs │ │ └── Main.hs │ ├── hash │ │ ├── Makefile │ │ └── hash.hs │ ├── cacheprof │ │ └── Makefile │ ├── linear │ │ ├── Makefile │ │ ├── Absmatlib.lhs │ │ ├── AbsCg.lhs │ │ └── Utils.lhs │ ├── lcss │ │ └── Makefile │ ├── treejoin │ │ └── Makefile │ ├── circsim │ │ └── Makefile │ ├── power │ │ └── Makefile │ ├── constraints │ │ └── Makefile │ ├── fibheaps │ │ └── Makefile │ └── gc_bench │ │ └── Makefile ├── nofib-analyse │ ├── cabal.project │ ├── nofib-analyse.cabal │ └── Makefile ├── parallel │ ├── gray │ │ ├── foo │ │ ├── foo.gif │ │ ├── RayTrace.hs │ │ ├── Misc.hs │ │ ├── CSG.hs │ │ ├── Main.hs │ │ ├── Primitives.hs │ │ └── Makefile │ ├── cfd │ │ ├── Makefile │ │ ├── Quad_def.hs │ │ ├── Main.hs │ │ └── Norm.hs │ ├── OLD │ │ ├── NESL │ │ │ └── Makefile │ │ ├── bom │ │ │ └── Makefile │ │ ├── soda │ │ │ └── Makefile │ │ ├── par001 │ │ │ └── Makefile │ │ ├── soda7 │ │ │ └── Makefile │ │ └── parfact │ │ │ └── Makefile │ ├── nbody │ │ ├── Makefile │ │ └── Future.hs │ ├── prsa │ │ ├── Makefile │ │ └── Main.hs │ ├── ray │ │ └── Makefile │ ├── parfib │ │ └── Makefile │ ├── partree │ │ └── Makefile │ ├── queens │ │ └── Makefile │ ├── blackscholes │ │ ├── Makefile │ │ └── Future.hs │ ├── dcbm │ │ ├── Makefile │ │ ├── Delay.hs │ │ ├── Primitives.lhi │ │ └── DbParallel.hs │ ├── mandel │ │ └── Makefile │ ├── partak │ │ └── Makefile │ ├── sumeuler │ │ └── Makefile │ ├── linsolv │ │ └── Makefile │ ├── minimax │ │ ├── Makefile │ │ ├── Main.hs │ │ └── Wins.hs │ ├── coins │ │ └── Makefile │ ├── matmult │ │ └── Makefile │ └── transclos │ │ └── Makefile ├── CODEOWNERS ├── .arcconfig ├── docs │ └── paper │ │ ├── slides-root.tex │ │ ├── nofib_only.bib │ │ ├── Jmakefile │ │ ├── run.txt │ │ └── compile.txt ├── runstdtest │ └── Makefile └── mk │ └── suffix.mk ├── hask98 ├── .gitignore ├── haskell98-report.pdf ├── main.cpp └── CMakeLists.txt ├── .clang-format ├── reading ├── reference-ghc-dump │ ├── .gitmodules │ ├── COMMIT │ ├── cabal.project │ ├── ghc-dump-core │ │ ├── Setup.hs │ │ └── GhcDump │ │ │ └── Setup.hs │ ├── ghc-dump-mlir │ │ ├── Setup.hs │ │ └── src │ │ │ └── GhcDump │ │ │ └── Repl.hs │ ├── ghc-dump-util │ │ ├── Setup.hs │ │ └── src │ │ │ └── GhcDump │ │ │ └── Repl.hs │ ├── fib.hs │ └── .gitignore ├── core.pdf ├── rvsdg.pdf ├── projection-impl │ ├── README.md │ ├── length.hs │ ├── doubles.hs │ ├── append.hs │ ├── before.hs │ └── makefile ├── reduceron.pdf ├── let-floating.pdf ├── anf-continued.pdf ├── haskell98-report.pdf ├── in-and-out-of-ssa.pdf ├── grin-modern-reading.pdf ├── grin-original-paper.pdf ├── push-enter-eval-apply.pdf ├── counting-immutable-beans.pdf ├── static-single-information.pdf ├── call-by-need-supercompilation.pdf ├── gibbon-tree-transforms-packed.pdf ├── johachim-call-arity-analysis.pdf ├── ssa-is-functional-programming.pdf ├── types-are-calling-conventions.pdf ├── denotational-semantics-for-imp.pdf ├── secrets-of-GHC-compiler-inliner.pdf ├── work-it-wrap-it-fix-it-fold-it.pdf ├── the-worker-wrapper-transformation.pdf ├── automatic-simd-vectorization-haskell.pdf ├── constructed-product-result-analysis.pdf ├── intell-labs-haskell-research-compiler.pdf ├── implementing-projection-strictness-anal.pdf ├── karrenberg-whole-function-vectorization.pdf ├── makefile ├── sebastian-graf-call-arity-versus-demand.pdf ├── asap-as-static-as-possible-memory-management.pdf ├── compiling-without-continuations-join-points.pdf ├── the-implementation-of-gofer-functional-system.pdf ├── projections-for-strictness-analysis-hughes-wadler.pdf ├── theory-and-practice-of-demand-analysis-in-haskell.pdf ├── modular-higher-order-cardinality-analysis-in-theory-and-practice.pdf ├── optimistic-evaluation-an-adaptive-evaluation-strategy-for-non-strict-programs.pdf ├── the-ssa-representation-framework-semntics-analyses-and-gcc-implementation-sebpop.pdf └── STG-implementing-functional-languages-on-stock-hardware-spineless-tagless-g-machine.pdf ├── lib ├── CMakeLists.txt └── Hask │ └── CMakeLists.txt ├── include ├── CMakeLists.txt └── Hask │ └── CMakeLists.txt ├── thesis └── makefile ├── Dockerfile ├── docs └── index.html ├── ghc-benchmarks ├── .gitignore ├── makefile ├── print-lazy-and-strict.hs └── matmul.hs ├── proposals.md └── entrypoint.sh /core2MLIR/LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/test-ops.mlir: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nofib/real/gg/gg.stderr: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hask98/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /nofib/real/fem/inC/FEM_MODEL_DATA: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | -------------------------------------------------------------------------------- /nofib/real/bspt/bspt.stdin: -------------------------------------------------------------------------------- 1 | batch 2 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Hask) 2 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Hask) 2 | -------------------------------------------------------------------------------- /nofib/real/gg/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/hidden/hidden.stdin: -------------------------------------------------------------------------------- 1 | 2,10,3 2 | quit 3 | -------------------------------------------------------------------------------- /test/test-ops-roundtrip.mlir: -------------------------------------------------------------------------------- 1 | 2 | 3 | module { 4 | } -------------------------------------------------------------------------------- /nofib/COMMIT: -------------------------------------------------------------------------------- 1 | f34b90b5a6ce46284693119a06d1133908b11856 2 | -------------------------------------------------------------------------------- /nofib/real/anna/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/bspt/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/fem/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/fluid/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/fulsom/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/gamteb/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/grep/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/hidden/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/hpg/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/infer/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/lift/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/linear/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/mkhprog/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/parser/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/pic/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/prolog/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/reptile/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/reptile/reptile.faststdin: -------------------------------------------------------------------------------- 1 | cs 164 26 326 384 2 | -------------------------------------------------------------------------------- /nofib/real/rsa/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/symalg/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/veritas/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | # stuff generated by lit 2 | Output 3 | -------------------------------------------------------------------------------- /core2MLIR/Core2MLIR/Parser.hs: -------------------------------------------------------------------------------- 1 | module Core2MLIR.Parser where 2 | -------------------------------------------------------------------------------- /nofib/real/compress/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/real/compress2/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/spectral/sorting/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/imaginary/bernouilli/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/imaginary/digits-of-e1/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/imaginary/digits-of-e2/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /nofib/imaginary/gen_regexps/NofibUtils.hs: -------------------------------------------------------------------------------- 1 | ../../common/NofibUtils.hs -------------------------------------------------------------------------------- /core2MLIR/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /nofib/real/prolog/Version.hs: -------------------------------------------------------------------------------- 1 | module Version where version="stack based" 2 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/COMMIT: -------------------------------------------------------------------------------- 1 | 0a51fba46ea1ffb7c2862caf084f4aad9a921fde 2 | -------------------------------------------------------------------------------- /nofib/real/anna/anna.prescript: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | export ANNADIR; ANNADIR=`pwd` 3 | -------------------------------------------------------------------------------- /reading/core.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/core.pdf -------------------------------------------------------------------------------- /thesis/makefile: -------------------------------------------------------------------------------- 1 | thesis.pdf: thesis.tex 2 | pdflatex thesis.tex --shell-escape 3 | -------------------------------------------------------------------------------- /nofib/real/maillist/runtime_files/fast: -------------------------------------------------------------------------------- 1 | Name1 2 | Address1 3 | City1 4 | Country1 5 | -------------------------------------------------------------------------------- /nofib/smp/callback001/cbits.h: -------------------------------------------------------------------------------- 1 | typedef void FUNC(); 2 | 3 | void callC( FUNC* f); 4 | -------------------------------------------------------------------------------- /nofib/smp/callback002/cbits.h: -------------------------------------------------------------------------------- 1 | typedef void FUNC(); 2 | 3 | void callC( FUNC* f); 4 | -------------------------------------------------------------------------------- /nofib/spectral/banner/banner.stdin.template: -------------------------------------------------------------------------------- 1 | Hello. 2 | Is this not a great banner? 3 | -------------------------------------------------------------------------------- /reading/rvsdg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/rvsdg.pdf -------------------------------------------------------------------------------- /core2MLIR/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = putStrLn "tool" 5 | -------------------------------------------------------------------------------- /nofib/gc/happy/happy.expected: -------------------------------------------------------------------------------- 1 | shift/reduce conflicts: 33 2 | reduce/reduce conflicts: 1 3 | -------------------------------------------------------------------------------- /nofib/gc/happy/happy.stderr: -------------------------------------------------------------------------------- 1 | shift/reduce conflicts: 33 2 | reduce/reduce conflicts: 1 3 | -------------------------------------------------------------------------------- /nofib/nofib-analyse/cabal.project: -------------------------------------------------------------------------------- 1 | -- project file for "boot" utilities 2 | packages: . 3 | -------------------------------------------------------------------------------- /nofib/real/anna/anna.postscript: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | sum < $o1 > $o1.xx 3 | mv -f $o1.xx $o1 4 | -------------------------------------------------------------------------------- /reading/projection-impl/README.md: -------------------------------------------------------------------------------- 1 | # An implementation of projection based demand analysis 2 | -------------------------------------------------------------------------------- /reading/reduceron.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/reduceron.pdf -------------------------------------------------------------------------------- /nofib/parallel/gray/foo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/parallel/gray/foo -------------------------------------------------------------------------------- /reading/let-floating.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/let-floating.pdf -------------------------------------------------------------------------------- /nofib/gc/spellcheck/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/gc/spellcheck/input -------------------------------------------------------------------------------- /nofib/gc/spellcheck/words: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/gc/spellcheck/words -------------------------------------------------------------------------------- /nofib/real/fluid/README: -------------------------------------------------------------------------------- 1 | compiling: make 2 | 3 | usage: main < chan.hed 4 | 5 | results: see res8 6 | -------------------------------------------------------------------------------- /nofib/real/gg/gg.stdin-2.Z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/gg/gg.stdin-2.Z -------------------------------------------------------------------------------- /nofib/real/veritas/Tags.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/veritas/Tags.hs -------------------------------------------------------------------------------- /nofib/real/veritas/grip-in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/veritas/grip-in -------------------------------------------------------------------------------- /reading/anf-continued.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/anf-continued.pdf -------------------------------------------------------------------------------- /reading/reference-ghc-dump/cabal.project: -------------------------------------------------------------------------------- 1 | packages: ./ghc-dump-core, ./ghc-dump-util ./ghc-dump-mlir 2 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-core/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-mlir/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-util/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /hask98/haskell98-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/hask98/haskell98-report.pdf -------------------------------------------------------------------------------- /nofib/parallel/gray/foo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/parallel/gray/foo.gif -------------------------------------------------------------------------------- /nofib/real/gg/example/README.nofib: -------------------------------------------------------------------------------- 1 | This is an *actually useful* program from Iain Checkland at York. 2 | -------------------------------------------------------------------------------- /nofib/spectral/para/c++/part2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/spectral/para/c++/part2 -------------------------------------------------------------------------------- /reading/haskell98-report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/haskell98-report.pdf -------------------------------------------------------------------------------- /reading/in-and-out-of-ssa.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/in-and-out-of-ssa.pdf -------------------------------------------------------------------------------- /nofib/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Syntax: https://docs.gitlab.com/ee/user/project/code_owners.html 2 | 3 | * @sgraf812 @bgamari -------------------------------------------------------------------------------- /nofib/gc/fulsom/pics/sphere.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/gc/fulsom/pics/sphere.gif -------------------------------------------------------------------------------- /reading/grin-modern-reading.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/grin-modern-reading.pdf -------------------------------------------------------------------------------- /reading/grin-original-paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/grin-original-paper.pdf -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-core/GhcDump/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /nofib/parallel/cfd/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | -------------------------------------------------------------------------------- /nofib/real/fulsom/pics/sphere.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/fulsom/pics/sphere.gif -------------------------------------------------------------------------------- /nofib/real/parser/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | -------------------------------------------------------------------------------- /nofib/real/veritas/ThmTactics.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/veritas/ThmTactics.hs -------------------------------------------------------------------------------- /nofib/real/veritas/veritas.stdin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/nofib/real/veritas/veritas.stdin -------------------------------------------------------------------------------- /reading/projection-impl/length.hs: -------------------------------------------------------------------------------- 1 | (length [xs] 2 | (case xs 3 | NIL 4 | y ys (+ 1 (length ys)))) 5 | 6 | -------------------------------------------------------------------------------- /reading/push-enter-eval-apply.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/push-enter-eval-apply.pdf -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bomb.cor: -------------------------------------------------------------------------------- 1 | ;; 2 | 3 | bomb x = let f = \y -> y*x 4 | in let g = \z -> f z 5 | in g 5; 6 | 7 | -------------------------------------------------------------------------------- /reading/counting-immutable-beans.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/counting-immutable-beans.pdf -------------------------------------------------------------------------------- /reading/projection-impl/doubles.hs: -------------------------------------------------------------------------------- 1 | (doubles [xs] 2 | (case xs 3 | NIL 4 | y ys (CONS (* 2 y) (doubles ys)))) 5 | -------------------------------------------------------------------------------- /nofib/real/cacheprof/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /reading/projection-impl/append.hs: -------------------------------------------------------------------------------- 1 | (append [xs zs] 2 | (case xs 3 | zs 4 | y ys (CONS y (append ys zs)))) 5 | 6 | -------------------------------------------------------------------------------- /reading/static-single-information.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/static-single-information.pdf -------------------------------------------------------------------------------- /reading/call-by-need-supercompilation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/call-by-need-supercompilation.pdf -------------------------------------------------------------------------------- /reading/gibbon-tree-transforms-packed.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/gibbon-tree-transforms-packed.pdf -------------------------------------------------------------------------------- /reading/johachim-call-arity-analysis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/johachim-call-arity-analysis.pdf -------------------------------------------------------------------------------- /reading/ssa-is-functional-programming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/ssa-is-functional-programming.pdf -------------------------------------------------------------------------------- /reading/types-are-calling-conventions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/types-are-calling-conventions.pdf -------------------------------------------------------------------------------- /nofib/real/anna/nofib_driver: -------------------------------------------------------------------------------- 1 | #!/bin/csh 2 | setenv ANNADIR `pwd` 3 | Anna400 -S -H4000000 - -fPolyLim11 -fForceAll < preludeList.cor 4 | -------------------------------------------------------------------------------- /nofib/real/reptile/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /nofib/real/rsa/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /nofib/smp/callback001/cbits.c: -------------------------------------------------------------------------------- 1 | #include "cbits.h" 2 | 3 | void callC( FUNC* f) { 4 | int i; 5 | for(i=0;i<1000;i++) f(); 6 | } 7 | -------------------------------------------------------------------------------- /nofib/spectral/scc/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /reading/denotational-semantics-for-imp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/denotational-semantics-for-imp.pdf -------------------------------------------------------------------------------- /reading/projection-impl/before.hs: -------------------------------------------------------------------------------- 1 | (before [xs] 2 | (case xs 3 | NIL 4 | y ys (if (= y 0) NIL (CONS y (before ys))))) 5 | 6 | -------------------------------------------------------------------------------- /reading/secrets-of-GHC-compiler-inliner.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/secrets-of-GHC-compiler-inliner.pdf -------------------------------------------------------------------------------- /reading/work-it-wrap-it-fix-it-fold-it.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/work-it-wrap-it-fix-it-fold-it.pdf -------------------------------------------------------------------------------- /nofib/parallel/OLD/NESL/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /nofib/parallel/OLD/bom/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /nofib/parallel/OLD/soda/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout2: -------------------------------------------------------------------------------- 1 | result1 = 2.65193921505278e-12 2 | result2 = 2.65193921505278e-12 3 | result3 = 4.829354338653502e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout3: -------------------------------------------------------------------------------- 1 | result1 = 2.649890074691411e-12 2 | result2 = 2.649890074691411e-12 3 | result3 = 4.829354338653502e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout5: -------------------------------------------------------------------------------- 1 | result1 = 2.1055800293665075e-12 2 | result2 = 2.292037151849622e-12 3 | result3 = 3.47836817127245e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout6: -------------------------------------------------------------------------------- 1 | result1 = 2.649890074691411e-12 2 | result2 = 2.292037151849622e-12 3 | result3 = 4.829354338653502e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout7: -------------------------------------------------------------------------------- 1 | result1 = 2.59635799135966e-12 2 | result2 = 2.59635799135966e-12 3 | result3 = 4.8279900966008427e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/pretty/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | -------------------------------------------------------------------------------- /reading/the-worker-wrapper-transformation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/the-worker-wrapper-transformation.pdf -------------------------------------------------------------------------------- /nofib/gc/fulsom/README.nofib: -------------------------------------------------------------------------------- 1 | I have flattened most of Duncan's directory structure, as I have 2 | simpler nofibbing needs. 3 | 4 | Will Partain 5 | -------------------------------------------------------------------------------- /nofib/spectral/cichelli/Interval.hs: -------------------------------------------------------------------------------- 1 | module Interval where 2 | 3 | polling = 5::Int 4 | 5 | interval = 3::Int 6 | 7 | threshold = 100::Int 8 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout-mingw: -------------------------------------------------------------------------------- 1 | result1 = 2.292037151849622e-12 2 | result2 = 2.292037151849622e-12 3 | result3 = 4.829354338653502e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout1: -------------------------------------------------------------------------------- 1 | result1 = 2.649481680521651e-12 2 | result2 = 2.649481680521651e-12 3 | result3 = 4.8314916512026684e-8 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout4: -------------------------------------------------------------------------------- 1 | result1 = 2.292037151849622e-12 2 | result2 = 2.292037151849622e-12 3 | result3 = 3.4766401313390816e-8 4 | -------------------------------------------------------------------------------- /reading/automatic-simd-vectorization-haskell.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/automatic-simd-vectorization-haskell.pdf -------------------------------------------------------------------------------- /reading/constructed-product-result-analysis.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/constructed-product-result-analysis.pdf -------------------------------------------------------------------------------- /reading/intell-labs-haskell-research-compiler.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/intell-labs-haskell-research-compiler.pdf -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/parallelOr.cor: -------------------------------------------------------------------------------- 1 | 2 | ;; 3 | 4 | parallelOr a b c = a # b # c; 5 | 6 | f a = a # a; 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/fulsom/README.nofib: -------------------------------------------------------------------------------- 1 | I have flattened most of Duncan's directory structure, as I have 2 | simpler nofibbing needs. 3 | 4 | Will Partain 5 | -------------------------------------------------------------------------------- /nofib/smp/stm001/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -package stm 5 | 6 | include $(TOP)/mk/target.mk 7 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.slowstdout-x86-linux: -------------------------------------------------------------------------------- 1 | result1 = 21167.208319565725 2 | result2 = 2.545411058145088e-11 3 | result3 = 2.380963223913568e-6 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.slowstdout-x86_64: -------------------------------------------------------------------------------- 1 | result1 = 21167.208319565725 2 | result2 = 2.5474713264389584e-11 3 | result3 = 2.2515139335155254e-6 4 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/fft2.stdout-x86_64: -------------------------------------------------------------------------------- 1 | result1 = 2.649891777856828e-12 2 | result2 = 2.649891777856828e-12 3 | result3 = 4.829990984944743e-8 4 | -------------------------------------------------------------------------------- /reading/implementing-projection-strictness-anal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/implementing-projection-strictness-anal.pdf -------------------------------------------------------------------------------- /reading/karrenberg-whole-function-vectorization.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/karrenberg-whole-function-vectorization.pdf -------------------------------------------------------------------------------- /reading/makefile: -------------------------------------------------------------------------------- 1 | sep-30-worker-wrapper.out: sep-30-worker-wrapper.cpp 2 | g++ -std=c++17 -O0 sep-30-worker-wrapper.cpp -o sep-30-worker-wrapper.out 3 | -------------------------------------------------------------------------------- /reading/sebastian-graf-call-arity-versus-demand.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/sebastian-graf-call-arity-versus-demand.pdf -------------------------------------------------------------------------------- /core2MLIR/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Revision history for core2mlir 2 | 3 | ## 0.1.0.0 -- YYYY-mm-dd 4 | 5 | * First version. Released on an unsuspecting world. 6 | -------------------------------------------------------------------------------- /nofib/real/infer/TestTerm.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Parse 4 | import Term 5 | main = interact (linesP (reads :: (Parse String Term))) 6 | -------------------------------------------------------------------------------- /nofib/real/infer/TestType.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Parse 4 | import Type 5 | main = interact (linesP (reads :: (Parse String Type))) 6 | -------------------------------------------------------------------------------- /nofib/real/symalg/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | EXTRA_RUNTEST_OPTS += +RTS -M140m -RTS 4 | include $(TOP)/mk/target.mk 5 | -------------------------------------------------------------------------------- /nofib/smp/callback002/cbits.c: -------------------------------------------------------------------------------- 1 | #include "cbits.h" 2 | 3 | int count; 4 | 5 | void callC( FUNC* f) { 6 | int i; 7 | for(i=0;i> qw 2 | fem < data.1 3 | date >> qw 4 | date >> qw 5 | fem < data.2 6 | date >> qw 7 | date >> qw 8 | fem < data.3 9 | date >> qw 10 | 11 | -------------------------------------------------------------------------------- /nofib/real/infer/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | SRC_HC_OPTS += -cpp 4 | EXCLUDED_SRCS=TestType.hs TestTerm.hs 5 | include $(TOP)/mk/target.mk 6 | 7 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/old/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 512 6 | NORM_OPTS = 512 7 | SLOW_OPTS = 1500 8 | -------------------------------------------------------------------------------- /nofib/spectral/fish/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 30 6 | NORM_OPTS = 300 7 | SLOW_OPTS = 1500 8 | -------------------------------------------------------------------------------- /nofib/spectral/gcd/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 400 6 | NORM_OPTS = 1200 7 | SLOW_OPTS = 2700 8 | -------------------------------------------------------------------------------- /nofib/parallel/nbody/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 3000 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/parallel/prsa/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 500000 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/parallel/ray/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 1000 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_Anna6.cor: -------------------------------------------------------------------------------- 1 | 2 | pair a b ::= Pair a b; 3 | 4 | ;; 5 | 6 | apply2 f x y = f x y; 7 | 8 | aaa x y = Pair x y; 9 | 10 | bbb x y = apply2 Pair x y; -------------------------------------------------------------------------------- /nofib/real/eff/CS/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts -package transformers 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /nofib/real/eff/VS/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts -package transformers 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /nofib/real/fem/data.0: -------------------------------------------------------------------------------- 1 | 3 2 1 1 2 | 3 | -1.0 0.0 330 4 | 0.0 5.0 110 5 | 1.0 0.0 330 6 | 7 | 8 | 1 2 1 9 | 3 2 1 10 | 11 | 60000.0 0.0 12 | 13 | 2 0.0 -1.0 0.0 14 | 15 | -------------------------------------------------------------------------------- /nofib/real/prolog/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | EXCLUDED_SRCS=PureEngine.hs StackEngine.hs 4 | -include opts.mk 5 | include $(TOP)/mk/target.mk 6 | 7 | -------------------------------------------------------------------------------- /nofib/spectral/atom/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 1000 5 | NORM_OPTS = 2500 6 | SLOW_OPTS = 4000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/cryptarithm1/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 1 7 | NORM_OPTS = 3 8 | SLOW_OPTS = 15 9 | -------------------------------------------------------------------------------- /nofib/spectral/eliza/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 1300 6 | NORM_OPTS = 13000 7 | SLOW_OPTS = 65000 8 | -------------------------------------------------------------------------------- /nofib/spectral/expert/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 1000 6 | NORM_OPTS = 10000 7 | SLOW_OPTS = 50000 8 | -------------------------------------------------------------------------------- /nofib/gc/mutstore1/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100000 5 | NORM_OPTS = 500000 6 | SLOW_OPTS = 1000000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/gc/mutstore2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100000 5 | NORM_OPTS = 300000 6 | SLOW_OPTS = 600000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/imaginary/digits-of-e1/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 50 7 | NORM_OPTS = 150 8 | SLOW_OPTS = 320 9 | -------------------------------------------------------------------------------- /nofib/imaginary/digits-of-e2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 90 7 | NORM_OPTS = 300 8 | SLOW_OPTS = 650 9 | -------------------------------------------------------------------------------- /nofib/parallel/parfib/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_RUNTEST_OPTS += 43 11 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | -------------------------------------------------------------------------------- /nofib/parallel/partree/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 300 100 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/parallel/queens/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_RUNTEST_OPTS += 13 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | -------------------------------------------------------------------------------- /nofib/smp/threads003/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 5000 5 | NORM_OPTS = 20000 6 | SLOW_OPTS = 40000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/smp/threads004/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 5000 5 | NORM_OPTS = 10000 6 | SLOW_OPTS = 20000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/smp/threads006/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 10000 5 | NORM_OPTS = 200000 6 | SLOW_OPTS = 500000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/exact-reals/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 60 7 | NORM_OPTS = 350 8 | SLOW_OPTS = 800 9 | -------------------------------------------------------------------------------- /nofib/spectral/last-piece/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -package containers -package pretty 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /reading/projection-impl/makefile: -------------------------------------------------------------------------------- 1 | projection.out: projection.cpp sexpr.h 2 | g++ -std=c++17 -g -O0 -fsanitize=address -fsanitize=undefined projection.cpp -o projection.out -static-libasan 3 | -------------------------------------------------------------------------------- /nofib/imaginary/rfib/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 35 7 | NORM_OPTS = 40 8 | SLOW_OPTS = 43 9 | -------------------------------------------------------------------------------- /nofib/imaginary/x2n1/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 1000000 6 | NORM_OPTS = 8000000 7 | SLOW_OPTS = 30000000 8 | -------------------------------------------------------------------------------- /nofib/real/eff/S/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts -package transformers -package mtl 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /nofib/smp/threads002/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100000 5 | NORM_OPTS = 1000000 6 | SLOW_OPTS = 10000000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/boyer/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 2 7 | NORM_OPTS = 15 8 | SLOW_OPTS = 75 9 | -------------------------------------------------------------------------------- /nofib/spectral/cichelli/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Prog (prog) 4 | import System.Environment 5 | 6 | main = do 7 | (n:_) <- getArgs 8 | mapM_ (putStr . prog) [1..read n] 9 | -------------------------------------------------------------------------------- /nofib/spectral/life/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 15 7 | NORM_OPTS = 27 8 | SLOW_OPTS = 29 9 | -------------------------------------------------------------------------------- /nofib/real/eff/VSD/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts -package transformers -package mtl 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /nofib/real/eff/VSM/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts -package transformers -package mtl 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | -------------------------------------------------------------------------------- /nofib/real/gamteb/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 100 7 | NORM_OPTS = 1000 8 | SLOW_OPTS = 5000 9 | -------------------------------------------------------------------------------- /nofib/smp/callback001/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100 5 | NORM_OPTS = 500 6 | SLOW_OPTS = 2000 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | -------------------------------------------------------------------------------- /nofib/smp/threads001/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 1000000 5 | NORM_OPTS = 10000000 6 | SLOW_OPTS = 100000000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/ansi/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 150 7 | NORM_OPTS = 400 8 | SLOW_OPTS = 900 9 | -------------------------------------------------------------------------------- /nofib/spectral/cichelli/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 6 7 | NORM_OPTS = 60 8 | SLOW_OPTS = 300 9 | -------------------------------------------------------------------------------- /nofib/spectral/clausify/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 1 7 | NORM_OPTS = 7 8 | SLOW_OPTS = 35 9 | -------------------------------------------------------------------------------- /nofib/spectral/constraints/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 6 5 | NORM_OPTS = 7 6 | SLOW_OPTS = 8 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | -------------------------------------------------------------------------------- /nofib/spectral/primetest/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | # fast/norm/slow stuff done with separate stdin files 7 | -------------------------------------------------------------------------------- /nofib/spectral/sphere/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | FAST_OPTS = 30 4 | NORM_OPTS = 100 5 | SLOW_OPTS = 250 6 | 7 | include $(TOP)/mk/boilerplate.mk 8 | include $(TOP)/mk/target.mk 9 | 10 | -------------------------------------------------------------------------------- /reading/modular-higher-order-cardinality-analysis-in-theory-and-practice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/modular-higher-order-cardinality-analysis-in-theory-and-practice.pdf -------------------------------------------------------------------------------- /reading/reference-ghc-dump/fib.hs: -------------------------------------------------------------------------------- 1 | fib :: Int -> Int 2 | fib i = case i of 3 | 0 -> 0 4 | 1 -> 1 5 | n -> fib n + fib (n - 1) 6 | main :: IO (); main = print (fib 10) 7 | -------------------------------------------------------------------------------- /nofib/parallel/blackscholes/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 10000 15000000 5 | SRC_HC_OPTS += -package parallel 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/append.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); ;; 3 | 4 | append l1 l2 = case l1 of 5 | Nil -> l2; 6 | Cons x xs -> Cons x (append xs l2) 7 | end; 8 | 9 | 10 | -------------------------------------------------------------------------------- /nofib/smp/chan/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100000 5 | NORM_OPTS = 5000000 6 | SLOW_OPTS = 50000000 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | -------------------------------------------------------------------------------- /nofib/spectral/boyer2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 60 7 | NORM_OPTS = 600 8 | SLOW_OPTS = 3000 9 | -------------------------------------------------------------------------------- /nofib/spectral/mandel2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 60 7 | NORM_OPTS = 600 8 | SLOW_OPTS = 3000 9 | -------------------------------------------------------------------------------- /nofib/spectral/multiplier/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 32 7 | NORM_OPTS = 256 8 | SLOW_OPTS = 512 9 | -------------------------------------------------------------------------------- /nofib/docs/paper/slides-root.tex: -------------------------------------------------------------------------------- 1 | \documentstyle{slides} 2 | \pagestyle{empty} 3 | %\onlyslides{1-99} 4 | %\onlynotes{1-99} 5 | \begin{document} 6 | \blackandwhite{slides} 7 | %\input{slides} 8 | \end{document} 9 | -------------------------------------------------------------------------------- /nofib/imaginary/tak/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 31 16 8 7 | NORM_OPTS = 35 17 8 8 | SLOW_OPTS = 36 18 8 9 | -------------------------------------------------------------------------------- /nofib/smp/callback002/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 300000 5 | NORM_OPTS = 3000000 6 | SLOW_OPTS = 30000000 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | -------------------------------------------------------------------------------- /nofib/spectral/cse/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 30000 7 | NORM_OPTS = 300000 8 | SLOW_OPTS = 1500000 9 | -------------------------------------------------------------------------------- /nofib/spectral/power/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 14 7 | NORM_OPTS = 26 8 | SLOW_OPTS = 36 9 | 10 | -------------------------------------------------------------------------------- /nofib/spectral/primetest/Readme: -------------------------------------------------------------------------------- 1 | This benchmark tests the Mersenne Prime 2^607-1 for primality. 2 | Hopefully it concludes that the number is indeed prime. 3 | 4 | To use type: 5 | 6 | prime < mersenne607 7 | -------------------------------------------------------------------------------- /nofib/spectral/rewrite/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 20000 7 | NORM_OPTS = 250000 8 | SLOW_OPTS = 1200000 9 | -------------------------------------------------------------------------------- /nofib/spectral/sorting/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 600 Main.hs 7 | NORM_OPTS = 600 Sort.hs 8 | SLOW_OPTS = 3000 Sort.hs 9 | -------------------------------------------------------------------------------- /nofib/imaginary/wheel-sieve1/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 3000 7 | NORM_OPTS = 12000 8 | SLOW_OPTS = 40000 9 | -------------------------------------------------------------------------------- /nofib/real/lift/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 400 7 | NORM_OPTS = 4000 8 | SLOW_OPTS = 20000 9 | 10 | -------------------------------------------------------------------------------- /nofib/spectral/minimax/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 180000 7 | NORM_OPTS = 1800000 8 | SLOW_OPTS = 9000000 9 | -------------------------------------------------------------------------------- /hask98/main.cpp: -------------------------------------------------------------------------------- 1 | // Haskell 98 parser that builds an AST of Hask98 sources. 2 | // Read the Haskell98 report here: https://www.haskell.org/definition/haskell98-report.pdf 3 | 4 | int main() { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bomb2.cor: -------------------------------------------------------------------------------- 1 | 2 | ;; 3 | 4 | test x 5 | = let 6 | f = \y -> x * y 7 | in letrec 8 | r1 = \z -> f z + r2 z; 9 | r2 = \w -> r1 w 10 | in r1 x; 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/bspt/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | 5 | include $(TOP)/mk/target.mk 6 | 7 | FAST_OPTS = 2500 8 | NORM_OPTS = 25000 9 | SLOW_OPTS = 125000 10 | -------------------------------------------------------------------------------- /nofib/real/anna/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | # If you want to adjust running time, take more or less functions from 7 | # anna.full as the new stdin. 8 | -------------------------------------------------------------------------------- /nofib/spectral/lcss/Makefile: -------------------------------------------------------------------------------- 1 | TOP=../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 1 2 60 30 31 90 5 | NORM_OPTS = 1 2 200 100 101 300 6 | SLOW_OPTS = 1 2 300 150 151 450 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/primetest/mersenne607: -------------------------------------------------------------------------------- 1 | 531137992816767098689588206552468627329593117727031923199444138200403559860852242739162502265229285668889329486246501015346579337652707239409519978766587351943831270835393219031728127 2 | -------------------------------------------------------------------------------- /reading/optimistic-evaluation-an-adaptive-evaluation-strategy-for-non-strict-programs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/optimistic-evaluation-an-adaptive-evaluation-strategy-for-non-strict-programs.pdf -------------------------------------------------------------------------------- /nofib/imaginary/integrate/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | -include opts.mk 5 | include $(TOP)/mk/target.mk 6 | 7 | FAST_OPTS = 100000 8 | NORM_OPTS = 1000000 9 | SLOW_OPTS = 5000000 10 | -------------------------------------------------------------------------------- /nofib/real/compress2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -fglasgow-exts 5 | 6 | # Input files taken from http://mattmahoney.net/dc/enwik8.zip 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/real/fem/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 20 # 10 is too unstable 7 | NORM_OPTS = 100 8 | SLOW_OPTS = 500 9 | 10 | -------------------------------------------------------------------------------- /nofib/smp/sieve/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 10 5 | NORM_OPTS = 100 6 | SLOW_OPTS = 500 7 | 8 | SRC_HC_OPTS += -package old-time 9 | 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/imaginary/queens/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | SRCS = Main.hs 7 | 8 | FAST_OPTS = 12 9 | NORM_OPTS = 13 10 | SLOW_OPTS = 14 11 | -------------------------------------------------------------------------------- /nofib/spectral/knights/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp 5 | 6 | FAST_OPTS = 8 1 7 | NORM_OPTS = 14 1 8 | SLOW_OPTS = 20 1 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /reading/the-ssa-representation-framework-semntics-analyses-and-gcc-implementation-sebpop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/the-ssa-representation-framework-semntics-analyses-and-gcc-implementation-sebpop.pdf -------------------------------------------------------------------------------- /nofib/docs/paper/nofib_only.bib: -------------------------------------------------------------------------------- 1 | @misc{reillyjw92a, 2 | author = "Jeff Reilly", 3 | title = "{Unix Systems Performance, Intel}; personal communication", 4 | year = 1992, 5 | month = jun, 6 | bibdate = "1992/06/24 11:42", 7 | } 8 | -------------------------------------------------------------------------------- /nofib/imaginary/kahan/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = 150000 6 | NORM_OPTS = 1500000 7 | SLOW_OPTS = 7500000 8 | 9 | SRC_HC_OPTS += -package array 10 | -------------------------------------------------------------------------------- /nofib/real/grep/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | # We also vary stdin 7 | FAST_OPTS = 100 ".*:..*" 8 | NORM_OPTS = 150 ".*:..*" 9 | SLOW_OPTS = 250 ".*:..*" 10 | -------------------------------------------------------------------------------- /nofib/smp/tchan/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 100000 5 | NORM_OPTS = 5000000 6 | SLOW_OPTS = 50000000 7 | 8 | SRC_HC_OPTS += -package stm 9 | 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/spectral/boyer2/README: -------------------------------------------------------------------------------- 1 | The interesting bit in this directory is ``Checker.hs''. As of GHC 0.14, 2 | the simplifier explodes tautologyp into 700+K of threaded C code, with 3 | 2000+ separate INTFUN's. To see this, compile with -O. 4 | -------------------------------------------------------------------------------- /nofib/spectral/fibheaps/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -package array 5 | 6 | FAST_OPTS = 500 7 | NORM_OPTS = 3500 8 | SLOW_OPTS = 16000 9 | 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/spectral/lambda/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -package transformers 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = 80 9 | NORM_OPTS = 260 10 | SLOW_OPTS = 550 11 | -------------------------------------------------------------------------------- /reading/STG-implementing-functional-languages-on-stock-hardware-spineless-tagless-g-machine.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bollu/coremlir/HEAD/reading/STG-implementing-functional-languages-on-stock-hardware-spineless-tagless-g-machine.pdf -------------------------------------------------------------------------------- /nofib/spectral/hartel/fft/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 1 7 | NORM_OPTS = 3 8 | SLOW_OPTS = 5 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/genfft/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 3 7 | NORM_OPTS = 6 8 | SLOW_OPTS = 8 9 | 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/parallel/dcbm/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | Primitives.hi : Primitives.lhi 5 | cp $< $@ 6 | 7 | depend :: Primitives.hi 8 | 9 | SRC_HC_OPTS += -cpp 10 | 11 | include $(TOP)/mk/target.mk 12 | 13 | -------------------------------------------------------------------------------- /nofib/real/gg/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | # Note that we also vary stdin per mode 7 | FAST_OPTS = 150 8 | NORM_OPTS = 500 9 | SLOW_OPTS = 1500 10 | -------------------------------------------------------------------------------- /nofib/real/hidden/runtime_files/pyramid.plate: -------------------------------------------------------------------------------- 1 | [vec[ 0, 0, 0], vec[20,10, 0], vec[10,10,20] ] 2 | [vec[ 0,20, 0], vec[20,10, 0], vec[10,10,20] ] 3 | [vec[ 0, 0, 0], vec[ 0,20, 0], vec[10,10,20] ] 4 | [vec[ 0, 0, 0], vec[ 0,20, 0], vec[20,10, 0] ] 5 | -------------------------------------------------------------------------------- /nofib/spectral/cryptarithm2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | SRC_HC_OPTS += -package transformers 7 | 8 | FAST_OPTS = 30 9 | NORM_OPTS = 300 10 | SLOW_OPTS = 1500 11 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/nucleic2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = 3 9 | NORM_OPTS = 25 10 | SLOW_OPTS = 125 11 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/solid/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 5 7 | NORM_OPTS = 9 8 | SLOW_OPTS = 12 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/parallel/mandel/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_RUNTEST_OPTS += -2.0 -2.0 2.0 2.0 1024 1024 256 5 | SRC_RUNTEST_OPTS += -stdout-binary 6 | SRC_HC_OPTS += -package parallel 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/calendar/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp 5 | 6 | FAST_OPTS = 1993 1000 7 | NORM_OPTS = 1993 10000 8 | SLOW_OPTS = 1993 50000 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/circsim/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | include $(TOP)/mk/boilerplate.mk 4 | 5 | FAST_OPTS = 8 4 6 | NORM_OPTS = 8 40 7 | SLOW_OPTS = 8 200 8 | 9 | SRC_RUNTEST_OPTS += +RTS -H30m -RTS 10 | 11 | include $(TOP)/mk/target.mk 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/comp_lab_zift/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 2 7 | NORM_OPTS = 5 8 | SLOW_OPTS = 9 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/wang/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 25 7 | NORM_OPTS = 80 8 | SLOW_OPTS = 150 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/para/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 1 runtime_files/input-data 7 | NORM_OPTS = 8 runtime_files/input-data 8 | SLOW_OPTS = 40 runtime_files/input-data 9 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/listcompr/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = 2000 9 | NORM_OPTS = 20000 10 | SLOW_OPTS = 100000 11 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/listcopy/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = 2000 9 | NORM_OPTS = 20000 10 | SLOW_OPTS = 100000 11 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/parstof/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts -H80M 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = 1 9 | NORM_OPTS = 8 10 | SLOW_OPTS = 40 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/wave4main/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 8 7 | NORM_OPTS = 80 8 | SLOW_OPTS = 400 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello! This is the coreMLIR docs. 7 | 8 | 9 | -------------------------------------------------------------------------------- /nofib/parallel/partak/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | 5 | FAST_OPTS = 34 15 8 6 | NORM_OPTS = 36 17 8 7 | SLOW_OPTS = 34 18 8 8 | SRC_HC_OPTS += -package parallel 9 | 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/parallel/sumeuler/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG_ARGS = 38 8000 100 5 | SRC_HC_OPTS += -package parallel 6 | 7 | # FAST_OPTS = 8 | # NORM_OPTS = 9 | # SLOW_OPTS = 10 | 11 | include $(TOP)/mk/target.mk 12 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_Anna2.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); ;; 3 | 4 | predApp p x = p x & True; 5 | 6 | empty l = case l of Nil -> True; Cons x xs -> False end; 7 | 8 | llist = Cons Nil Nil; 9 | 10 | res = predApp empty llist; 11 | -------------------------------------------------------------------------------- /nofib/real/compress2/inC/io_copy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * file_io.c - copy stdin to stdio 3 | * 4 | */ 5 | 6 | #include 7 | 8 | main () 9 | { 10 | register int c; 11 | 12 | while ((c = getchar ()) != EOF) { 13 | putchar (c); 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /nofib/real/eff/CS/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | main = do 10 | 11 | putStrLn "CS" 12 | evaluate $ crunState (times n $ cmodify (+1)) 0 13 | 14 | -------------------------------------------------------------------------------- /nofib/real/eff/FS/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | main = do 10 | 11 | putStrLn "FS" 12 | evaluate $ frunState (times n $ (fmodify (+1))) 0 13 | 14 | -------------------------------------------------------------------------------- /nofib/real/eff/VS/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | main = do 10 | 11 | putStrLn "VS" 12 | evaluate $ vrunState (times n $ (vmodify (+1))) 0 13 | 14 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/event/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 10000 7 | NORM_OPTS = 100000 8 | SLOW_OPTS = 500000 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/sched/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 200 10 7 | NORM_OPTS = 100 11 8 | SLOW_OPTS = 500 11 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/transform/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 300 7 | NORM_OPTS = 3000 8 | SLOW_OPTS = 15000 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/typecheck/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | FAST_OPTS = 500 7 | NORM_OPTS = 5000 8 | SLOW_OPTS = 25000 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/spectral/integer/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = -2100000000 14000001 2100000000 5 | NORM_OPTS = -2100000000 4500001 2100000000 6 | SLOW_OPTS = -2100000000 2000001 2100000000 7 | 8 | include $(TOP)/mk/target.mk 9 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/kohtz.soln: -------------------------------------------------------------------------------- 1 | - - - - - - - K 2 | - - - - - - - - 3 | - - - - - n - p 4 | - - - - - - - - 5 | - - - - - - - - 6 | - - - - - B P - 7 | - - - - - - - - 8 | b - - - - - k - 9 | 10 | White to move and mate in 5 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/eff/VSM/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | main = do 10 | 11 | putStrLn "VSM" 12 | evaluate $ vmrunState (times n $ vmmodify (+1)) 0 13 | 14 | -------------------------------------------------------------------------------- /nofib/parallel/linsolv/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -DSTRATEGIES -package random -package parallel 5 | 6 | # 28 = version 7 | # 83 = input 8 | PROG_ARGS = 28 83 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/hpg/README.nofib: -------------------------------------------------------------------------------- 1 | For performance measurement we disabled printing of the generated random numbers. 2 | 3 | While useful for debugging it doesn't measure anything useful and 4 | makes changing the problem sizes more tedious as we would also need to check stderr. -------------------------------------------------------------------------------- /nofib/real/maillist/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = runtime_files/fast 6 | NORM_OPTS = runtime_files/norm 7 | SLOW_OPTS = runtime_files/slow 8 | 9 | CLEAN_FILES += runtime_files/*.tex 10 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-mlir/src/GhcDump/Repl.hs: -------------------------------------------------------------------------------- 1 | module GhcDump.Repl 2 | ( module GhcDump.Ast 3 | , module GhcDump.Util 4 | , module GhcDump.Mlir 5 | ) where 6 | 7 | import GhcDump.Ast 8 | import GhcDump.Util 9 | import GhcDump.Mlir 10 | -------------------------------------------------------------------------------- /nofib/imaginary/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SUBDIRS = bernouilli digits-of-e1 digits-of-e2 exp3_8 gen_regexps integrate \ 5 | paraffins primes queens rfib tak wheel-sieve1 wheel-sieve2 x2n1 kahan 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | -------------------------------------------------------------------------------- /nofib/imaginary/primes/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Override default SRCS, or we get cseive.c as well. 5 | SRCS = Main.hs 6 | 7 | include $(TOP)/mk/target.mk 8 | 9 | FAST_OPTS = 400 10 | NORM_OPTS = 1000 11 | SLOW_OPTS = 2000 12 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/realNasties.cor: -------------------------------------------------------------------------------- 1 | 2 | boxed a ::= Box a; 3 | 4 | pair a b ::= Pair a b; 5 | ;; 6 | 7 | id x = x; 8 | 9 | boxid = Box id; 10 | 11 | use x = case boxid of Box f -> f x end; 12 | 13 | evenworse x = case boxid of Box f -> f (Pair x 1) end; 14 | -------------------------------------------------------------------------------- /nofib/real/eff/CSD/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | main = do 10 | 11 | putStrLn "CSD" 12 | evaluate $ (cstimes :: Int -> (Int -> ((), Int))) n (0 :: Int) 13 | 14 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/ghc-dump-util/src/GhcDump/Repl.hs: -------------------------------------------------------------------------------- 1 | module GhcDump.Repl 2 | ( module GhcDump.Ast 3 | , module GhcDump.Util 4 | , module GhcDump.Pretty 5 | ) where 6 | 7 | import GhcDump.Ast 8 | import GhcDump.Util 9 | import GhcDump.Pretty 10 | -------------------------------------------------------------------------------- /nofib/gc/hash/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 1000000 5 | NORM_OPTS = 5000000 6 | SLOW_OPTS = 100000000 7 | 8 | ifeq "$(HEAP)" "LARGE" 9 | SRC_RUNTEST_OPTS += +RTS -H430m -RTS 10 | endif 11 | 12 | include $(TOP)/mk/target.mk 13 | -------------------------------------------------------------------------------- /nofib/gc/cacheprof/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | ifeq "$(HEAP)" "LARGE" 5 | SRC_RUNTEST_OPTS += +RTS -H16m -RTS 6 | endif 7 | ifeq "$(HEAP)" "OLD" 8 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 9 | endif 10 | 11 | include $(TOP)/mk/target.mk 12 | 13 | -------------------------------------------------------------------------------- /nofib/parallel/OLD/soda7/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Override default SRCS; the default is all source files 5 | SRCS=Main.hs 6 | SRC_RUNTEST_OPTS += 20 7 | SRC_HC_OPTS += -cpp -package concurrent 8 | 9 | include $(TOP)/mk/target.mk 10 | 11 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/simple.soln: -------------------------------------------------------------------------------- 1 | - K - - - - - - 2 | P P P - - - - - 3 | - - - - - - - - 4 | - - - - - - - - 5 | - - - - - - - - 6 | - p - - - - - - 7 | - - p - - - - - 8 | - k - r - - - - 9 | 10 | White to move and mate in 1 11 | 12 | 1. R/Q1-Q8 mate. 13 | -------------------------------------------------------------------------------- /nofib/imaginary/gen_regexps/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | FAST_OPTS = [a-j][a-j][a-j][0-9] 6 | NORM_OPTS = [a-l][a-l][a-l][a-l][1-1]abcdefghijklmnopqrstuvwxy 7 | SLOW_OPTS = [a-l][a-l][a-l][a-l][1-5]abcdefghijklmnopqrstuvwxy 8 | -------------------------------------------------------------------------------- /nofib/gc/hash/hash.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad 2 | import qualified HashTable as H 3 | import System.Environment 4 | 5 | main = do 6 | [size] <- fmap (fmap read) getArgs 7 | m <- H.new (==) H.hashInt 8 | forM_ [1..size] $ \n -> H.insert m n n 9 | v <- H.lookup m 100 10 | print v 11 | -------------------------------------------------------------------------------- /nofib/real/hidden/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_RUNTEST_OPTS += +RTS -K1m -RTS 5 | 6 | include $(TOP)/mk/target.mk 7 | 8 | FAST_OPTS = runtime_files/houses.plate 9 | NORM_OPTS = runtime_files/rad.plate 10 | SLOW_OPTS = runtime_files/four.plate 11 | -------------------------------------------------------------------------------- /nofib/real/hpg/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = -nt 8 -dt 4 -nv 10 -dv 6 -de 6 5 | NORM_OPTS = -nt 40 -dt 5 -nv 60 -dv 6 -de 6 6 | SLOW_OPTS = -nt 80 -dt 8 -nv 100 -dv 8 -de 8 7 | 8 | #PROG_ARGS = 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/rsa/rsa.faststdin: -------------------------------------------------------------------------------- 1 | module Rsa (encrypt, decrypt, makeKeys) 2 | where 3 | 4 | 5 | encrypt, decrypt :: Integer -> Integer -> String -> String 6 | encrypt n e = unlines . map (show . power e n . code) . collect (size n) 7 | decrypt n d = concat . map (decode . power d n . read) . lines 8 | -------------------------------------------------------------------------------- /nofib/spectral/treejoin/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = runtime_files/1500.1 runtime_files/1500.2 7 | NORM_OPTS = runtime_files/8000.1 runtime_files/8000.2 8 | SLOW_OPTS = runtime_files/27000.1 runtime_files/27000.2 9 | -------------------------------------------------------------------------------- /nofib/parallel/cfd/Quad_def.hs: -------------------------------------------------------------------------------- 1 | module Quad_def (TriMat(..), RectMat(..) ) where 2 | 3 | data TriMat a = 4 | TriM (TriMat a) (RectMat a) (TriMat a) | SingTM a | ZeroTM deriving () 5 | 6 | data RectMat a = 7 | RectM (RectMat a) (RectMat a) (RectMat a) (RectMat a) 8 | | SingM a | ZeroM deriving () 9 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/concat.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | foldr f a l = case l of Nil -> a; Cons x xs -> f x (foldr f a xs) end; 7 | 8 | append l1 l2 = case l1 of Cons x xs -> Cons x (append xs l2); Nil -> l2 end; 9 | 10 | concat = foldr append Nil; 11 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/concat22.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | foldr f a l = case l of Nil -> a; Cons x xs -> f x (foldr f a xs) end; 7 | 8 | append l1 l2 = case l1 of Cons x xs -> Cons x (append xs l2); Nil -> l2 end; 9 | 10 | concat = foldr append Nil; 11 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/eta.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | append xl yl = case xl of Nil -> yl; Cons x xs -> Cons x (append xs yl) end; 7 | 8 | foldr f a l = case l of Nil -> a; Cons x xs -> f x (foldr f a xs) end; 9 | 10 | concat = foldr append Nil; 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/fulsom/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp 5 | 6 | # Bah.hs is a test file, which we don't want in SRCS 7 | EXCLUDED_SRCS = Bah.hs 8 | 9 | FAST_OPTS = 4 10 | NORM_OPTS = 5 11 | SLOW_OPTS = 6 12 | 13 | include $(TOP)/mk/target.mk 14 | 15 | -------------------------------------------------------------------------------- /nofib/gc/linear/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | include $(TOP)/mk/boilerplate.mk 4 | 5 | NORM_OPTS = 14 6 | 7 | ifeq "$(HEAP)" "LARGE" 8 | SRC_RUNTEST_OPTS += +RTS -H8m -RTS 9 | endif 10 | ifeq "$(HEAP)" "OLD" 11 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 12 | endif 13 | 14 | include $(TOP)/mk/target.mk 15 | -------------------------------------------------------------------------------- /nofib/real/gamteb/inFortran/fact.f: -------------------------------------------------------------------------------- 1 | program main 2 | n=5 3 | k = ifact(n) 4 | print *,k 5 | end 6 | function ifact(n) 7 | if(n.eq.1) then 8 | ifact=n 9 | else 10 | ifact = n*ifact(n-1) 11 | endif 12 | return 13 | end 14 | 15 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/simple.prob: -------------------------------------------------------------------------------- 1 | -- Castled king trapped behind the pawns. 2 | 3 | - K - - - - - - 4 | P P P - - - - - 5 | - - - - - - - - 6 | - - - - - - - - 7 | - - - - - - - - 8 | - p - - - - - - 9 | - - p - - - - - 10 | - k - r - - - - 11 | 12 | White to move and mate in 1 13 | -------------------------------------------------------------------------------- /nofib/spectral/para/c++/Thin.h: -------------------------------------------------------------------------------- 1 | 2 | // Thin.h 3 | 4 | 5 | class Thin : Queue 6 | { 7 | 8 | public: 9 | 10 | Thin(int); 11 | 12 | Reset(int); 13 | 14 | int TheBest() const; 15 | 16 | void Add(int); 17 | 18 | void Trim(); 19 | 20 | void DropNoFit(); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /nofib/imaginary/wheel-sieve2/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | 5 | # Seems to be a real memory hog, this one 6 | SRC_RUNTEST_OPTS += +RTS -M300m -RTS 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | FAST_OPTS = 700 11 | NORM_OPTS = 2000 12 | SLOW_OPTS = 4000 13 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_types2.cor: -------------------------------------------------------------------------------- 1 | 2 | list tau ::= Nil | Cons (list tau); 3 | 4 | ;; 5 | 6 | alt 7 | = case Nil of 8 | Nil -> Nil; 9 | Cons as -> case as of 10 | Nil -> as; 11 | Cons bs -> bs 12 | end 13 | end; 14 | 15 | -------------------------------------------------------------------------------- /nofib/spectral/simple/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Without this we get the C version too! 5 | SRCS = Main.hs 6 | 7 | # Main is rather big 8 | Main_HC_OPTS = -H110m 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | FAST_OPTS = 1 13 | NORM_OPTS = 20 14 | SLOW_OPTS = 100 15 | -------------------------------------------------------------------------------- /nofib/parallel/OLD/parfact/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | 5 | # Override default SRCS; the default is all source files 6 | SRCS=parfact.hs 7 | SRC_RUNTEST_OPTS += 8000000 1000 8 | SRC_HC_OPTS += -package concurrent 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/infer/MyList.hs: -------------------------------------------------------------------------------- 1 | module MyList (minus) where 2 | 3 | minus :: (Eq x) => [x] -> [x] -> [x] 4 | xs `minus` ys = foldl rmv xs ys 5 | rmv :: (Eq x) => [x] -> x -> [x] 6 | [] `rmv` y = [] 7 | (x:xs) `rmv` y = if x == y then xs else x : (xs `rmv` y) 8 | -------------------------------------------------------------------------------- /nofib/docs/paper/Jmakefile: -------------------------------------------------------------------------------- 1 | /* this is a standalone Jmakefile; NOT part of ghc "make world" */ 2 | 3 | DocProcessingSuffixRules() 4 | 5 | SRCS_VERB = \ 6 | paper.verb 7 | 8 | SRCS_TEX = $(SRCS_VERB:.verb=.tex) 9 | 10 | docs:: paper.dvi 11 | 12 | paper.dvi: $(SRCS_TEX) 13 | 14 | ExtraStuffToClean( $(SRCS_TEX) ) 15 | -------------------------------------------------------------------------------- /nofib/gc/lcss/Makefile: -------------------------------------------------------------------------------- 1 | TOP=../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 1 2 2000 1000 1001 2000 5 | NORM_OPTS = 1 2 2000 1000 1001 4000 6 | SLOW_OPTS = 1 2 4000 1000 1001 4000 7 | 8 | ifeq "$(HEAP)" "LARGE" 9 | SRC_RUNTEST_OPTS += +RTS -H256m -RTS 10 | endif 11 | 12 | include $(TOP)/mk/target.mk 13 | -------------------------------------------------------------------------------- /nofib/parallel/minimax/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRCS = Board.hs \ 5 | Game.hs \ 6 | Prog.hs \ 7 | Tree.hs \ 8 | Wins.hs \ 9 | Main.hs 10 | HC_OPTS += -package parallel -package random 11 | 12 | PROG_ARGS = 4 6 13 | 14 | include $(TOP)/mk/target.mk 15 | 16 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/reverse.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); ;; 3 | 4 | dot f g x = f (g x); 5 | 6 | lid4 l = case l of Nil -> l; Cons x xs -> l end; 7 | 8 | lid6 l = case l of Nil -> l; Cons x xs -> Cons (lid4 x) xs end; 9 | 10 | wiggle = dot lid4 lid4; 11 | 12 | wigglewiggle = dot lid6 lid6; 13 | -------------------------------------------------------------------------------- /nofib/real/bspt/Libfuns.lhs: -------------------------------------------------------------------------------- 1 | > module Libfuns 2 | 3 | Module for local dummy parallel annotations 4 | 5 | > (par, plist, seq) 6 | > where 7 | 8 | 9 | > par x y = y 10 | 11 | > plist l = par (pl l) l 12 | > where 13 | > pl [] = [] 14 | > pl (a:l) = par a (pl l) 15 | 16 | 17 | > --1.3:seq x y = y 18 | 19 | -------------------------------------------------------------------------------- /nofib/real/compress/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRCS = BinConv.hs BinTest.hs Decode.hs Defaults.hs Encode.hs Main.hs PTTrees.hs Uncompress.hs 5 | 6 | Lzw_HC_OPTS = -cpp 7 | 8 | # Input files taken from http://mattmahoney.net/dc/enwik8.zip 9 | # 10 | include $(TOP)/mk/target.mk 11 | -------------------------------------------------------------------------------- /nofib/imaginary/paraffins/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Override default SRCS; the default is all source files, but 5 | # we don't want to include paraffins.c 6 | SRCS=Main.hs 7 | 8 | include $(TOP)/mk/target.mk 9 | 10 | 11 | FAST_OPTS = 11 12 | NORM_OPTS = 14 13 | SLOW_OPTS = 15 14 | -------------------------------------------------------------------------------- /nofib/imaginary/rfib/Main.hs: -------------------------------------------------------------------------------- 1 | -- !!! the ultra-notorious "nfib 30" does w/ Floats 2 | -- 3 | module Main (main) where 4 | import System.Environment 5 | 6 | main = do 7 | [arg] <- getArgs 8 | print $ nfib $ read arg 9 | 10 | nfib :: Double -> Double 11 | nfib n = if n <= 1 then 1 else nfib (n-1) + nfib (n-2) + 1 12 | 13 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/holzhausen.prob: -------------------------------------------------------------------------------- 1 | -- W. von Holzhausen 2 | -- Deutsches Wochenschach, 1913 3 | 4 | - - - - R - - K 5 | - - - - - - - b 6 | - b - - N - q - 7 | - - - - - - - - 8 | - - - - - - P - 9 | - r - - - - p - 10 | - - p - - - - k 11 | - - - - - - - - 12 | 13 | White to play and mate in 4 14 | -------------------------------------------------------------------------------- /nofib/imaginary/bernouilli/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Override default SRCS; the default is all source files, but 5 | # we don't want to include paraffins.c 6 | SRCS=Main.hs 7 | 8 | FAST_OPTS = 60 9 | NORM_OPTS = 180 10 | SLOW_OPTS = 320 11 | 12 | include $(TOP)/mk/target.mk 13 | 14 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/foldrFoldl.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | foldr f z l 7 | = case l of 8 | Nil -> z; 9 | Cons x xs -> f x (foldr f z xs) 10 | end; 11 | 12 | foldl f z l 13 | = case l of 14 | Nil -> z; 15 | Cons x xs -> foldl f (f z x) xs 16 | end; 17 | 18 | -------------------------------------------------------------------------------- /core2MLIR/Core2MLIR/HaskMLIR.hs: -------------------------------------------------------------------------------- 1 | module Core2MLIR.HaskMLIR where 2 | import Core2MLIR.MLIR 3 | import Outputable 4 | 5 | fn :: ([Type], [Type]) -> Region -> Operation 6 | fn (paramtys, retty) r = defaultop { opty = FunctionType paramtys retty, opregions = RegionList [r] } 7 | 8 | -- make fib 9 | ex1 :: SDoc 10 | ex1 = error "foo" 11 | 12 | -------------------------------------------------------------------------------- /hask98/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.3) 2 | project(hask98 C CXX) 3 | 4 | set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -O0 -fsanitize=address,undefined -static-libasan") 5 | set(CMAKE_CXX_FLAGS "-O0 -Wall -Werror -Wno-error=unused-result") 6 | add_executable(hask98 main.cpp) 7 | set_target_properties(hask98 PROPERTIES CXX_STANDARD 14) 8 | -------------------------------------------------------------------------------- /lib/Hask/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_mlir_dialect_library(MLIRHask 2 | HaskDialect.cpp 3 | HaskOps.cpp 4 | WorkerWrapperPass.cpp 5 | 6 | ADDITIONAL_HEADER_DIRS 7 | ${PROJECT_SOURCE_DIR}/include/Hask 8 | 9 | DEPENDS 10 | MLIRHaskOpsIncGen 11 | 12 | LINK_LIBS PUBLIC 13 | MLIRIR 14 | ) 15 | -------------------------------------------------------------------------------- /nofib/gc/treejoin/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # Arguments to test program 5 | PROG_ARGS = 27000.1 27000.2 6 | 7 | ifeq "$(HEAP)" "LARGE" 8 | SRC_RUNTEST_OPTS += +RTS -H32m -RTS 9 | endif 10 | ifeq "$(HEAP)" "OLD" 11 | SRC_RUNTEST_OPTS += +RTS -H24m -RTS 12 | endif 13 | 14 | include $(TOP)/mk/target.mk 15 | -------------------------------------------------------------------------------- /nofib/imaginary/exp3_8/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | include $(TOP)/mk/target.mk 4 | 5 | 6 | # Every increment takes about 10 times as much time as the last. In 2018, 9 7 | # took 1.5s. The benchmark is stable enough that that's also OK for slow mode. 8 | FAST_OPTS = 8 9 | NORM_OPTS = 9 10 | SLOW_OPTS = 9 11 | -------------------------------------------------------------------------------- /core2MLIR/Core2MLIR/HaskMLIRDialect.hs: -------------------------------------------------------------------------------- 1 | module Core2MLIR.HaskMLIR where 2 | import Core2MLIR.MLIR 3 | import Outputable 4 | 5 | fn :: ([Type], [Type]) -> Region -> Operation 6 | fn (paramtys, retty) r = defaultop { opty = FunctionType paramtys retty, opregions = RegionList [r] } 7 | 8 | -- make fib 9 | ex1 :: SDoc 10 | ex1 = error "foo" 11 | 12 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/mutualRec.cor: -------------------------------------------------------------------------------- 1 | 2 | la a ::= Na | Ca a (lb a) ; 3 | 4 | lb b ::= Nb | Cb b (la b) ; ;; 5 | 6 | 7 | 8 | 9 | 10 | fa x = case x of 11 | Na -> 0; 12 | Ca y ys -> (fb ys) + y 13 | end; 14 | 15 | fb x = case x of 16 | Nb -> 0; 17 | Cb y ys -> (fa ys) - y 18 | end; 19 | 20 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/pairid.cor: -------------------------------------------------------------------------------- 1 | 2 | pair a b ::= Pair a b; 3 | 4 | list a ::= Nil | Cons a (list a); 5 | 6 | ;; 7 | 8 | pairid p = case p of Pair a b -> Pair a b end; 9 | 10 | lid a = case a of Nil -> Nil; Cons x xs -> Cons x xs end; 11 | 12 | magic p = case p of Pair as bs -> Pair (lid as) (lid bs) end; 13 | 14 | baad p = pairid (magic p); -------------------------------------------------------------------------------- /nofib/gc/circsim/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | include $(TOP)/mk/boilerplate.mk 4 | 5 | FAST_OPTS = 8 100 6 | NORM_OPTS = 8 3000 7 | SLOW_OPTS = 8 5000 8 | 9 | ifeq "$(HEAP)" "LARGE" 10 | SRC_RUNTEST_OPTS += +RTS -H256m -RTS 11 | endif 12 | ifeq "$(HEAP)" "OLD" 13 | SRC_RUNTEST_OPTS += +RTS -H30m -RTS 14 | endif 15 | 16 | include $(TOP)/mk/target.mk 17 | -------------------------------------------------------------------------------- /nofib/gc/power/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | FAST_OPTS = 50 7 | NORM_OPTS = 80 8 | SLOW_OPTS = 90 9 | 10 | ifeq "$(HEAP)" "LARGE" 11 | SRC_RUNTEST_OPTS += +RTS -H16m -RTS 12 | endif 13 | ifeq "$(HEAP)" "OLD" 14 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 15 | endif 16 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bury.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | quad a b c d ::= MkQuad a b c d; ;; 5 | 6 | bury x = MkQuad (Cons (Cons (Cons x Nil) Nil) Nil) 7 | (Cons (Cons (Cons x Nil) Nil) Nil) 8 | (Cons (Cons (Cons x Nil) Nil) Nil) 9 | (Cons (Cons (Cons x Nil) Nil) Nil); 10 | 11 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/john.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); ;; 3 | 4 | ccat xss k = 5 | case xss of 6 | Nil -> k Nil; 7 | Cons xs xss2 -> ccat xss2 (\ys -> capp xs ys k) 8 | end; 9 | 10 | capp l ys cont 11 | = case l of 12 | Nil -> cont ys; 13 | Cons x xs -> capp xs ys (\zs -> cont (Cons x zs)) 14 | end; 15 | -------------------------------------------------------------------------------- /nofib/real/bspt/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | import Prog (prog) 3 | import Control.Monad (replicateM_) 4 | import System.Environment (getArgs) 5 | import NofibUtils (hash, salt) 6 | 7 | main = do 8 | str <- getContents 9 | [n] <- getArgs 10 | replicateM_ (read n) $ do 11 | str' <- salt str 12 | print (hash (prog str')) 13 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/concat24.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | foldr24 f a l = case l of Nil -> lid a; Cons x xs -> f x (foldr24 f a xs) end; 7 | 8 | append l1 l2 = case l1 of Cons x xs -> Cons x (append xs l2); Nil -> l2 end; 9 | 10 | lid l = case l of Nil -> l; Cons x xs -> l end; 11 | 12 | concat24 = foldr24 append Nil; -------------------------------------------------------------------------------- /nofib/real/eff/VSD/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import EffBench 4 | import Control.Exception.Base 5 | import qualified Control.Monad.State.Strict as S 6 | 7 | n :: Int 8 | n = 10000000 9 | 10 | main = do 11 | 12 | putStrLn "VSD" 13 | evaluate $ S.runState (times n $ (vmdmodify :: (Int -> Int) -> S.State Int ()) (+1)) (0 :: Int) 14 | 15 | -------------------------------------------------------------------------------- /nofib/parallel/gray/RayTrace.hs: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2000 Galois Connections, Inc. 2 | -- All rights reserved. This software is distributed as 3 | -- free software under the license in the file "LICENSE", 4 | -- which is included in the distribution. 5 | 6 | module RayTrace(module Illumination, module Surface) where 7 | 8 | import Illumination 9 | import Surface 10 | -------------------------------------------------------------------------------- /ghc-benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-* 3 | cabal-dev 4 | *.o 5 | *.hi 6 | *.hie 7 | *.chi 8 | *.chs.h 9 | *.dyn_o 10 | *.dyn_hi 11 | .hpc 12 | .hsenv 13 | .cabal-sandbox/ 14 | cabal.sandbox.config 15 | *.prof 16 | *.aux 17 | *.hp 18 | *.eventlog 19 | .stack-work/ 20 | cabal.project.local 21 | cabal.project.local~ 22 | .HTF/ 23 | .ghc.environment.* 24 | *.dump-* 25 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_Anna5.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | 7 | length l = case l of 8 | Nil -> 0; 9 | Cons x xs -> 1 + length xs 10 | end; 11 | 12 | lid x = case x of Nil -> x; Cons y ys -> x end; 13 | 14 | t = Cons not Nil; 15 | 16 | tt = lid t; 17 | 18 | f = length (lid tt); 19 | 20 | -------------------------------------------------------------------------------- /nofib/parallel/gray/Misc.hs: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2000 Galois Connections, Inc. 2 | -- All rights reserved. This software is distributed as 3 | -- free software under the license in the file "LICENSE", 4 | -- which is included in the distribution. 5 | 6 | module Misc where 7 | 8 | import Debug.Trace 9 | 10 | debug s v = trace (s ++" : "++ show v ++ "\n") v 11 | -- debug s v = v 12 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SUBDIRS= comp_lab_zift wave4main wang typecheck transform \ 5 | solid sched nucleic2 parstof listcopy listcompr ida genfft fft \ 6 | event 7 | 8 | SRC_MKDEPENDHS_OPTS=-fglasgow-exts 9 | 10 | EXCLUDED_SRCS += Fast2haskell.hs Fast2haskell2.hs 11 | 12 | include $(TOP)/mk/target.mk 13 | 14 | -------------------------------------------------------------------------------- /nofib/gc/constraints/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | FAST_OPTS = 7 5 | # NORM_OPTS should probably be 8 or 9 6 | NORM_OPTS = 10 7 | SLOW_OPTS = 11 8 | 9 | ifeq "$(HEAP)" "LARGE" 10 | SRC_RUNTEST_OPTS += +RTS -H330m -RTS 11 | endif 12 | ifeq "$(HEAP)" "OLD" 13 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 14 | endif 15 | 16 | include $(TOP)/mk/target.mk 17 | -------------------------------------------------------------------------------- /nofib/gc/fibheaps/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | NORM_OPTS = 300000 5 | 6 | SRC_HC_OPTS += -package array 7 | SRC_RUNTEST_OPTS += +RTS -K64m -RTS 8 | 9 | ifeq "$(HEAP)" "LARGE" 10 | SRC_RUNTEST_OPTS += +RTS -H128m -RTS 11 | endif 12 | ifeq "$(HEAP)" "OLD" 13 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 14 | endif 15 | 16 | include $(TOP)/mk/target.mk 17 | -------------------------------------------------------------------------------- /nofib/gc/mutstore2/Store2.hs: -------------------------------------------------------------------------------- 1 | --IOArray with lists 2 | 3 | module Store2 where 4 | import Data.IORef 5 | import Data.Array.IO 6 | 7 | type Store = IOArray Int [Int] 8 | 9 | mkStore :: IO Store 10 | mkStore = newArray (0, 9) [] 11 | 12 | addElemToBucket :: Store -> Int -> Int -> IO () 13 | addElemToBucket a k e = 14 | do buc <- readArray a k 15 | writeArray a k (e : buc) 16 | -------------------------------------------------------------------------------- /nofib/imaginary/tak/Main.hs: -------------------------------------------------------------------------------- 1 | 2 | import System.Environment 3 | 4 | 5 | -- code of unknown provenance (partain 95/01/25) 6 | 7 | tak :: Int -> Int -> Int -> Int 8 | 9 | tak x y z = if not(y < x) then z 10 | else tak (tak (x-1) y z) 11 | (tak (y-1) z x) 12 | (tak (z-1) x y) 13 | 14 | main = do 15 | [xs,ys,zs] <- getArgs 16 | print (tak (read xs) (read ys) (read zs)) 17 | -------------------------------------------------------------------------------- /nofib/parallel/coins/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # This version just counts the results, and runs in constant space: 5 | # SRC_RUNTEST_OPTS += 7 1163 6 | 7 | # This version builds a list of the results, and needs a lot of memory: 8 | SRC_RUNTEST_OPTS += 3 873 9 | 10 | SRC_HC_OPTS += -package parallel 11 | 12 | include $(TOP)/mk/target.mk 13 | -------------------------------------------------------------------------------- /nofib/real/gamteb/Main.hs: -------------------------------------------------------------------------------- 1 | -- 2 | -- Patricia Fasel 3 | -- Los Alamos National Laboratory 4 | -- 1990 August 5 | -- 6 | import GamtebMain 7 | import Control.Monad 8 | import System.Environment 9 | import NofibUtils 10 | 11 | main = replicateM_ 200 $ do 12 | (scale:_) <- getArgs 13 | -- putStr (gamteb (read scale)) 14 | print (hash (gamteb (read scale))) 15 | -------------------------------------------------------------------------------- /nofib/gc/happy/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | include $(TOP)/mk/boilerplate.mk 4 | 5 | NORM_OPTS = TestInput.y 6 | SRC_HC_OPTS += -cpp -package containers 7 | EXCLUDED_SRCS += TestInput.hs 8 | 9 | ifeq "$(HEAP)" "LARGE" 10 | SRC_RUNTEST_OPTS += +RTS -H128m -RTS 11 | endif 12 | ifeq "$(HEAP)" "OLD" 13 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 14 | endif 15 | 16 | include $(TOP)/mk/target.mk 17 | -------------------------------------------------------------------------------- /nofib/nofib-analyse/nofib-analyse.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.4 2 | name: nofib-analyse 3 | version: 0 4 | 5 | executable nofib-analyse 6 | default-language: Haskell2010 7 | main-is: Main.hs 8 | other-modules: 9 | CmdLine 10 | GenUtils 11 | Slurp 12 | 13 | build-depends: 14 | , array 15 | , base 16 | , containers 17 | , regex-compat 18 | -------------------------------------------------------------------------------- /nofib/parallel/matmult/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # 0 : sequential 5 | # 1 : linewise 6 | # 2 : blockwise 7 | # 3 : columnwise 8 | 9 | FAST_OPTS = 100 1 10 10 | NORM_OPTS = 600 1 10 11 | SLOW_OPTS = 1000 1 10 12 | SRC_HC_OPTS += -package parallel 13 | 14 | # FAST_OPTS = 15 | # NORM_OPTS = 16 | # SLOW_OPTS = 17 | 18 | include $(TOP)/mk/target.mk 19 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/concat44.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | lid l = case l of Nil -> l; Cons x xs -> l end; 7 | 8 | foldr44 f a l 9 | = case l of Nil -> a; 10 | Cons x xs -> f (lid x) (lid (foldr44 f a xs)) end; 11 | 12 | append l1 l2 = case l1 of Cons x xs -> Cons x (append xs l2); Nil -> l2 end; 13 | 14 | concat44 = foldr44 append Nil; 15 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/kohtz.prob: -------------------------------------------------------------------------------- 1 | -- Kohtz and Kockelkorn 2 | -- Schachaufgaben, 1875 3 | -- 4 | -- Looks on the surface like a four-mover, 5 | -- so where is the fallacy? 6 | 7 | - - - - - - - K 8 | - - - - - - - - 9 | - - - - - n - p 10 | - - - - - - - - 11 | - - - - - - - - 12 | - - - - - B P - 13 | - - - - - - - - 14 | b - - - - - k - 15 | 16 | White to move and mate in 5 17 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_types1.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil a; 3 | 4 | type ::= EAp (type) 5 | | ELet (type); 6 | 7 | ;; 8 | 9 | listId l1 10 | = case l1 of 11 | Nil n -> Nil n 12 | end; 13 | 14 | allBinders e = 15 | case e of 16 | EAp x -> listId (allBinders x); 17 | ELet y -> listId (allBinders y) 18 | end; 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /nofib/real/pic/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | # The first parameter controls iteration count, the second number of particles. 7 | # For stable results, increment the first parameter, for more realistic benchmark 8 | # load the second. 9 | FAST_OPTS = 200 18 10 | NORM_OPTS = 500 80 11 | SLOW_OPTS = 1000 300 12 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/marin.prob: -------------------------------------------------------------------------------- 1 | -- V. Marin 2 | -- 1st Prize, Spanish Tournament, 1920 3 | -- `... combining a sparkling key with quiet strategy and 4 | -- pure mates.' (Phillips) 5 | 6 | - N - - - - n - 7 | - - - - r - P k 8 | - - - P - - - - 9 | - - P b - K - P 10 | - - - P - - - p 11 | - P - - P - p - 12 | - - - - p p P - 13 | Q N - - q - - B 14 | 15 | White to play and mate in 3 16 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/shinkman.soln: -------------------------------------------------------------------------------- 1 | - - - - - - - - 2 | - - - - - - - - 3 | - - - - P b - - 4 | - - P - - - - - 5 | - - K P p - - - 6 | - - - - - - - - 7 | - r - k - - - - 8 | - - - - - - - - 9 | 10 | White to move and mate in 4 11 | 1. R/QN2-QN1, 12 | if P-K4; 2. B/KB6-Q8, P-Q6; 3. B/Q8-QN6, K-Q5; 4. R/QN1-QN4++ 13 | if P-Q6; 2. B/KB6-QR1, P-K4; 3. R/QN1-QN2, K-Q5; 4. R/QN2-QN4++ 14 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug_Anna1.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | id x = x; 6 | 7 | f l n = (case l of True -> id; False -> id end) n; 8 | 9 | { 10 | alt l 11 | = case l of 12 | Nil -> Cons; 13 | Cons a as -> case as of 14 | Nil -> Cons; 15 | Cons b bs -> Cons 16 | end 17 | end; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/heathcote3.prob: -------------------------------------------------------------------------------- 1 | -- G. Heathcote 2 | -- Reading Observer, 1904 3 | -- `A charming little three-mover constructed with 4 | -- the art that conceals art.' (Phillips) 5 | 6 | - - - - - - - - 7 | - - - - - - - - 8 | - - - - - - - - 9 | - - - - P - - - 10 | - - - - p - k b 11 | - P n - K - - - 12 | - P - - - - - - 13 | - q - - - - - - 14 | 15 | White to play and mate in 3 16 | -------------------------------------------------------------------------------- /nofib/real/compress/README.nofib: -------------------------------------------------------------------------------- 1 | "compress" program in Haskell 2 | 3 | Most of what's here is from Paul Sanders at BT. 4 | 5 | The files lzw.c, Lzw.hs, and Lzw.icl (in Clean) are the same basic 6 | deal, from John van Groningen at Nijmegen. These are *not* what's run 7 | by default, but I would welcome the insight of anyone who messes with 8 | them. 9 | 10 | The MAIL file contains some relevant correspondence. 11 | -------------------------------------------------------------------------------- /nofib/real/hidden/Rotate.lhs: -------------------------------------------------------------------------------- 1 | > module Rotate (rotate) where 2 | > import Numbers 3 | > import Vectors 4 | > import Matrices 5 | 6 | > rotate :: Vector -> Vector -> Vector 7 | > rotate v w | v==0 = w 8 | > | normv==vec [0,0,1] = w 9 | > | normv==vec [0,0,-1] = -w 10 | > | otherwise = mat [p,q,r] `mulm` w 11 | > where normv = norm(v) 12 | > p = norm(q*r) 13 | > q = norm(vec [0,0,1]*r) 14 | > r = normv 15 | -------------------------------------------------------------------------------- /nofib/spectral/mandel/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_RUNTEST_OPTS += -stdout-binary 5 | 6 | # Override SRCS so that we don't link in MandelOld.hs 7 | SRCS = Main.hs Mandel.lhs PortablePixmap.lhs 8 | 9 | include $(TOP)/mk/target.mk 10 | 11 | FAST_OPTS = -2.0 -2.0 2.0 2.0 25 25 75 12 | NORM_OPTS = -2.0 -2.0 2.0 2.0 80 80 75 13 | SLOW_OPTS = -2.0 -2.0 2.0 2.0 180 180 75 14 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/wurzburg.prob: -------------------------------------------------------------------------------- 1 | -- O. Wurzburg 2 | -- Pittsburgh Gazette-Times, 1914 3 | -- A striking task achievement presented with due 4 | -- regard to artistic canons. (Phillips) 5 | 6 | - - k - - - - - 7 | r - - - - - - - 8 | - - - p K - - - 9 | - - - - P - - - 10 | - - - p p b - - 11 | - - - p - p - - 12 | - - - - - - - - 13 | - - - - - - - - 14 | 15 | White to play and mate in 3 16 | -------------------------------------------------------------------------------- /proposals.md: -------------------------------------------------------------------------------- 1 | # Printable regions 2 | 3 | # Readable MLIR 4 | 5 | - variable names. 6 | - stable variable numbering in bbs of a region. 7 | - stable variable naming in regions present inside an Op. 8 | - a good system like `Doc` for printing and formatting IR. 9 | 10 | # RETE for pattern matching 11 | - Use RETE for pattern matching 12 | 13 | # Subclasses of `Region`? 14 | - Region with only a single basic block. 15 | -------------------------------------------------------------------------------- /nofib/spectral/eliza/eliza.stdin: -------------------------------------------------------------------------------- 1 | Are we alone? 2 | That the Roswell event was actually an alien encounter. Do you agreed? 3 | But why not talk about you, its more fun. 4 | I dont ask, you do 5 | do ray me 6 | Nop, thats because your a computer 7 | you dont 8 | Oh, a paranoid computer, ehh? 9 | Tell me about *your* mother 10 | No, what what was she like? 11 | I'm asking questions, not you 12 | no 13 | yes 14 | but I'm not 15 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/kidson.prob: -------------------------------------------------------------------------------- 1 | -- H. E. Kidson 2 | -- Westminster Club Papers, 1868 3 | -- `Quite a pleasant old-time conceit. The ultimate use 4 | -- of white's QR is well hidden.' (Phillips) 5 | 6 | - - - - - - - - 7 | - - - - P - - - 8 | - - - - - - - R 9 | - - - - b p P - 10 | - p n - - - r - 11 | - p - P - K - p 12 | - - - p P - - - 13 | r - - - k - - - 14 | 15 | White to play and mate in 4 16 | -------------------------------------------------------------------------------- /nofib/spectral/primetest/primetest.faststdin: -------------------------------------------------------------------------------- 1 | 531137992816767098689588206552468627329593117727031923199444138200403559860852242739162502265229285668889329486246501015346579337652707239409519978766587351943831270835393219031728127 2 | 11111111111111111111111 3 | 4125636888562548868221559797461449 4 | 8987964267331664557 5 | 85053461164796801949539541639542805770666392330682673302530819774105141531698707146930307290253537320447270457 6 | -------------------------------------------------------------------------------- /nofib/real/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SUBDIRS = anna bspt cacheprof compress compress2 fem fluid fulsom gamteb gg \ 5 | grep hidden hpg infer lift linear maillist mkhprog parser pic prolog \ 6 | reptile rsa scs symalg veritas eff 7 | 8 | #cacheprof causes very nondeterministic allocation 9 | OTHER_SUBDIRS = cacheprof 10 | 11 | 12 | include $(TOP)/mk/target.mk 13 | 14 | -------------------------------------------------------------------------------- /nofib/spectral/pretty/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Pretty 4 | 5 | main = putStr ((ppShow (80::Int) pretty_stuff) ++ "\n") 6 | where 7 | pretty_stuff = ppAboves [ ppBesides [ppInt (-42), ppChar '@', ppStr "This is a string"], 8 | pp'SP, 9 | ppHang (ppStr "This is the label") 10 | (8::Int) (ppCat (take (50::Int) pp_words)) ] 11 | pp_words = pp_word : pp_words 12 | pp_word = ppStr "xxxxx" 13 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/ap_Unzip.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | tp2 a b ::= Mk2 a b; 5 | 6 | tp3 a b c ::= Mk3 a b c; 7 | 8 | tp4 a b c d ::= Mk4 a b c d; 9 | 10 | ;; 11 | 12 | unzip2 l 13 | = case l of 14 | Nil -> Mk2 Nil Nil; 15 | Cons pair pairs -> case pair of 16 | Mk2 x y -> case unzip2 pairs of 17 | Mk2 xs ys -> Mk2 (Cons x xs) (Cons y ys) end end end; 18 | -------------------------------------------------------------------------------- /nofib/gc/happy/Target.lhs: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------------------------- 2 | The target data type. 3 | 4 | (c) 1993-2001 Andy Gill, Simon Marlow 5 | ----------------------------------------------------------------------------- 6 | 7 | > module Target (Target(..)) where 8 | 9 | > data Target 10 | > = TargetHaskell -- functions and things 11 | > | TargetArrayBased -- arrays 12 | 13 | > deriving Eq 14 | -------------------------------------------------------------------------------- /nofib/imaginary/primes/Main.hs: -------------------------------------------------------------------------------- 1 | 2 | import Control.Monad (forM_) 3 | import System.Environment 4 | 5 | isdivs :: Int -> Int -> Bool 6 | isdivs n x = mod x n /= 0 7 | 8 | the_filter :: [Int] -> [Int] 9 | the_filter (n:ns) = filter (isdivs n) ns 10 | 11 | prime :: Int -> Int 12 | prime n = map head (iterate the_filter [2..n*n]) !! n 13 | 14 | main = forM_ [1..100] $ const $ do 15 | [arg] <- getArgs 16 | print $ prime (read arg) 17 | -------------------------------------------------------------------------------- /nofib/spectral/expert/runtime_files/animals: -------------------------------------------------------------------------------- 1 | the animal is X 2 | X is a zebra if X has stripes and X has hooves 3 | X is a tiger if X has stripes and X has claws 4 | X is a dog if mammal describes X and X can bark 5 | X is a cat if mammal describes X and X can mieow 6 | mammal describes X if X has hair or X has milk 7 | X is a bird if X has feathers 8 | X is a bird if X can fly and X has eggs 9 | X is a fish if X can swim and X has fins 10 | -------------------------------------------------------------------------------- /nofib/real/eff/S/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import Control.Exception.Base 4 | import qualified Control.Monad.State.Strict as S 5 | 6 | n :: Int 7 | n = 10000000 8 | 9 | times :: Monad m => Int -> m a -> m () 10 | times n ma = go n where 11 | go 0 = pure () 12 | go n = ma >> go (n - 1) 13 | {-# inline times #-} 14 | 15 | main = do 16 | 17 | putStrLn "S" 18 | evaluate $ S.runState (times n $ (S.modify (+1))) 0 19 | 20 | -------------------------------------------------------------------------------- /nofib/smp/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SUBDIRS = \ 5 | sieve \ 6 | callback001 \ 7 | callback002 \ 8 | threads001 \ 9 | threads003 \ 10 | threads006 \ 11 | threads007 \ 12 | chan 13 | 14 | # Not a good benchmark, can go really slowly for random reasons: 15 | # threads002 16 | OTHER_SUBDIRS = stm001 stm002 systolic tchan theads002 threads004 threads005 17 | 18 | include $(TOP)/mk/target.mk 19 | 20 | -------------------------------------------------------------------------------- /nofib/gc/linear/Absmatlib.lhs: -------------------------------------------------------------------------------- 1 | \section{Absmatlib} 2 | 3 | This module exports definitions imported from 4 | Matlib. Matrix and AbsDensematrix are imported 5 | to keep hbc happy 6 | 7 | \begin{code} 8 | 9 | module Absmatlib(doscale,doprecond,uncondition) where 10 | 11 | import Matlib 12 | import Matrix -- for hbc 13 | import AbsDensematrix -- for hbc 14 | 15 | 16 | doscale = scale 17 | doprecond = precond 18 | 19 | \end{code} 20 | 21 | 22 | -------------------------------------------------------------------------------- /nofib/real/compress/BinTest.hs: -------------------------------------------------------------------------------- 1 | module BinTest (main) where 2 | 3 | main = putStr (show (result 1000)) 4 | 5 | result 0 = [] 6 | result n = codes_to_ascii (3077, 1192) ++ result (n-1) 7 | 8 | codes_to_ascii (x,y) 9 | = x_div : ((x_rem * 16) + y_div) : [y_rem] 10 | where 11 | (x_div, x_rem) = divRem x 16 12 | (y_div, y_rem) = divRem y 256 13 | 14 | divRem x y = (x `div` y, x `rem` y) -- missing from PreludeCore ? 15 | -------------------------------------------------------------------------------- /nofib/real/infer/infer.faststdin: -------------------------------------------------------------------------------- 1 | (\x.x) 2 | \x.\y.x 3 | (x 4 | x 5 | (\f.\g.\x.(g(f(x)))) 6 | (\x. x x) 7 | (\x.x) (\x.x) 8 | (\id. id id) (\x.x) 9 | let id = \x.x in id id 10 | \x. let f = x in f f 11 | fix (\x.x) 12 | fix unit 13 | \x. unit (unit x) 14 | fix (\x. append (unit x)) 15 | \x. fix (\xs. append (unit x) xs) 16 | let id = \x.x in id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id 17 | -------------------------------------------------------------------------------- /nofib/real/linear/Absmatlib.lhs: -------------------------------------------------------------------------------- 1 | \section{Absmatlib} 2 | 3 | This module exports definitions imported from 4 | Matlib. Matrix and AbsDensematrix are imported 5 | to keep hbc happy 6 | 7 | \begin{code} 8 | 9 | module Absmatlib(doscale,doprecond,uncondition) where 10 | 11 | import Matlib 12 | import Matrix -- for hbc 13 | import AbsDensematrix -- for hbc 14 | 15 | 16 | doscale = scale 17 | doprecond = precond 18 | 19 | \end{code} 20 | 21 | 22 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/ellerman.prob: -------------------------------------------------------------------------------- 1 | -- A. Ellerman 2 | -- 1st prize, Luigi Centurini, Genoa, 1925 3 | -- `One of the very best modern two-movers, 4 | -- unsurpassed for beauty of idea and 5 | -- execution.' (Phillips) 6 | 7 | b k - - - - - - 8 | - n p - - - - - 9 | - - - - - - - - 10 | r - - - - p - - 11 | R - - - K - - - 12 | - - - r P - p - 13 | - Q - - - - - - 14 | - - - - - q B B 15 | 16 | White to play and mate in 2 17 | -------------------------------------------------------------------------------- /core2MLIR/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-newstyle 3 | cabal.project.local 4 | .ghc.environment.* 5 | dump/ 6 | 7 | dist 8 | dist-* 9 | cabal-dev 10 | *.o 11 | *.hi 12 | *.hie 13 | *.chi 14 | *.chs.h 15 | *.dyn_o 16 | *.dyn_hi 17 | .hpc 18 | .hsenv 19 | .cabal-sandbox/ 20 | cabal.sandbox.config 21 | *.prof 22 | *.aux 23 | *.hp 24 | *.eventlog 25 | .stack-work/ 26 | cabal.project.local 27 | cabal.project.local~ 28 | .HTF/ 29 | .ghc.environment.* 30 | *.out 31 | -------------------------------------------------------------------------------- /nofib/parallel/cfd/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import TG_iter 4 | import Data8 5 | import Gen_net 6 | import S_Array 7 | import Defs 8 | import Quad_def 9 | 10 | main = putStr call_tg 11 | 12 | call_tg = 13 | tg_iter 14 | mon simpl m_iter m_toler max_jcb_iter jcb_toler relax 15 | dlt_t node_lists (tri_fac ()) (init_vec ()) 16 | where 17 | node_lists = 18 | get_node_list p_total n_total (coord ()) (v_steer ()) (bry_nodes ()) p_fixed 19 | -------------------------------------------------------------------------------- /nofib/real/hidden/Matrices.hs: -------------------------------------------------------------------------------- 1 | module Matrices (Matrix,mat,rows,mulm) where 2 | import Numbers 3 | import Vectors 4 | -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 | -- section 4: matrices 6 | 7 | type Matrix = [Vector] 8 | 9 | mat :: [Vector] -> Matrix 10 | mat m = m 11 | 12 | rows :: Matrix -> [Vector] 13 | rows m = m 14 | 15 | mulm :: Matrix -> Vector -> Vector 16 | m `mulm` v = vec (map (inpr v) (rows m)) 17 | -------------------------------------------------------------------------------- /nofib/real/scs/runtime_files/inverter.in: -------------------------------------------------------------------------------- 1 | v Plus plus ground (0, 3m) 2 | v Minus ground minus (0, 3m) 3 | 4 | v In input ground (0, 0) (1u, 3m) (3u, -3m) (4u, 0) 5 | 6 | j Top plus upper 1a 1M 0 7 | j Upper upper output 2a 1M 0 8 | j Lower output lower 2a 1M 0 9 | j Bottom lower minus 1a 1M 0 10 | 11 | c UpIn input upper 8a 0 12 | c UpBias minus upper 7a 0 13 | c LoIn input lower 8a 0 14 | c LoBias plus lower 7a 0 15 | 16 | c Load output ground 1f 0 17 | -------------------------------------------------------------------------------- /nofib/spectral/life/life.test: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | $1 | sum > /tmp/sum-real-$$ 4 | 5 | cat > /tmp/sum-expected-$$ << EOTHING 6 | 02845 1350 7 | EOTHING 8 | 9 | if cmp -s /tmp/sum-real-$$ /tmp/sum-expected-$$ ; then 10 | /bin/rm /tmp/sum*$$ 11 | exit 0 12 | else 13 | echo -n '*** sum I got: ' ; cat /tmp/sum-real-$$ 14 | echo -n '*** sum I expected: ' ; cat /tmp/sum-expected-$$ 15 | /bin/rm /tmp/sum*$$ 16 | exit 1 17 | fi 18 | -------------------------------------------------------------------------------- /nofib/spectral/minimax/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Control.Monad (replicateM_) 4 | import System.Environment (getArgs) 5 | import Prog (prog) 6 | 7 | -- #ifdef PAR 8 | -- main input = prog input 9 | -- #else 10 | -- suspect:main ~((Str str):_) = [ReadChan stdin, AppendChan stdout (prog str)] 11 | main = do 12 | (n:_) <- getArgs 13 | replicateM_ (read n) $ do 14 | (s:_) <- getArgs 15 | length (prog s) `seq` return () 16 | -- #endif 17 | -------------------------------------------------------------------------------- /nofib/gc/linear/AbsCg.lhs: -------------------------------------------------------------------------------- 1 | \section{AbsCg} 2 | 3 | This module imports definitions from Cg and 4 | renames them before exporting to Main. 5 | 6 | Matrix and AbsDensematrix are imported to keep hbc happy. 7 | 8 | \begin{code} 9 | 10 | module AbsCg (solve_iters, Cg_state(..), show_state) where 11 | 12 | import Cg 13 | import Matrix 14 | import AbsDensematrix 15 | 16 | solve_iters = cgiters 17 | 18 | show_state = showcg_state 19 | 20 | \end{code} 21 | 22 | -------------------------------------------------------------------------------- /nofib/real/linear/AbsCg.lhs: -------------------------------------------------------------------------------- 1 | \section{AbsCg} 2 | 3 | This module imports definitions from Cg and 4 | renames them before exporting to Main. 5 | 6 | Matrix and AbsDensematrix are imported to keep hbc happy. 7 | 8 | \begin{code} 9 | 10 | module AbsCg (solve_iters, Cg_state(..), show_state) where 11 | 12 | import Cg 13 | import Matrix 14 | import AbsDensematrix 15 | 16 | solve_iters = cgiters 17 | 18 | show_state = showcg_state 19 | 20 | \end{code} 21 | 22 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/shinkman.prob: -------------------------------------------------------------------------------- 1 | -- W. A. Shinkman 2 | -- Western Advertiser, 1872 3 | -- `A masterly little four-mover with a definite message. 4 | -- Greater strategy could hardly be exacted from eight 5 | -- pieces.' (Phillips) 6 | 7 | - - - - - - - - 8 | - - - - - - - - 9 | - - - - P b - - 10 | - - P - - - - - 11 | - - K P p - - - 12 | - - - - - - - - 13 | - r - k - - - - 14 | - - - - - - - - 15 | 16 | White to play and mate in 4 17 | -------------------------------------------------------------------------------- /ghc-benchmarks/makefile: -------------------------------------------------------------------------------- 1 | .PHONY: matmul.out 2 | targets = incr-incr repeated-incr-maybe-recursive repeated-incr-maybe 3 | 4 | all: $(targets) 5 | 6 | $(targets): %: %.cpp 7 | clang++ $< -o $@.out -std=c++17 -Wall 8 | 9 | 10 | 11 | # incr-incr.out: incr-incr.cpp 12 | # clang++ incr-incr.cpp -std=c++17 -o incr-incr.out 13 | 14 | matmul.out: matmul.hs 15 | -rm matmul.out 16 | ghc -ddump-to-file -ddump-simpl -O2 matmul.hs -o matmul.out -package vector 17 | 18 | -------------------------------------------------------------------------------- /nofib/parallel/minimax/Main.hs: -------------------------------------------------------------------------------- 1 | -- Time-stamp: <2009-05-06 13:54:34 simonmar> 2 | ----------------------------------------------------------------------------- 3 | 4 | module Main where 5 | 6 | import System.Environment 7 | import Prog 8 | import Board 9 | import System.Random 10 | 11 | main = do 12 | [n, depth] <- fmap (map read) getArgs 13 | setStdGen (mkStdGen 99999) 14 | b <- randomBoard n 15 | putStrLn $ showBoard b 16 | putStrLn $ solve depth b 17 | -------------------------------------------------------------------------------- /nofib/real/anna/Monstermakefile: -------------------------------------------------------------------------------- 1 | 2 | MODS= BaseDefs.hs Utils.hs MyUtils.hs AbstractVals2.hs \ 3 | SuccsAndPreds2.hs AbstractMisc.hs Monster.hs 4 | INTS=$(MODS:%.hs=%.hi) 5 | OBJS=$(MODS:%.hs=%.o) 6 | ASMS=$(MODS:%.hs=%.o) 7 | HC4=hbc 8 | HBCFLAGS= -fzap-redex -c -H8000000 9 | PROFILE= -pg 10 | 11 | %.o: %.hs 12 | $(HC4) $(HBCFLAGS) $< 13 | 14 | main: $(OBJS) 15 | $(HC4) -o Monster400 $(OBJS) 16 | 17 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/filter.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); ;; 3 | 4 | filter p l 5 | = case l of Nil -> Nil; 6 | Cons x xs -> case p x of 7 | True -> Cons x (filter p xs); 8 | False -> filter p xs 9 | end 10 | end; 11 | 12 | empty l = case l of Nil -> True; Cons x xs -> False end; 13 | 14 | llist = Cons (Cons 1 Nil) Nil; 15 | 16 | res = filter empty llist; 17 | -------------------------------------------------------------------------------- /nofib/real/hidden/runtime_files/cube.plate: -------------------------------------------------------------------------------- 1 | [vec[ 0, 0, 0], vec[ 0, 10, 0], vec[ 0, 10, 10], vec[ 0, 0, 10] ] 2 | [vec[ 0, 0, 0], vec[10, 0, 0], vec[10, 0, 10], vec[ 0, 0, 10] ] 3 | [vec[ 0, 0, 10], vec[10, 0, 10], vec[10, 10, 10], vec[ 0, 10, 10] ] 4 | [vec[ 0, 10, 0], vec[ 0, 10, 10], vec[10, 10, 10], vec[10, 10, 0] ] 5 | [vec[ 0, 0, 0], vec[10, 0, 0], vec[10, 10, 0], vec[ 0, 10, 0] ] 6 | [vec[10, 0, 0], vec[10, 10, 0], vec[10, 10, 10], vec[10, 0, 10] ] 7 | -------------------------------------------------------------------------------- /nofib/real/pic/Consts.hs: -------------------------------------------------------------------------------- 1 | -- 2 | -- Patricia Fasel 3 | -- Los Alamos National Laboratory 4 | -- PIC: Particle in Cell 5 | -- 1990 August 6 | -- 7 | module Consts (charge, mass, nCell, nStep, maxDepth) where 8 | 9 | import PicType 10 | import Utils 11 | 12 | nCell, nStep, maxDepth :: Indx 13 | charge, mass :: Value 14 | nCell = 16 -- number of Cells 15 | nStep = 10 -- number of time steps 16 | maxDepth = (log2 nCell) - 1 -- 17 | charge = 1.0 18 | mass = 1.0 19 | -------------------------------------------------------------------------------- /nofib/real/reptile/reptile.stdin: -------------------------------------------------------------------------------- 1 | cs 164 26 326 384 2 | cs 164 22 28 86 3 | cs 86 26 322 262 4 | cs 240 20 326 264 5 | cs 324 20 284 150 6 | cs 380 84 364 124 7 | cs 366 128 388 172 8 | cs 384 244 288 146 9 | cs 28 166 88 246 10 | cs 26 246 84 242 11 | cs 28 324 86 248 12 | cs 84 244 248 388 13 | cs 148 304 80 388 14 | cs 184 328 162 386 15 | msc 490 278 16 | msa 662 720 17 | put 634 130 18 | put 558 60 19 | msa 880 822 20 | put 636 30 21 | put 556 136 22 | msa 484 576 23 | -------------------------------------------------------------------------------- /ghc-benchmarks/print-lazy-and-strict.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | -- | show how both lazy and strict look the same in the compiler 3 | module Foo where 4 | data Lazy = MkLazy Int Int 5 | data Strict = MkStrict !Int !Int 6 | 7 | printLazyAndStrict :: Lazy -> Strict -> IO () 8 | printLazyAndStrict lz str = 9 | case lz of 10 | MkLazy la lb -> 11 | case str of 12 | MkStrict sa sb -> 13 | do print sa; print sb; print la; print lb 14 | 15 | -------------------------------------------------------------------------------- /nofib/gc/mutstore1/Main.hs: -------------------------------------------------------------------------------- 1 | -- test performance of a mutable store represented as an Array of IORefs. 2 | 3 | module Main where 4 | import Store1 5 | --import Store2 6 | import Control.Monad 7 | import System.Environment 8 | 9 | main = 10 | do [n] <- fmap (fmap read) getArgs 11 | ss <- replicateM n mkStore 12 | replicateM_ 5 (mapM_ testSequence ss) 13 | 14 | testSequence :: Store -> IO () 15 | testSequence s = 16 | do replicateM_ 5 (addElemToBucket s 3 17) 17 | -------------------------------------------------------------------------------- /nofib/gc/mutstore2/Main.hs: -------------------------------------------------------------------------------- 1 | -- test performance of a mutable store represented as an IOArray of lists. 2 | 3 | module Main where 4 | --import Store1 5 | import Store2 6 | import Control.Monad 7 | import System.Environment 8 | 9 | main = 10 | do [n] <- fmap (fmap read) getArgs 11 | ss <- replicateM n mkStore 12 | replicateM_ 5 (mapM_ testSequence ss) 13 | 14 | testSequence :: Store -> IO () 15 | testSequence s = 16 | do replicateM_ 5 (addElemToBucket s 3 17) 17 | -------------------------------------------------------------------------------- /nofib/spectral/minimax/Prog.hs: -------------------------------------------------------------------------------- 1 | module Prog(prog) where 2 | 3 | import Board 4 | import Wins 5 | import Game 6 | import Tree 7 | 8 | 9 | prog :: String -> String 10 | prog input = 11 | "OXO\n" ++ 12 | concat (map showMove game) 13 | where 14 | board "doesn't happen" = testBoard ++ testBoard 15 | board _ = testBoard 16 | game = alternate X max' min' (board input) 17 | 18 | 19 | testBoard = [[Empty,O,Empty],[Empty,X,Empty],[Empty,Empty,Empty]] 20 | 21 | -------------------------------------------------------------------------------- /nofib/gc/spellcheck/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | 3 | include $(TOP)/mk/boilerplate.mk 4 | 5 | all boot :: input 6 | 7 | input : words 8 | cat words words words words words words words words words words >$@ 9 | 10 | SRC_HC_OPTS += -package containers 11 | NORM_OPTS = words input 12 | 13 | ifeq "$(HEAP)" "LARGE" 14 | SRC_RUNTEST_OPTS += +RTS -H32m -RTS 15 | endif 16 | ifeq "$(HEAP)" "OLD" 17 | SRC_RUNTEST_OPTS += +RTS -H10m -RTS 18 | endif 19 | 20 | include $(TOP)/mk/target.mk 21 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/treeDepth.cor: -------------------------------------------------------------------------------- 1 | 2 | expr t1 t2 t3 ::= Num t1 | 3 | Lam t2 (expr t1 t2 t3) | 4 | Var t3 | 5 | App (expr t1 t2 t3) (expr t1 t2 t3); 6 | 7 | list a ::= Nil | Cons a (list a) ; ;; 8 | 9 | 10 | walk e = case e of 11 | Num n -> n; 12 | Lam v e2 -> walk e2; 13 | Var v -> 0; 14 | App e1 e2 -> 15 | (\x y -> case x>y of True -> x; False -> y end) (walk e1) (walk e2) 16 | end; 17 | 18 | -------------------------------------------------------------------------------- /nofib/spectral/hartel/ida/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -fglasgow-exts 5 | 6 | # The first parameter varies the number of iterations, 7 | # the second parameter is actual input. My measurements 8 | # in #15999 show that we probably want to have a high 9 | # first parameter for stable results. 10 | # SG 11 | FAST_OPTS = 1500 2 12 | NORM_OPTS = 600 3 13 | SLOW_OPTS = 3000 3 14 | 15 | include $(TOP)/mk/target.mk 16 | 17 | -------------------------------------------------------------------------------- /nofib/smp/smpbench.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | make clean boot 4 | make -k |& tee log-normal 5 | make clean boot 6 | make -k EXTRA_HC_OPTS=-threaded |& tee log-threaded 7 | make clean boot 8 | make -k EXTRA_HC_OPTS=-smp |& tee log-smp-N1 9 | make -k EXTRA_HC_OPTS=-smp EXTRA_RUNTEST_OPTS='+RTS -N2 -RTS' |& tee log-smp-N2 10 | make -k EXTRA_HC_OPTS=-smp EXTRA_RUNTEST_OPTS='+RTS -N8 -RTS' |& tee log-smp-N8 11 | make -k EXTRA_HC_OPTS=-smp EXTRA_RUNTEST_OPTS='+RTS -N16 -RTS' |& tee log-smp-N16 12 | -------------------------------------------------------------------------------- /nofib/gc/spellcheck/spellcheck.hs: -------------------------------------------------------------------------------- 1 | import System.Environment (getArgs) 2 | import qualified Data.Set as Set 3 | import System.IO 4 | 5 | main = do 6 | [file1,file2] <- getArgs 7 | dict <- readFileLatin1 file1 8 | input <- readFileLatin1 file2 9 | let set = Set.fromList (words dict) 10 | let tocheck = words input 11 | print (filter (`Set.notMember` set) tocheck) 12 | 13 | readFileLatin1 f = do 14 | h <- openFile f ReadMode 15 | hSetEncoding h latin1 16 | hGetContents h 17 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/fridlizius.prob: -------------------------------------------------------------------------------- 1 | -- J. Fridlizius 2 | -- 1st Prize, St Petersburg, 1898. 3 | -- `In the best three-movers beauty of mating positions is an 4 | -- essential attribute. Four diverse model mates are skilfully 5 | -- combined here.' (Phillips) 6 | 7 | - - - - - - - - 8 | B - - - - P k - 9 | - P - b - - - - 10 | N - - n - - P - 11 | p - p K - - - - 12 | - - r - - - - - 13 | - - p P B - - - 14 | - - - - - - - q 15 | 16 | White to play and mate in 3 17 | -------------------------------------------------------------------------------- /nofib/imaginary/primes/csieve.c: -------------------------------------------------------------------------------- 1 | # include 2 | 3 | 4 | # define MAX_SIEVE 100000 5 | 6 | int sieve_array[MAX_SIEVE]; 7 | 8 | 9 | void primes() 10 | { 11 | int p = 1, 12 | i; 13 | 14 | while (1) 15 | { 16 | p++; 17 | while (p=MAX_SIEVE) break; 19 | printf(" %d,", p); 20 | 21 | for (i = 2*p; i Int -> Int 17 | ddelay 0 0 = 0 18 | ddelay m 0 = ddelay (m-1) delay_time 19 | ddelay m n = ddelay m (n-1) 20 | 21 | delay d = ddelay d 0 22 | 23 | delaya :: Int -> Int -> Int 24 | delaya a d = delay d 25 | -------------------------------------------------------------------------------- /nofib/parallel/gray/CSG.hs: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2000 Galois Connections, Inc. 2 | -- All rights reserved. This software is distributed as 3 | -- free software under the license in the file "LICENSE", 4 | -- which is included in the distribution. 5 | 6 | module CSG(module Construct, 7 | module Geometry, 8 | module Intersections, 9 | module Interval, 10 | module Misc) where 11 | 12 | import Construct 13 | import Geometry 14 | import Intersections 15 | import Interval 16 | import Misc 17 | -------------------------------------------------------------------------------- /core2MLIR/test-programs/.gitignore: -------------------------------------------------------------------------------- 1 | fibraw 2 | fibstrict 3 | dist 4 | dist-newstyle 5 | cabal.project.local 6 | .ghc.environment.* 7 | dump/ 8 | dist 9 | dist-* 10 | cabal-dev 11 | *.o 12 | *.hi 13 | *.hie 14 | *.chi 15 | *.chs.h 16 | *.dyn_o 17 | *.dyn_hi 18 | .hpc 19 | .hsenv 20 | .cabal-sandbox/ 21 | cabal.sandbox.config 22 | *.prof 23 | *.aux 24 | *.hp 25 | *.eventlog 26 | .stack-work/ 27 | cabal.project.local 28 | cabal.project.local~ 29 | .HTF/ 30 | .ghc.environment.* 31 | *.out 32 | fib 33 | fibraw 34 | -------------------------------------------------------------------------------- /nofib/runstdtest/Makefile: -------------------------------------------------------------------------------- 1 | TOP=.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG=runstdtest 5 | CLEAN_FILES += $(PROG) 6 | all:: 7 | $(RM) -f $(PROG) 8 | echo '#!$(PERL)' >> $(PROG) 9 | echo '$$RM = "$(RM)";' >> $(PROG) 10 | echo '$$CONTEXT_DIFF = "$(CONTEXT_DIFF)";' >> $(PROG) 11 | cat $(PROG).prl >> $(PROG) 12 | $(EXECUTABLE_FILE) $(PROG) 13 | 14 | boot :: all 15 | 16 | include $(TOP)/mk/ghc-target.mk 17 | -------------------------------------------------------------------------------- /nofib/parallel/nbody/Future.hs: -------------------------------------------------------------------------------- 1 | module Future (Eval(..), Future, runEval, rseq, fork, join, deep) where 2 | 3 | import Control.DeepSeq 4 | import Control.Parallel 5 | import Control.Parallel.Strategies 6 | 7 | data Future a = Future a 8 | 9 | fork :: Eval a -> Eval (Future a) 10 | fork a = do a' <- rpar (runEval a); return (Future a') 11 | 12 | join :: Future a -> Eval a 13 | join (Future a) = a `pseq` return a 14 | 15 | deep :: NFData a => Eval a -> Eval a 16 | deep m = do a <- m; rnf a `pseq` return a 17 | -------------------------------------------------------------------------------- /nofib/real/fem/inC/data.1: -------------------------------------------------------------------------------- 1 | 8 16 3 7 2 | 3 | 0 3 110 4 | 0 0 130 5 | 2 3 110 6 | 2 0 110 7 | 4 3 110 8 | 4 0 110 9 | 6 3 310 10 | 6 0 310 11 | 12 | 1 3 1 13 | 3 5 1 14 | 5 7 1 15 | 2 4 1 16 | 4 6 1 17 | 6 8 1 18 | 19 | 1 2 2 20 | 3 4 2 21 | 5 6 2 22 | 7 8 2 23 | 24 | 1 4 3 25 | 4 5 3 26 | 5 8 3 27 | 2 3 3 28 | 3 6 3 29 | 6 7 3 30 | 31 | 60000 0 32 | 40000 0 33 | 20000 0 34 | 35 | 1 0 -1.0 0 36 | 3 0 -1.5 0 37 | 5 0 -1.5 0 38 | 7 0 -1.0 0 39 | 4 0 -1.0 0 40 | 6 0 -1.0 0 41 | 8 0 -0.5 0 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /nofib/gc/gc_bench/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -package old-time 5 | 6 | # kLongLivedTreeDepth = 17 :: Int 7 | # kArraySize = 500000 :: Int 8 | # kMinTreeDepth = 4 :: Int 9 | # kMaxTreeDepth = 17 :: Int 10 | 11 | FAST_OPTS = 17 400000 4 17 12 | NORM_OPTS = 18 500000 4 19 13 | SLOW_OPTS = 19 500000 5 22 14 | 15 | ifeq "$(HEAP)" "LARGE" 16 | SRC_RUNTEST_OPTS += +RTS -H180m -RTS 17 | endif 18 | 19 | include $(TOP)/mk/target.mk 20 | 21 | -------------------------------------------------------------------------------- /nofib/parallel/blackscholes/Future.hs: -------------------------------------------------------------------------------- 1 | module Future (Eval(..), Future, runEval, rseq, fork, join, deep) where 2 | 3 | import Control.DeepSeq 4 | import Control.Parallel 5 | import Control.Parallel.Strategies 6 | 7 | data Future a = Future a 8 | 9 | fork :: Eval a -> Eval (Future a) 10 | fork a = do a' <- rpar (runEval a); return (Future a') 11 | 12 | join :: Future a -> Eval a 13 | join (Future a) = a `pseq` return a 14 | 15 | deep :: NFData a => Eval a -> Eval a 16 | deep m = do a <- m; rnf a `pseq` return a 17 | -------------------------------------------------------------------------------- /nofib/real/veritas/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | include $(TOP)/mk/target.mk 5 | 6 | # I highly doubt that the current stdin file (which is just `grip-in` from the 7 | # README) touches enough of the prover to be meaningful as a benchmark. But 8 | # without any reference on how to construct a proper input, I see no way to 9 | # make use this benchmark other than just iterating it more often. 10 | FAST_OPTS = 400 11 | NORM_OPTS = 4000 12 | SLOW_OPTS = 20000 13 | -------------------------------------------------------------------------------- /reading/reference-ghc-dump/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-newstyle 3 | cabal.project.local 4 | .ghc.environment.* 5 | *.core 6 | *.mlir 7 | dump/ 8 | 9 | dist 10 | dist-* 11 | cabal-dev 12 | *.o 13 | *.hi 14 | *.hie 15 | *.chi 16 | *.chs.h 17 | *.dyn_o 18 | *.dyn_hi 19 | .hpc 20 | .hsenv 21 | .cabal-sandbox/ 22 | cabal.sandbox.config 23 | *.prof 24 | *.aux 25 | *.hp 26 | *.eventlog 27 | .stack-work/ 28 | cabal.project.local 29 | cabal.project.local~ 30 | .HTF/ 31 | .ghc.environment.* 32 | *.out 33 | fib 34 | fibraw 35 | -------------------------------------------------------------------------------- /core2MLIR/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 532177 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/20.yaml 11 | sha256: 0e14ba5603f01e8496e8984fd84b545a012ca723f51a098c6c9d3694e404dc6d 12 | original: lts-16.20 13 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/heathcote3.soln: -------------------------------------------------------------------------------- 1 | - - - - - - - - 2 | - - - - - - - - 3 | - - - - - - - - 4 | - - - - P - - - 5 | - - - - p - k b 6 | - P n - K - - - 7 | - P - - - - - - 8 | - q - - - - - - 9 | 10 | White to move and mate in 3 11 | 12 | 1. N/QB3-QR2, 13 | if P/QN6xN/QR7; 2. Q-QB2, ... ; 3. B/KR4-KB2 ++ 14 | if K-K7; 2. N/QR2-QN4, 15 | if K-K6; 3. Q-Q3 ++ 16 | if K-Q7; 3. Q-K1 ++ 17 | if K-Q7; 2. K-KB3, P/QN6xN/QR7; 3. B/KR4-K1 ++ 18 | if K-Q5; 2. B/KR4-KB2, K-QB5; 3. Q-KB1 ++ 19 | -------------------------------------------------------------------------------- /core2MLIR/test-programs/fibstrict.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | -- https://downloads.haskell.org/~ghc/8.2.1/docs/html/libraries/base-4.10.0.0/src/GHC-Base.html 3 | -- https://hackage.haskell.org/package/base-4.3.1.0/docs/src/GHC-Int.html 4 | -- https://hackage.haskell.org/package/ghc-prim-0.6.1/docs/GHC-Prim.html 5 | import GHC.Prim 6 | fibstrict :: Int# -> Int# 7 | fibstrict i = case i of 0# -> i; 1# -> i; _ -> (fibstrict i) +# (fibstrict (i -# 1#)) 8 | main :: IO (); 9 | main = let x = fibstrict 10# in return () 10 | -------------------------------------------------------------------------------- /nofib/real/hidden/Main.hs: -------------------------------------------------------------------------------- 1 | module Main(main) where 2 | import Numbers 3 | import Vectors 4 | import Hide 5 | import MyIO 6 | import EdgePlate ( Input(..) ) -- partain 7 | import Postscript ( Output(..) ) -- partain 8 | import Control.Monad 9 | import System.IO 10 | import System.Environment 11 | import NofibUtils 12 | 13 | main = do 14 | input <- hGetContents stdin 15 | replicateM_ 20 $ do 16 | ls <- salt input 17 | (getFilename $ 18 | process (\viewdir -> hiddenline viewdir. map read. lines)) (lines ls) 19 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # root_file="$1" 5 | # working_directory="$2" 6 | # compiler="$3" 7 | # args="$4" 8 | # extra_system_packages="$5" 9 | # 10 | # if [ -n "$extra_system_packages" ]; then 11 | # apt-get update 12 | # for pkg in $extra_system_packages; do 13 | # echo "Install $pkg by apt" 14 | # apt-get -y install "$pkg" 15 | # done 16 | # fi 17 | 18 | # cd thesis 19 | # pdflatex thesis.tex -pdf --shell-escape -latexoption=-file-line-error -latexoption=-interaction=nonstopmode 20 | # TOUCH 21 | -------------------------------------------------------------------------------- /nofib/gc/mutstore1/Store1.hs: -------------------------------------------------------------------------------- 1 | --Immutable array with IORefs to lists 2 | 3 | module Store1 where 4 | import Data.IORef 5 | import Data.Array 6 | 7 | type Store = Array Int (IORef [Int]) 8 | 9 | mkStore :: IO Store 10 | mkStore = 11 | do buckets <- sequence ( take 10 $ repeat (newIORef []) ) 12 | let myArray = listArray (0, 9) buckets 13 | return $! myArray 14 | 15 | addElemToBucket :: Store -> Int -> Int -> IO () 16 | addElemToBucket a k e = 17 | do buc <- readIORef (a!k) 18 | writeIORef (a!k) (e : buc) 19 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/poly_loseGain.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | if c t f = case c of True -> t; False -> f end; 7 | 8 | loses l = case l of Nil -> 0; Cons x xs -> 1 + loses xs end; 9 | 10 | gains x = letrec loop=loop in loop; 11 | 12 | rep n x = if (n <= 0) Nil (Cons x (rep (n-1) x)); 13 | 14 | length = loses; 15 | 16 | append l1 l2 = case l1 of Nil -> l2; Cons x xs -> Cons x (append xs l2) end; 17 | 18 | gainAndLose as bs 19 | = letrec loop=loop in append as (rep (length bs) loop); 20 | 21 | -------------------------------------------------------------------------------- /nofib/real/compress2/inC/bin_conv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * bin_conv.c 3 | * 4 | * Take two codes and turn them into three 8-bit ints (ala LZW) 5 | */ 6 | 7 | conv () 8 | { 9 | register short int x, y; 10 | register short int o1, o2, o3; 11 | int i; 12 | 13 | x = 3077; y = 1192; 14 | 15 | o1 = x >> 4; 16 | o2 = ((x & 15) << 4) + (y >> 8); 17 | o3 = y & 255; 18 | 19 | printf ("%d, %d, %d\n", o1, o2, o3); 20 | } 21 | 22 | main () 23 | { 24 | 25 | register int i; 26 | 27 | for (i=0; i < 1000; i++) 28 | conv (); 29 | } 30 | -------------------------------------------------------------------------------- /nofib/real/pic/Main.hs: -------------------------------------------------------------------------------- 1 | -- 2 | -- Patricia Fasel 3 | -- Los Alamos National Laboratory 4 | -- 1990 August 5 | -- 6 | import Pic 7 | import PicType -- added by partain 8 | import Control.Exception(evaluate) 9 | import Control.Monad(replicateM_) 10 | import System.IO(hPutStr,stderr) 11 | import System.Environment(getArgs) 12 | import NofibUtils (hash,salt) 13 | 14 | main = do 15 | (n:_) <- getArgs 16 | replicateM_ (read n) $ do 17 | (_:s:_) <- getArgs 18 | evaluate (hash (takeWhile ((/=) '\n') s ++ pic (read s))) 19 | -------------------------------------------------------------------------------- /test/playground.mlir: -------------------------------------------------------------------------------- 1 | module { 2 | hask.adt @X [#hask.data_constructor<@MkX []>] 3 | hask.func @main { 4 | %0 = hask.lambda(%arg0:!hask.thunk) { 5 | %1 = hask.make_i64(42 : i64) 6 | %2 = hask.construct(@X, %1 : !hask.value) : !hask.adt<@X> 7 | %3 = hask.transmute(%2 :!hask.adt<@X>):!hask.value 8 | %4 = hask.thunkify(%3 :!hask.value):!hask.thunk 9 | hask.return(%1) : !hask.value 10 | } 11 | hask.return(%0) : !hask.fn<(!hask.thunk) -> !hask.value> 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nofib/parallel/gray/Main.hs: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2000 Galois Connections, Inc. 2 | -- All rights reserved. This software is distributed as 3 | -- free software under the license in the file "LICENSE", 4 | -- which is included in the distribution. 5 | 6 | -- Modified to read sample input directly from a file. 7 | 8 | module Main where 9 | 10 | import System.IO 11 | 12 | import Parse 13 | import Eval 14 | 15 | main = do { str <- readFile "galois.gml" 16 | ; hSetBinaryMode stdout True 17 | ; mainEval (rayParse str) 18 | } 19 | -------------------------------------------------------------------------------- /nofib/real/symalg/Ast.hs: -------------------------------------------------------------------------------- 1 | module Ast where 2 | 3 | import BasicNumber 4 | 5 | type VarName = String 6 | 7 | type FunName = String 8 | 9 | -- abstract syntax tree 10 | data Ast = Set VarName BasicExp -- set variable literally 11 | | EvalSet VarName BasicExp -- eval and set 12 | | Eval BasicExp -- eval 13 | | NullCmd -- null command 14 | | SyntaxError -- syntax error 15 | 16 | -- basic expression 17 | data BasicExp = Func FunName [BasicExp] 18 | | Numb BasicNumber 19 | | Var String 20 | | EVar String 21 | | BSError 22 | -------------------------------------------------------------------------------- /nofib/imaginary/queens/Main.hs: -------------------------------------------------------------------------------- 1 | -- !!! count the number of solutions to the "n queens" problem. 2 | -- (grabbed from LML dist) 3 | 4 | import System.Environment 5 | 6 | 7 | main = do 8 | [arg] <- getArgs 9 | print $ nsoln $ read arg 10 | 11 | nsoln nq = length (gen nq) 12 | where 13 | safe :: Int -> Int -> [Int] -> Bool 14 | safe x d [] = True 15 | safe x d (q:l) = x /= q && x /= q+d && x /= q-d && safe x (d+1) l 16 | 17 | gen :: Int -> [[Int]] 18 | gen 0 = [[]] 19 | gen n = [ (q:b) | b <- gen (n-1), q <- [1..nq], safe q 1 b] 20 | -------------------------------------------------------------------------------- /nofib/parallel/prsa/Main.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | where 3 | 4 | import Rsa 5 | import System.Environment 6 | 7 | main = do 8 | [n] <- fmap (map read) getArgs 9 | let text = replicate n 'x' 10 | putStr (encrypt 2036450659413645137870851576872812267542175329986469156678671505255564383842535488743101632280716717779536712424613501441720195827856504007305662157107 11 | 387784473137902876992546516170169092918207676456888779623592396031349415024943784869634893342729620092877891356118467738167515879252473323905128540213 12 | 13 | text) 14 | -------------------------------------------------------------------------------- /nofib/real/mkhprog/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | include $(TOP)/mk/target.mk 5 | 6 | ARGS = -a Int -b Float -c Foo -d Bar -e Double \ 7 | -f String -g String -h Int -j Double -k Bool -n Basil -p Knob -q Wizzle \ 8 | -r Wissle -s Wibble -u Widdle -A Int -B Float -C Foo -D Bar -E Double \ 9 | -F String -G String -H Int -I Float -J Double -K Bool -L Bool -M Buzzle \ 10 | -N Basil -P Knob -Q Wizzle -R Wissle -S Wibble -T Widdle 11 | 12 | FAST_OPTS = 200 $(ARGS) 13 | NORM_OPTS = 2000 $(ARGS) 14 | SLOW_OPTS = 10000 $(ARGS) 15 | -------------------------------------------------------------------------------- /nofib/real/reptile/Interstate.hs: -------------------------------------------------------------------------------- 1 | -- LML original: Sandra Foubister, 1990 2 | -- Haskell translation: Colin Runciman, May 1991 3 | 4 | module Interstate(inter) where 5 | 6 | inter :: (a->[b]) -> (a->c->Bool) -> (a->c->([b],a,c)) -> (a->c->[b]) 7 | inter prompt endp transact = 8 | interprog 9 | where 10 | interprog state inpt = 11 | prompt state ++ 12 | if endp state inpt then [] 13 | else response ++ interprog newstate restofinput 14 | where 15 | (response,newstate,restofinput) = transact state inpt 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/wurzburg.soln: -------------------------------------------------------------------------------- 1 | - - k - - - - - 2 | r - - - - - - - 3 | - - - p K - - - 4 | - - - - P - - - 5 | - - - p p b - - 6 | - - - p - p - - 7 | - - - - - - - - 8 | - - - - - - - - 9 | 10 | White to move and mate in 3 11 | 12 | 1. P-Q7, 13 | if P/K4xP/Q5; 2. P/Q7-Q8(R), K-KB3; 3. R/Q8-Q6 ++ 14 | if K-K2; 2. P/Q7-Q8(Q), K-K3; 3. Q-K7 ++ 15 | if K-Q3; 2. P/Q7-Q8(N), P/K4xB/KB5; 3. R/QR7-Q7 ++ 16 | if P/K4xB/KB5; 2. P/Q7-Q8(B), K-Q3; 3. R/QR7-QR6 ++ 17 | ... ; 2. P/Q7-Q8(Q), 18 | if K-KN3; 3. Q-KN5 ++ 19 | if K-K3; 3. Q-K7 ++ 20 | -------------------------------------------------------------------------------- /nofib/spectral/mate/runtime_files/ellerman.soln: -------------------------------------------------------------------------------- 1 | b k - - - - - - 2 | - n p - - - - - 3 | - - - - - - - - 4 | r - - - - p - - 5 | R - - - K - - - 6 | - - - r P - p - 7 | - Q - - - - - - 8 | - - - - - q B B 9 | 10 | White to move and mate in 2 11 | 1. R/Q3-Q7, 12 | if Q/QN7xN/QN2; 2. B/QR8xQ/QN7++ 13 | if Q/QN7-Q5; 2. N/QN7-Q6++ 14 | if Q/QN7-K4; 2. N/QN7-QB5++ 15 | if B/KR8-KB6; 2. Q/KB1-Q3++ 16 | if B/KN8-KB7; 2. Q/KB1xB/KR1++ 17 | if R/QR5-Q5; 2. R/Q7-K7++ 18 | if Q/QN7-QR8, -QR6, -K7, -KB7, -KN7, -KN2, -KR7, -KR1; 2. N/QN7-Q8++ 19 | if others; 2. Q/KB1-KB4++ 20 | -------------------------------------------------------------------------------- /nofib/real/anna/runtime_files/anna_table: -------------------------------------------------------------------------------- 1 | 2 | [ 3 | (Func [Two, Two] Two, 4 | 6), 5 | 6 | (Func [Two, Two, Two] Two, 7 | 20), 8 | 9 | (Func [Lift1 [Two]] Lift1 [Two], 10 | 10), 11 | 12 | (Func [Two, Lift2 [Two]] Two, 13 | 15), 14 | 15 | (Func [Two, Two] Lift2 [Two], 16 | 50), 17 | 18 | (Func [Two, Two, Lift1 [Two]] Two, 19 | 50), 20 | 21 | (Func [Lift2 [Two], Lift2 [Two]] Two, 22 | 70), 23 | 24 | (Func [Two, Lift2 [Two]] Lift2 [Two], 25 | 490), 26 | 27 | (Func [Lift2 [Two], Lift2 [Two]] Lift2 [Two], 28 | 24696) 29 | ] -------------------------------------------------------------------------------- /nofib/real/fem/data.1: -------------------------------------------------------------------------------- 1 | 8 16 3 7 2 | 3 | 0.0 3.0 110 4 | 0.0 0.0 130 5 | 2.0 3.0 110 6 | 2.0 0.0 110 7 | 4.0 3.0 110 8 | 4.0 0.0 110 9 | 6.0 3.0 310 10 | 6.0 0.0 310 11 | 12 | 1 3 1 13 | 3 5 1 14 | 5 7 1 15 | 2 4 1 16 | 4 6 1 17 | 6 8 1 18 | 19 | 1 2 2 20 | 3 4 2 21 | 5 6 2 22 | 7 8 2 23 | 24 | 1 4 3 25 | 4 5 3 26 | 5 8 3 27 | 2 3 3 28 | 3 6 3 29 | 6 7 3 30 | 31 | 60000.0 0.0 32 | 40000.0 0.0 33 | 20000.0 0.0 34 | 35 | 1 0.0 -1.0 0.0 36 | 3 0.0 -1.5 0.0 37 | 5 0.0 -1.5 0.0 38 | 7 0.0 -1.0 0.0 39 | 4 0.0 -1.0 0.0 40 | 6 0.0 -1.0 0.0 41 | 8 0.0 -0.5 0.0 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /nofib/spectral/mate/Main.hs: -------------------------------------------------------------------------------- 1 | module Main(main) where 2 | import Board 3 | import Solution 4 | import Problem 5 | import System.Environment( getArgs ) 6 | 7 | main = do { files <- getArgs ; 8 | mapM mateInN files } 9 | 10 | mateInN file 11 | = do { putStrLn "" ; 12 | putStrLn ("File: " ++ file) ; 13 | input <- readFile file ; 14 | let { (bd, (c,n)) = readProblem input ; 15 | result = showBoard bd ++ 16 | "\n" ++ 17 | show c ++ " to move and mate in " ++ show n ++ "\n" ++ 18 | "\n" ++ 19 | solve bd c n 20 | 21 | } ; 22 | putStr result } 23 | 24 | -------------------------------------------------------------------------------- /nofib/real/compress/Defaults.hs: -------------------------------------------------------------------------------- 1 | {- 2 | - Defaults.hs 3 | - 4 | - Contains the tuning values for compress and uncompress 5 | - 6 | -} 7 | 8 | module Defaults 9 | where 10 | 11 | -- Maximum number of table entries (probably = 2^code_bits) 12 | 13 | max_entries :: Int 14 | max_entries = 2 ^ code_bits 15 | 16 | -- First code value available 17 | 18 | first_code :: Int 19 | first_code = 256 20 | 21 | -- Number of bits per output character 22 | 23 | ascii_bits :: Int 24 | ascii_bits = 8 25 | 26 | -- Number of bits to represent code by 27 | 28 | code_bits :: Int 29 | code_bits = 12 30 | -------------------------------------------------------------------------------- /nofib/spectral/para/c++/Queue.h: -------------------------------------------------------------------------------- 1 | 2 | // Queue.h 3 | 4 | 5 | template 6 | class Queue 7 | { 8 | T* Q; 9 | T* i; 10 | T* j; 11 | 12 | public: 13 | 14 | Queue(int); 15 | ~Queue(); 16 | 17 | QReset(); 18 | 19 | void Cons(T elem); 20 | void RemoveHead(); 21 | void RemoveLast(); 22 | 23 | int NotEmpty() const; 24 | int NotSingle() const; 25 | 26 | T Head() const; 27 | T Head1() const; 28 | T Last() const; 29 | T Last1() const; 30 | 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /nofib/docs/paper/run.txt: -------------------------------------------------------------------------------- 1 | clausify/ghc 19.7 16.7 1.6 2 | clausify/hbc 9.3 6.3 2.1 3 | infer/ghc 3.6 1.5 0.9 4 | infer/hbc 2.0 0.5 0.8 5 | lift/ghc 3.3 1.5 0.9 6 | lift/hbc 1.8 0.5 0.7 7 | minimax/ghc 12.9 10.0 1.7 8 | minimax/hbc 4.2 2.9 0.7 9 | reptile/ghc 30.2 25.2 2.5 10 | reptile/hbc 19.5 16.2 2.0 11 | rewrite/ghc 11.2 8.4 2.0 12 | rewrite/hbc 3.6 2.1 0.7 13 | -------------------------------------------------------------------------------- /nofib/real/compress/PTTrees.hs: -------------------------------------------------------------------------------- 1 | module PTTrees (insert, PrefixTree(..), PrefixElem(..)) where 2 | 3 | data PrefixTree a b = PTNil | 4 | PT (PrefixElem a b) (PrefixTree a b) (PrefixTree a b) 5 | 6 | data PrefixElem a b = PTE a b (PrefixTree a b) 7 | 8 | {-partain-} 9 | --insert :: Char -> Int -> PrefixTree Char Int -> PrefixTree Char Int 10 | {-partain-} 11 | 12 | insert k v PTNil = 13 | PT (PTE k v PTNil) PTNil PTNil 14 | insert k v (PT p@(PTE k' v' t) l r) 15 | | k < k' = PT p (insert k v l) r 16 | | k > k' = PT p l (insert k v r) 17 | | otherwise = PT p l r 18 | -------------------------------------------------------------------------------- /nofib/spectral/Makefile: -------------------------------------------------------------------------------- 1 | TOP = .. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # TODO(michalt): Re-enable `secretary` (requires `random`) 5 | SUBDIRS = ansi atom awards banner boyer boyer2 calendar cichelli circsim \ 6 | clausify constraints cryptarithm1 cryptarithm2 cse dom-lt eliza expert \ 7 | exact-reals fft2 fibheaps fish gcd hartel integer knights lambda \ 8 | last-piece lcss life mandel mandel2 mate minimax multiplier para \ 9 | power pretty primetest puzzle rewrite scc simple sorting sphere \ 10 | treejoin 11 | 12 | include $(TOP)/mk/target.mk 13 | 14 | -------------------------------------------------------------------------------- /nofib/real/linear/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | -include opts.mk 4 | # It's necessary to specify the HS_SRCS so that the current make-based system 5 | # compiles the modules in the right order (otherwise it starts with AbsCg, which 6 | # fails due to missing .hi files) 7 | # TODO(michalt): This should go away once we switch to the Shake-based system 8 | HS_SRCS = Utils.lhs Misc.lhs Densematrix.lhs AbsDensematrix.lhs Matrix.lhs Cg.lhs Input.lhs Matlib.lhs Absmatlib.lhs AbsCg.lhs Main.lhs 9 | 10 | include $(TOP)/mk/target.mk 11 | 12 | FAST_OPTS = 2 13 | NORM_OPTS = 4 14 | SLOW_OPTS = 7 15 | -------------------------------------------------------------------------------- /nofib/real/prolog/runtime_files/stdlib: -------------------------------------------------------------------------------- 1 | This file contains a list of predicate definitions that will automatically 2 | be read into Mini Prolog at the beginning of a session. Each clause in this 3 | file must be entered on a single line and lines containing syntax errors are 4 | always ignored. This includes the first few lines of this file and provides 5 | a simple way to include comments. 6 | 7 | append(nil,X,X). 8 | append(cons(X,Y),Z,cons(X,W)):==append(Y,Z,W). 9 | 10 | equals(X,X). 11 | 12 | not(X):==X,!,false. 13 | not(X). 14 | 15 | or(X,Y):==X. 16 | or(X,Y):==Y. 17 | 18 | true. 19 | 20 | End of stdlib 21 | -------------------------------------------------------------------------------- /test/playground-roundtrip.mlir: -------------------------------------------------------------------------------- 1 | 2 | 3 | module { 4 | hask.func @k { 5 | %0 = hask.lambdaSSA(%arg0:!hask.thunk,%arg1:!hask.thunk) { 6 | hask.return(%arg0) : !hask.thunk 7 | } 8 | hask.return(%0) : !hask.fn> 9 | } 10 | hask.func @loop { 11 | %0 = hask.lambdaSSA(%arg0:!hask.thunk) { 12 | %1 = hask.ref(@loop) : !hask.fn 13 | %2 = hask.apSSA(%1 :!hask.fn, %arg0) 14 | hask.return(%2) : !hask.thunk 15 | } 16 | hask.return(%0) : !hask.fn 17 | } 18 | } -------------------------------------------------------------------------------- /nofib/spectral/minimax/Tree.hs: -------------------------------------------------------------------------------- 1 | module Tree where 2 | 3 | data Tree a = Branch a [Tree a] deriving Show{-was:Text-} 4 | 5 | repTree :: (a->[a]) -> (a->[a])-> a -> (Tree a) 6 | repTree f g a = Branch a (map (repTree g f) (f a)) 7 | 8 | 9 | mapTree :: (a -> b) -> (Tree a) -> (Tree b) 10 | mapTree f (Branch a l) = Branch (f a) (map (mapTree f) l) 11 | 12 | prune :: Int -> (Tree a) -> (Tree a) 13 | prune 0 (Branch a l) = Branch a [] 14 | --should be:prune (n+1) (Branch a l) = Branch a (map (prune n) l) 15 | prune n (Branch a l) | n < 0 = error "Tree.prune: < 0" 16 | | otherwise = Branch a (map (prune (n-1)) l) 17 | 18 | -------------------------------------------------------------------------------- /nofib/nofib-analyse/Makefile: -------------------------------------------------------------------------------- 1 | TOP=.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | PROG = nofib-analyse 5 | 6 | $(PROG): *.hs 7 | cabal v2-build -w $(BOOT_HC) 8 | cp $$(cabal v2-exec -w $(BOOT_HC) -- which $(PROG)) $(PROG) 9 | 10 | all :: $(PROG) 11 | 12 | boot :: $(PROG) 13 | 14 | # This clean hierarchy mirrors mk/ghc-target.mk. 15 | # See mk/ghc-paths.mk for the semantics. 16 | 17 | .PHONY: mostlyclean clean distclean maintainer-clean 18 | 19 | mostlyclean:: 20 | rm -rf dist-newstyle dist .ghc.environment.* 21 | 22 | clean:: mostlyclean 23 | rm -f $(PROG) 24 | 25 | distclean:: clean 26 | maintainer-clean:: distclean 27 | -------------------------------------------------------------------------------- /nofib/spectral/scc/Main.hs: -------------------------------------------------------------------------------- 1 | -- !!! strongly-connected components of a graph 2 | -- (courtesy mainly of John Launchbury) 3 | 4 | import Digraph 5 | 6 | main = print (stronglyConnComp edges vertices) 7 | where 8 | -- here's a test graph: Figure 6.4 from SLPJ 87 9 | a, b, c, d, f, g, h :: Int 10 | a = 1 11 | b = 2 12 | c = 3 13 | d = 4 14 | f = 5 15 | g = 6 16 | h = 7 17 | vertices = [a,b,c,d,f,g,h] 18 | edges = [(b, a), 19 | (c, b), 20 | (c, d), 21 | (c, h), 22 | (d, c), 23 | (f, a), 24 | (f, g), 25 | (f, h), 26 | (g, f), 27 | (h, g)] 28 | -------------------------------------------------------------------------------- /nofib/smp/threads007/Main.hs: -------------------------------------------------------------------------------- 1 | -- Program from Neil Brown on haskell-cafe. 2 | -- 3 | -- It exposes the O(n^2) behaviour in removing threads from the queue 4 | -- on an MVar during shutdown - in GHC 6.12.1 the program takes 25s in 5 | -- the EXIT phase deleting threads. 6 | 7 | import Control.Concurrent 8 | import Control.Concurrent.CML 9 | import Control.Monad 10 | 11 | main :: IO () 12 | main = do 13 | let numChoices = 2 14 | cs <- replicateM numChoices channel 15 | mapM_ forkIO [replicateM_ (100000 `div` numChoices) $ sync $ transmit c () | c <- cs] 16 | replicateM_ 100000 $ sync $ choose [receive c (const True) | c <- cs] 17 | -------------------------------------------------------------------------------- /nofib/real/rsa/Main.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | where 3 | 4 | import Rsa 5 | import Control.Monad 6 | import System.Environment 7 | import NofibUtils 8 | 9 | main = do 10 | input <- getContents 11 | replicateM_ 100 $ do 12 | input' <- salt input 13 | print (hash (encrypt 2036450659413645137870851576872812267542175329986469156678671505255564383842535488743101632280716717779536712424613501441720195827856504007305662157107 14 | 387784473137902876992546516170169092918207676456888779623592396031349415024943784869634893342729620092877891356118467738167515879252473323905128540213 15 | input')) 16 | -------------------------------------------------------------------------------- /nofib/spectral/para/c++/Para.h: -------------------------------------------------------------------------------- 1 | 2 | class Para 3 | { 4 | static int TW, W, TL, TotWidth, TotLen; 5 | 6 | int WidthTl, CostTl; 7 | 8 | int LengthTail; 9 | 10 | int OldWidthHd() const; 11 | 12 | public: 13 | 14 | static int OptW, MaxW; 15 | 16 | Para(); 17 | Para(const Para&,int); 18 | 19 | int SingleP() const; 20 | int LenTl() const; 21 | int WidthHd() const; 22 | int Cost() const; 23 | 24 | friend int bf(const Para&,const Para&); 25 | 26 | friend void SetW(int); 27 | friend void ISetW(int v); 28 | friend void SetTots(); 29 | friend void InitTots(); 30 | 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_lit_site_cfg( 2 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in 3 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py 4 | MAIN_CONFIG 5 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py 6 | ) 7 | 8 | set(TEST_DEPENDS FileCheck count not hask-opt) 9 | 10 | add_lit_testsuite(check-standalone-opt "Running the standalone-opt regression tests" 11 | ${CMAKE_CURRENT_BINARY_DIR} 12 | DEPENDS ${TEST_DEPENDS} 13 | ) 14 | set_target_properties(check-standalone-opt PROPERTIES FOLDER "Tests") 15 | 16 | add_lit_testsuites(STANDALONE_OPT ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TEST_DEPENDS}) 17 | -------------------------------------------------------------------------------- /ghc-benchmarks/matmul.hs: -------------------------------------------------------------------------------- 1 | import qualified Data.Vector.Unboxed as V 2 | import GHC.List as L 3 | 4 | 5 | -- a * x + b 6 | av, xv, bv :: V.Vector Int 7 | av = V.replicate 10 1-- fromList [1, 2, 3, 4, 5, 6, 7, 8, 9] 8 | xv = V.replicate 10 2 9 | bv = V.replicate 10 3 10 | 11 | outv :: V.Vector Int; 12 | outv = V.zipWith (+) (V.zipWith (*) av xv) bv 13 | 14 | main :: IO () 15 | mainv = print (V.sum outv) 16 | 17 | al, xl, bl :: [Int] 18 | al = L.replicate 10 1 19 | xl = L.replicate 10 2 20 | bl = L.replicate 10 2 21 | 22 | outl :: [Int] 23 | outl = zipWith (+) (zipWith (*) al xl) bl 24 | mainl = print $ Prelude.sum (outl) 25 | 26 | main = mainv >> mainl 27 | -------------------------------------------------------------------------------- /nofib/parallel/dcbm/Primitives.lhi: -------------------------------------------------------------------------------- 1 | --Hand-generated interface file for the Primitives module. 2 | -- 3 | --eq determines whether two values are identical (the *same pointer* 4 | --as in Lisp). It does no evaluation, and errs on the side of safety. 5 | -- 6 | --boolval determines whether a Boolean expression is True, False or not 7 | --yet evaluated, returning TRUE, FALSE or UNKNOWN, respectively. Again, 8 | --it does not evaluate its argument. 9 | -- 10 | _interface_ Primitives 1 11 | _exports_ 12 | Primitives eq(..) boolval(..); 13 | _declarations_ 14 | 1 eq _:_ _forall_ [a] => a -> a -> PrelBase.Bool ;; 15 | 1 boolval _:_ PrelBase.Bool -> Types.BOOL ;; 16 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/sebastian1.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | lid l = case l of Nil -> l; Cons x xs -> l end; 7 | {abstract identity on 4} 8 | 9 | foldr f a l 10 | = case l of 11 | Nil -> lid a; 12 | Cons x xs -> f x (foldr f a xs) 13 | end; 14 | { 15 | map f 16 | = foldr (\a b -> Cons (f a) b) Nil; 17 | 18 | 19 | sum 20 | = foldr (\x y -> x + y) 0; 21 | 22 | length xs 23 | = sum (map (\a -> 1) xs); 24 | 25 | lengthRec l 26 | = case l of 27 | Nil -> 0; 28 | Cons x xs -> 1 + lengthRec xs 29 | end; 30 | } 31 | 32 | { foldr (2,4): Anna307FT -- 7 approxes, 2062 evals } -------------------------------------------------------------------------------- /nofib/parallel/gray/Primitives.hs: -------------------------------------------------------------------------------- 1 | -- Copyright (c) 2000 Galois Connections, Inc. 2 | -- All rights reserved. This software is distributed as 3 | -- free software under the license in the file "LICENSE", 4 | -- which is included in the distribution. 5 | 6 | module Primitives where 7 | 8 | rad2deg :: Double -> Double 9 | rad2deg r = r * 180 / pi 10 | 11 | deg2rad :: Double -> Double 12 | deg2rad d = d * pi / 180 13 | 14 | addi :: Int -> Int -> Int 15 | addi = (+) 16 | 17 | addf :: Double -> Double -> Double 18 | addf = (+) 19 | 20 | acosD :: Double -> Double 21 | acosD x = acos x * 180 / pi 22 | 23 | asinD :: Double -> Double 24 | asinD x = asin x * 180 / pi 25 | -------------------------------------------------------------------------------- /nofib/parallel/transclos/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | SRC_HC_OPTS += -cpp -DSTRATEGIES -DTRANSCL_NESTED -package random -package parallel -package containers 5 | 6 | # XXX: only speeds up without optimisation. This is bad. Could be 7 | # due to the nfib delay mucking up load-balancing. 8 | SRC_HC_OPTS += -O0 9 | 10 | # 11 | # ver = 4 (always) 12 | # buffer = parBuffer size. 13 | # 10 is about optimal for 7.1, greater degrades perf (less so for local-gc) 14 | # dummy = 999 (always) 15 | # delay = larger for 16 | PROG_ARGS = 4 10 10 999 24 17 | 18 | include $(TOP)/mk/target.mk 19 | 20 | -------------------------------------------------------------------------------- /nofib/real/gamteb/inLML/gamteb.doc: -------------------------------------------------------------------------------- 1 | gamteb 2 | sources 3 | crpart 4 | tport 5 | dist_to_surf (Point -> Point -> (Float, Int)) 6 | dist_to_cyl (Point -> Point -> Float) 7 | dist_to_plane (Float -> Float -> Float -> Float) 8 | collision 9 | *roulet (Particle -> Float -> (Particle, Bool)) 10 | ?split (Particle -> (Particle, Particle)) 11 | photo_elect 12 | compton_or_pair 13 | *pair (Particle -> Float -> Table -> (Particle, Bool)) 14 | *isos (Random -> Point) 15 | ?compton (Particle -> (Particle, Bool) 16 | *klein (Energy -> Random -> Energy) 17 | *rotas (Point -> Angle -> Random -> Point) 18 | tport 19 | output 20 | -------------------------------------------------------------------------------- /nofib/real/infer/StateX.hs: -------------------------------------------------------------------------------- 1 | module StateX (StateX, returnSX, eachSX, thenSX, toSX, putSX, getSX, useSX) where 2 | 3 | data StateX s a = MkSX (s -> a) 4 | rep (MkSX f) = f 5 | returnSX returnX x = MkSX (\s -> returnX (x, s)) 6 | eachSX eachX xSX f = MkSX (\s -> rep xSX s `eachX` (\(x,s') -> (f x, s'))) 7 | thenSX thenX xSX kSX = MkSX (\s -> rep xSX s `thenX` (\(x,s') -> rep (kSX x) s')) 8 | toSX eachX xX = MkSX (\s -> xX `eachX` (\x -> (x,s))) 9 | putSX returnX s' = MkSX (\s -> returnX ((), s')) 10 | getSX returnX = MkSX (\s -> returnX (s,s)) 11 | useSX eachX s xSX = rep xSX s `eachX` (\(x,s') -> x) 12 | -------------------------------------------------------------------------------- /nofib/real/fem/inC/internalforce.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "database" 4 | 5 | extern float load_vec[]; 6 | extern float bar_2d_force(); 7 | extern float elforce(); 8 | extern FILE *fp; 9 | 10 | forces() { 11 | 12 | int element,nl,nr; 13 | 14 | printf("\n\n\nINTERNAL FORCES OF ELEMENT \n\n"); 15 | printf(" Element NodeL NodeR F \n"); 16 | 17 | for (element=1; element<=nelem; element=element+1) { 18 | 19 | nl = elem_info[element].nl; 20 | nr = elem_info[element].nr; 21 | printf("%8d%10d%8d% 15.6f\n",element,nl,nr,elforce(element)); 22 | fprintf(fp,"%16f\n",elforce(element)); 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /nofib/real/gg/report: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ADMIN=. 4 | 5 | cp $ADMIN/Report.tex $1.tex 6 | 7 | echo "\begin{verbatim}" > details.tex 8 | sed -e /Subject/,/Status/!d $1 | sed -e /Status/d | fold -80 >> details.tex 9 | grep "Date" $1 >> details.tex 10 | echo >> details.tex 11 | grep "IMU" $1 >> details.tex 12 | grep "RunTime" $1 >> details.tex 13 | echo "\end{verbatim}" >> details.tex 14 | 15 | gg -A $1 Activity.ps 16 | echo "Done Activity Graph" 17 | gg -S $1 Spark.ps 18 | echo "Done Spark Graph" 19 | gg -P $1 Pool.ps 20 | echo "Done Poll Graph" 21 | 22 | latex $1.tex 23 | dvips -f $1.dvi > $1.ps 24 | 25 | rm Activity.ps Spark.ps Pool.ps details.tex $1.tex $1.log $1.aux $1.dvi 26 | -------------------------------------------------------------------------------- /nofib/real/gg/example/report: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | ADMIN=. 4 | 5 | cp $ADMIN/Report.tex $1.tex 6 | 7 | echo "\begin{verbatim}" > details.tex 8 | sed -e /Subject/,/Status/!d $1 | sed -e /Status/d | fold -80 >> details.tex 9 | grep "Date" $1 >> details.tex 10 | echo >> details.tex 11 | grep "IMU" $1 >> details.tex 12 | grep "RunTime" $1 >> details.tex 13 | echo "\end{verbatim}" >> details.tex 14 | 15 | gg -A $1 Activity.ps 16 | echo "Done Activity Graph" 17 | gg -S $1 Spark.ps 18 | echo "Done Spark Graph" 19 | gg -P $1 Pool.ps 20 | echo "Done Poll Graph" 21 | 22 | latex $1.tex 23 | dvips -f $1.dvi > $1.ps 24 | 25 | rm Activity.ps Spark.ps Pool.ps details.tex $1.tex $1.log $1.aux $1.dvi 26 | -------------------------------------------------------------------------------- /nofib/real/reptile/Diff.hs: -------------------------------------------------------------------------------- 1 | -- LML original: Sandra Foubister, 1990 2 | -- Haskell translation: Colin Runciman, May 1991 3 | 4 | module Diff(diff, bcroot, square) where 5 | 6 | square :: Int -> Int 7 | square n = n*n 8 | 9 | diff :: Int -> Int -> Int 10 | diff a b = if a>b then a-b else b-a 11 | 12 | bcroot :: Int -> Int 13 | bcroot n = root' 0 n 14 | where root' a b = if a+1>=b then b 15 | else if s) { 6 | %1 = hask.make_i64(43 : i64) 7 | %2 = hask.caseint %1 [0 : i64 -> { 8 | ^bb0(%arg1: !hask.value): // no predecessors 9 | hask.return(%arg1) : !hask.value 10 | }] 11 | [@default -> { 12 | %4 = hask.make_i64(1 : i64) 13 | %5 = hask.primop_sub(%1,%4) 14 | hask.return(%5) : !hask.value 15 | }] 16 | 17 | %3 = hask.construct(@X, %2 : !hask.value) : !hask.adt<@X> 18 | hask.return(%3) : !hask.adt<@X> 19 | } 20 | hask.return(%0) : !hask.fn<(!hask.thunk) -> !hask.adt<@X>> 21 | } 22 | } -------------------------------------------------------------------------------- /nofib/real/pic/PicType.hs: -------------------------------------------------------------------------------- 1 | -- 2 | -- Patricia Fasel 3 | -- Los Alamos National Laboratory 4 | -- PIC: Particle in Cell 5 | -- 1990 August 6 | -- 7 | module PicType (Count, Indx, Value, Mesh, MeshAssoc, Electric, 8 | Phi, Rho, Position, Range, Velocity, ParticleHeap) where 9 | 10 | import Data.Array 11 | 12 | type Count = Int 13 | type Indx = Int 14 | type Value = Double 15 | type Mesh = Array (Int,Int) Value 16 | type MeshAssoc = ((Int,Int), Value) -- changed for 1.3 17 | type Electric = (Mesh, Mesh) 18 | type Phi = Mesh 19 | type Rho = Mesh 20 | type Position = (Value, Value) 21 | type Range = [Indx] 22 | type Velocity = (Value, Value) 23 | type ParticleHeap = ([Position], [Velocity]) 24 | -------------------------------------------------------------------------------- /nofib/smp/callback002/Main.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ForeignFunctionInterface #-} 2 | -- Measure raw callback performance. 3 | 4 | module Main where 5 | 6 | import Control.Concurrent 7 | import Control.Monad 8 | import Foreign 9 | import Foreign.C 10 | import Data.IORef 11 | import System.Environment 12 | import System.IO 13 | 14 | main = do 15 | [s] <- getArgs 16 | poke pcount (fromIntegral (read s)) 17 | callC =<< mkFunc (return ()) 18 | 19 | type FUNC = IO () 20 | 21 | foreign import ccall "&count" pcount :: Ptr CInt 22 | 23 | foreign import ccall unsafe "wrapper" 24 | mkFunc :: FUNC -> IO (FunPtr FUNC) 25 | 26 | foreign import ccall safe "cbits.h callC" 27 | callC:: FunPtr FUNC -> IO () 28 | 29 | -------------------------------------------------------------------------------- /nofib/spectral/mate/Makefile: -------------------------------------------------------------------------------- 1 | TOP = ../.. 2 | include $(TOP)/mk/boilerplate.mk 3 | 4 | # It's necessary to specify those manually so that the current make-based system 5 | # compiles them in the right order. 6 | # TODO(michalt): This should go away once we move to the Shake-based system. 7 | HS_SRCS = Board.hs Move.hs Problem.hs Solution.hs Main.hs 8 | 9 | # Other problems 10 | # ellerman.prob heathcote3.prob kidson.prob marin.prob \ 11 | # simple.prob fridlizius.prob holzhausen.prob \ 12 | # kohtz.prob shinkman.prob wurzburg.prob 13 | 14 | include $(TOP)/mk/target.mk 15 | 16 | FAST_OPTS = runtime_files/heathcote3.prob 17 | NORM_OPTS = runtime_files/kohtz.prob 18 | SLOW_OPTS = runtime_files/holzhausen.prob 19 | -------------------------------------------------------------------------------- /nofib/real/gamteb/inLML/floatop.m.97: -------------------------------------------------------------------------------- 1 | module 2 | 3 | infix ".+"; 4 | infix ".-"; 5 | infix ".*"; 6 | infix "./"; 7 | infix ".<"; 8 | infix ".>"; 9 | infix ".="; 10 | 11 | export .+, .-, .*, ./, .<, .>, .=, float, fabs; 12 | 13 | /* 14 | Note that all user defined operators have the same precedence 15 | so when using these floating point operators use () to indicate 16 | the desired precedence 17 | */ 18 | 19 | rec float x = itof x 20 | and fabs x = if x < float 0 21 | then float 0 .- x 22 | else x 23 | and x .< y = (x < y) 24 | and x .> y = (x > y) 25 | and x .= y = (x = y) 26 | and x .+ y = FloatAdd x y 27 | and x .- y = FloatSub x y 28 | and x .* y = FloatMul x y 29 | and x ./ y = FloatDiv x y 30 | end 31 | -------------------------------------------------------------------------------- /nofib/real/gg/Report.tex: -------------------------------------------------------------------------------- 1 | \documentstyle[epsf]{article} 2 | \textwidth 185mm 3 | \texheight 260mm 4 | \topmargin 5mm 5 | \oddsidemargin -10mm 6 | \setlength{\parindent}{0in} 7 | \setlength{\parskip}{1ex} 8 | \def \epsfcenter#1{\begin{center}\leavevmode\hbox{\epsffile{#1}}\\\end{center}} 9 | \begin{document} 10 | \title{GRIP Runtime Graphs} 11 | \author{Iain Checkland} 12 | 13 | \maketitle 14 | 15 | \section{Experiment details} 16 | 17 | \input{details.tex} 18 | 19 | \section{Results} 20 | 21 | \subsection{Activity Graph} 22 | 23 | \epsfcenter{Activity.ps} 24 | 25 | \subsection{Spark Graph} 26 | 27 | \epsfcenter{Spark.ps} 28 | 29 | \subsection{Spark Pool Profile} 30 | 31 | \epsfcenter{Pool.ps} 32 | 33 | \end{document} 34 | -------------------------------------------------------------------------------- /nofib/parallel/dcbm/DbParallel.hs: -------------------------------------------------------------------------------- 1 | module DbParallel (module DbParallel, par, seq) where 2 | import Types 3 | 4 | import Parallel 5 | 6 | infixr `seqt`, `seqi`, `seql`, `seqm`, `seqd` 7 | #ifndef PAR 8 | infixr `seqe` 9 | (Tip _) `seqt` y = y 10 | _ `seqt` y = y 11 | 12 | (Branch _ _ _) `seqe` y = y 13 | _ `seqe` y = y 14 | 15 | (Root _ _ _ _) `seqd` y = y 16 | _ `seqd` y = y 17 | 18 | (Ok _) `seqm` y = y 19 | _ `seqm` y = y 20 | 21 | 0 `seqi` y = y 22 | _ `seqi` y = y 23 | 24 | [] `seql` e = e 25 | (x:xs) `seql` e = xs `seql` e 26 | 27 | #else 28 | x `seqd` y = x `seq` y 29 | x `seqm` y = x `seq` y 30 | x `seqt` y = x `seq` y 31 | x `seqi` y = x `seq` y 32 | x `seql` y = x `seq` y 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /nofib/real/gg/example/Report.tex: -------------------------------------------------------------------------------- 1 | \documentstyle[epsf]{article} 2 | \textwidth 185mm 3 | \texheight 260mm 4 | \topmargin 5mm 5 | \oddsidemargin -10mm 6 | \setlength{\parindent}{0in} 7 | \setlength{\parskip}{1ex} 8 | \def \epsfcenter#1{\begin{center}\leavevmode\hbox{\epsffile{#1}}\\\end{center}} 9 | \begin{document} 10 | \title{GRIP Runtime Graphs} 11 | \author{Iain Checkland} 12 | 13 | \maketitle 14 | 15 | \section{Experiment details} 16 | 17 | \input{details.tex} 18 | 19 | \section{Results} 20 | 21 | \subsection{Activity Graph} 22 | 23 | \epsfcenter{Activity.ps} 24 | 25 | \subsection{Spark Graph} 26 | 27 | \epsfcenter{Spark.ps} 28 | 29 | \subsection{Spark Pool Profile} 30 | 31 | \epsfcenter{Pool.ps} 32 | 33 | \end{document} 34 | -------------------------------------------------------------------------------- /core2MLIR/test-programs/dataconstructors.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | {-# LANGUAGE UnboxedTuples #-} 3 | module NonrecSum where 4 | import GHC.Prim 5 | data ConcreteProd = MkConcreteProd Int# Int# 6 | data ConcreteSum = ConcreteLeft Int# | ConcreteRight Int# 7 | data ConcreteRec = MkConcreteRec Int# ConcreteRec 8 | data ConcreteRecSum = ConcreteRecSumCons Int# ConcreteRecSum | ConcreteRecSumNone 9 | 10 | data AbstractProd a b = MkAbstractProd a b 11 | 12 | f :: ConcreteSum -> ConcreteSum 13 | f x = case x of 14 | ConcreteLeft i -> ConcreteRight i 15 | ConcreteRight i -> ConcreteLeft i 16 | 17 | sslone :: ConcreteSum; sslone = ConcreteLeft 1# 18 | 19 | 20 | main :: IO (); 21 | main = let y = f sslone in return () 22 | -------------------------------------------------------------------------------- /nofib/real/anna/anna.faststdin: -------------------------------------------------------------------------------- 1 | 2 | day ::= Monday | 3 | Tuesday | 4 | Wednesday | 5 | Thursday | 6 | Friday | 7 | Saturday | 8 | Sunday ; 9 | 10 | domain ::= Unit | 11 | Lift (domain); 12 | 13 | pair a b ::= Pair a b; 14 | 15 | list a ::= Nil | Cons a (list a); 16 | 17 | tree a ::= Leaf | Branch (tree a) a (tree a); 18 | 19 | assoc a b ::= NilAssoc | 20 | Assoc a b (assoc a b) ; 21 | 22 | ;; 23 | 24 | z4 l1 l2 25 | = case l1 of 26 | Nil -> Nil; 27 | Cons x xs -> case l2 of 28 | Nil -> Nil; 29 | Cons y ys -> Cons (x+y) (z4 xs ys) 30 | end 31 | end; 32 | -------------------------------------------------------------------------------- /nofib/gc/happy/Paths_happy.hs: -------------------------------------------------------------------------------- 1 | module Paths_happy ( 2 | version, 3 | getBinDir, getLibDir, getDataDir, getLibexecDir, 4 | getDataFileName 5 | ) where 6 | 7 | import Data.Version 8 | 9 | version = Version {versionBranch = [1,16], versionTags = []} 10 | 11 | bindir = "/usr/local/bin" 12 | libdir = "/usr/local/lib/happy-1.16/ghc-6.6" 13 | datadir = "/usr/local/share/happy-1.16" 14 | libexecdir = "/usr/local/libexec" 15 | 16 | getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath 17 | getBinDir = return bindir 18 | getLibDir = return libdir 19 | getDataDir = return datadir 20 | getLibexecDir = return libexecdir 21 | 22 | getDataFileName :: FilePath -> IO FilePath 23 | getDataFileName name = return (datadir ++ "/" ++ name) 24 | -------------------------------------------------------------------------------- /nofib/parallel/cfd/Norm.hs: -------------------------------------------------------------------------------- 1 | module Norm where 2 | 3 | class Normal a 4 | where 5 | normal :: a -> Bool 6 | 7 | instance (Normal a) => Normal [a] where 8 | normal x | and (map normal x) = True 9 | 10 | instance (Normal a, Normal b) => Normal (a,b) where 11 | normal (x,y) | normal x && normal y = True 12 | 13 | instance (Normal a, Normal b, Normal c) => Normal (a,b,c) where 14 | normal (x,y,z) | normal x && normal y && normal z = True 15 | 16 | instance Normal Bool where 17 | normal True = True 18 | normal _ = True 19 | 20 | instance Normal Int where 21 | normal 0 = True 22 | normal _ = True 23 | 24 | instance Normal Float where 25 | normal 0 = True 26 | normal _ = True 27 | 28 | instance Normal ( a -> b ) where 29 | normal _ = True 30 | -------------------------------------------------------------------------------- /nofib/smp/threads001/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- Test thread creation. 4 | -- (from: Einar Wolfgang Karlsen ) 5 | 6 | -- This test is essentially single-threaded, there is no parallelism 7 | -- available. It just tests how quickly we can create a new thread 8 | -- and context switch to it, many times. 9 | 10 | import Control.Concurrent 11 | import System.Environment 12 | 13 | main :: IO () 14 | main = do 15 | [n] <- getArgs 16 | 17 | mvar <- newEmptyMVar 18 | 19 | let 20 | spawner :: (IO () -> IO ThreadId) -> Int -> IO () 21 | spawner c 0 = putMVar mvar () 22 | spawner c n = do { c (spawner c (n-1)); return ()} 23 | 24 | spawner forkIO (read n :: Int) 25 | takeMVar mvar 26 | putStr "done" 27 | -------------------------------------------------------------------------------- /nofib/parallel/minimax/Wins.hs: -------------------------------------------------------------------------------- 1 | module Wins where 2 | 3 | type Win = [[Int]] 4 | 5 | wins :: [Win] 6 | wins = [win1,win2,win3,win4,win5,win6,win7,win8] 7 | 8 | win1,win2,win3,win4,win5,win6,win7,win8 :: Win 9 | win1 = [[1,1,1], 10 | [0,0,0], 11 | [0,0,0]] 12 | 13 | win2 = [[0,0,0], 14 | [1,1,1], 15 | [0,0,0]] 16 | 17 | win3 = [[0,0,0], 18 | [0,0,0], 19 | [1,1,1]] 20 | 21 | win4 = [[1,0,0], 22 | [1,0,0], 23 | [1,0,0]] 24 | 25 | win5 = [[0,1,0], 26 | [0,1,0], 27 | [0,1,0]] 28 | 29 | win6 = [[0,0,1], 30 | [0,0,1], 31 | [0,0,1]] 32 | 33 | win7 = [[1,0,0], 34 | [0,1,0], 35 | [0,0,1]] 36 | 37 | win8 = [[0,0,1], 38 | [0,1,0], 39 | [1,0,0]] 40 | -------------------------------------------------------------------------------- /nofib/spectral/minimax/Wins.hs: -------------------------------------------------------------------------------- 1 | module Wins where 2 | 3 | type Win = [[Int]] 4 | 5 | wins :: [Win] 6 | wins = [win1,win2,win3,win4,win5,win6,win7,win8] 7 | 8 | win1,win2,win3,win4,win5,win6,win7,win8 :: Win 9 | win1 = [[1,1,1], 10 | [0,0,0], 11 | [0,0,0]] 12 | 13 | win2 = [[0,0,0], 14 | [1,1,1], 15 | [0,0,0]] 16 | 17 | win3 = [[0,0,0], 18 | [0,0,0], 19 | [1,1,1]] 20 | 21 | win4 = [[1,0,0], 22 | [1,0,0], 23 | [1,0,0]] 24 | 25 | win5 = [[0,1,0], 26 | [0,1,0], 27 | [0,1,0]] 28 | 29 | win6 = [[0,0,1], 30 | [0,0,1], 31 | [0,0,1]] 32 | 33 | win7 = [[1,0,0], 34 | [0,1,0], 35 | [0,0,1]] 36 | 37 | win8 = [[0,0,1], 38 | [0,1,0], 39 | [1,0,0]] 40 | -------------------------------------------------------------------------------- /nofib/gc/linear/Utils.lhs: -------------------------------------------------------------------------------- 1 | 2 | \section{Utils} 3 | 4 | Here are some general functions not 5 | specific to any one module. 6 | 7 | \begin{code} 8 | module Utils where 9 | 10 | --import LMLTrace 11 | {- 12 | traceIndex :: String -> [a] -> Int -> a 13 | traceIndex name lst i = trace name (lst!!i) 14 | -} 15 | 16 | map2 :: (a -> b -> c) -> [a] -> [b] -> [c] 17 | map2 f x y = [f a b | (a,b) <- zip x y] 18 | 19 | rep :: Int -> a -> [a] 20 | rep n x = take n (repeat x) 21 | 22 | rjustify :: Int -> [Char] -> [Char] 23 | rjustify n s = spaces(n - (length s)) ++ s 24 | 25 | spaces :: Int -> [Char] 26 | spaces n = rep n ' ' 27 | 28 | zip2 :: [a] -> [b] -> [(a,b)] 29 | zip2 x [] = [] 30 | zip2 [] y = [] 31 | zip2 (a:x) (b:y) = (a,b):zip2 x y 32 | \end{code} 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /nofib/real/infer/infer.stdin: -------------------------------------------------------------------------------- 1 | (\x.x) 2 | \x.\y.x 3 | (x 4 | x 5 | (\f.\g.\x.(g(f(x)))) 6 | (\x. x x) 7 | (\x.x) (\x.x) 8 | (\id. id id) (\x.x) 9 | let id = \x.x in id id 10 | \x. let f = x in f f 11 | fix (\x.x) 12 | fix unit 13 | \x. unit (unit x) 14 | fix (\x. append (unit x)) 15 | \x. fix (\xs. append (unit x) xs) 16 | let id = \x.x in id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id 17 | -------------------------------------------------------------------------------- /nofib/spectral/fft2/Complex_Vectors.lhs: -------------------------------------------------------------------------------- 1 | > module Complex_Vectors 2 | > (ComplexF, rootsOfUnity,thetas, norm,distance) 3 | > where 4 | > import Data.Complex 5 | 6 | > type ComplexF = Complex Double 7 | 8 | > rootsOfUnity:: Int -> [ComplexF] 9 | > rootsOfUnity n = zipWith (:+) (map cos (thetas n)) 10 | > (map sin (thetas n)) 11 | 12 | > thetas:: Int -> [Double] 13 | > thetas n = [(2*pi/fromInt n)*fromInt k | k<-[0 .. n-1]] 14 | > -- partain addition: 15 | > where 16 | > fromInt :: (Num a) => Int -> a 17 | > fromInt i = fromInteger (toInteger i) 18 | 19 | > norm:: [ComplexF] -> Double 20 | > norm = sqrt.sum.map((^2).magnitude) 21 | 22 | > distance:: [ComplexF] -> [ComplexF] -> Double 23 | > distance z w = norm(zipWith (-) z w) 24 | -------------------------------------------------------------------------------- /nofib/spectral/sorting/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Sort 4 | 5 | import Control.Monad (replicateM_) 6 | import Data.List (intersperse) 7 | import System.Environment (getArgs) 8 | import NofibUtils (hash) 9 | 10 | main = do 11 | (n:_) <- getArgs 12 | replicateM_ (read n) $ do 13 | (_:s:_) <- getArgs 14 | f <- readFile s 15 | print (hash (mangle f)) 16 | 17 | mangle :: String{-input to sort-} -> String{-output-} 18 | mangle inpt 19 | = (unlines . sort . lines) inpt 20 | where 21 | sort = foldr (.) id (intersperse reverse sorts) 22 | sorts = 23 | [ heapSort 24 | , insertSort 25 | , mergeSort 26 | , quickSort 27 | , quickSort2 28 | , quickerSort 29 | , treeSort 30 | , treeSort2 31 | ] 32 | -------------------------------------------------------------------------------- /nofib/real/fluid/res8: -------------------------------------------------------------------------------- 1 | at time step 1: 2 | 3 | presure: 4 | array (1,9) [1 := 254.276,2 := 146.86,3 := 29.372,4 := 5.33779e-19,5 := 147.868,6 := 256.627,7 := 245.063,8 := 151.086,9 := 30.1388] 5 | velocities: 6 | (array (1,25) [1 := 0,2 := 0,3 := 0,4 := 8.45813e-05,5 := 0.0418557,6 := 1,7 := 0,8 := 0,9 := 0,10 := 0,11 := 0,12 := -0.000143316,13 := 0.752089,14 := 0.6559,15 := 0.640072,16 := 0.75,17 := 0.611032,18 := 0.792151,19 := -0.000336421,20 := 0.770331,21 := 0.589796,22 := 0.602087,23 := 0.75,24 := 0,25 := 0],array (1,25) [1 := 0,2 := 0,3 := 0,4 := 0,5 := 0.00899746,6 := 0,7 := 0,8 := 0,9 := 0,10 := 0,11 := 0,12 := 0,13 := 0.208595,14 := -0.0104158,15 := -0.0187283,16 := 0,17 := -0.0368251,18 := -0.206523,19 := 0,20 := -0.205566,21 := -0.027556,22 := 0.0625434,23 := 0,24 := 0,25 := 0]) 7 | -------------------------------------------------------------------------------- /nofib/real/linear/Utils.lhs: -------------------------------------------------------------------------------- 1 | 2 | \section{Utils} 3 | 4 | Here are some general functions not 5 | specific to any one module. 6 | 7 | \begin{code} 8 | module Utils where 9 | 10 | --import LMLTrace 11 | {- 12 | traceIndex :: String -> [a] -> Int -> a 13 | traceIndex name lst i = trace name (lst!!i) 14 | -} 15 | 16 | map2 :: (a -> b -> c) -> [a] -> [b] -> [c] 17 | map2 f x y = [f a b | (a,b) <- zip x y] 18 | 19 | rep :: Int -> a -> [a] 20 | rep n x = take n (repeat x) 21 | 22 | rjustify :: Int -> [Char] -> [Char] 23 | rjustify n s = spaces(n - (length s)) ++ s 24 | 25 | spaces :: Int -> [Char] 26 | spaces n = rep n ' ' 27 | 28 | zip2 :: [a] -> [b] -> [(a,b)] 29 | zip2 x [] = [] 30 | zip2 [] y = [] 31 | zip2 (a:x) (b:y) = (a,b):zip2 x y 32 | \end{code} 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /nofib/real/symalg/Env.hs: -------------------------------------------------------------------------------- 1 | module Env (Env, initEnv, lookupEnv, enterEnv) where 2 | 3 | import Ast 4 | import BasicNumber 5 | 6 | -- environment is a list of variable bindings. 7 | type Env = [(String, BasicExp)] 8 | 9 | -- initial environment 10 | initEnv :: Env -> Env 11 | initEnv _ = [("$prec", (Numb 20))] 12 | 13 | -- environment lookup 14 | lookupEnv :: String -> Env -> BasicExp 15 | lookupEnv str [] = BSError 16 | lookupEnv str ((s,bexp):es) = if s==str then bexp 17 | else lookupEnv str es 18 | 19 | -- enter a new element to the environment, remove the duplicate if exists. 20 | enterEnv :: String -> BasicExp -> Env -> Env 21 | enterEnv str bexp env = (str, bexp):env1 22 | where 23 | env1 = filter (\c@(s,e) -> s/=str) env 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/sebastian2.cor: -------------------------------------------------------------------------------- 1 | 2 | list a ::= Nil | Cons a (list a); 3 | 4 | ;; 5 | 6 | lid l = case l of Nil -> l; Cons x xs -> l end; 7 | {abstract identity on 4} 8 | 9 | 10 | foldr f asl b 11 | = case asl of 12 | Nil -> lid b; 13 | Cons a as -> d_68_LL f b a as 14 | end; 15 | 16 | d_68_LL f b x y 17 | = f x (foldr f y b); 18 | 19 | { 20 | foldr f a l 21 | = case l of 22 | Nil -> lid a; 23 | Cons x xs -> f x (foldr f a xs) 24 | end; 25 | 26 | map f 27 | = foldr (\a b -> Cons (f a) b) Nil; 28 | 29 | 30 | sum 31 | = foldr (\x y -> x + y) 0; 32 | 33 | length xs 34 | = sum (map (\a -> 1) xs); 35 | 36 | lengthRec l 37 | = case l of 38 | Nil -> 0; 39 | Cons x xs -> 1 + lengthRec xs 40 | end; 41 | } -------------------------------------------------------------------------------- /nofib/real/reptile/Main.hs: -------------------------------------------------------------------------------- 1 | -- LML original: Sandra Foubister, 1990 2 | -- Haskell translation: Colin Runciman, May 1991 3 | 4 | module Main(main) where 5 | 6 | import Mgrfuns 7 | import Progfuns 8 | import Auxprogfuns 9 | import Layout 10 | import Tilefuns 11 | 12 | import Control.Monad 13 | import System.Environment 14 | import NofibUtils 15 | 16 | main = do 17 | input <- getContents 18 | replicateM_ 500 $ do 19 | fromMgr <- salt input 20 | let 21 | toMgr = setmode 7 ++ 22 | shapewindow [0,0,1150,900] ++ 23 | setup ++ 24 | potatotile ([],1,initalist) (lines fromMgr) ++ 25 | shapewindow [0,0,500,500] ++ 26 | font 8 ++ 27 | textreset ++ 28 | clear ++ 29 | func 15 30 | print (hash toMgr) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /nofib/mk/suffix.mk: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # 3 | # nofib/mk/suffix.mk 4 | # 5 | # Extra suffix rules for nofib project 6 | # 7 | ################################################################################# 8 | 9 | # We override the compile suffix rules so that 10 | # we can gather time and size information 11 | 12 | define COMPILE 13 | @echo ==nofib$(_way)== $(NOFIB_PROG): time to compile $* follows... 14 | @echo $(HC) $(HC_OPTS) -c $< -o $@ 15 | @$(TIME) $(HC) $(HC_OPTS) -c $< -o $@ 16 | @if (test -f $@); then \ 17 | echo ==nofib$(_way)== $(NOFIB_PROG): size of $@ follows... ; \ 18 | $(SIZE) $@ ; \ 19 | fi; 20 | endef 21 | 22 | %.$(way_)o : %.hs 23 | $(COMPILE) 24 | 25 | %.$(way_)o : %.lhs 26 | $(COMPILE) 27 | -------------------------------------------------------------------------------- /nofib/spectral/dom-lt/Main.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-full-laziness #-} 2 | 3 | module Main where 4 | 5 | import System.Environment 6 | import Data.Bifunctor 7 | 8 | import Dom 9 | import Control.Monad 10 | import Data.Traversable 11 | 12 | -- Take a filename as input. 13 | -- Each line is expected to be a graph of the form (root, [(vertex, [successors])]) 14 | -- Compute the dominators for each line. 15 | main :: IO () 16 | main = do 17 | [inputFile,repetitions] <- getArgs 18 | let repetitions' = read repetitions 19 | 20 | sgraphs <- map (second fromAdj . read) . lines <$> readFile inputFile :: IO [Rooted] 21 | let s = flip map [0..repetitions'] $ (\i -> sum (map (\g -> i + doGraph g) sgraphs)) :: [Int] 22 | print $ sum s 23 | 24 | doGraph :: Rooted -> Int 25 | doGraph g = length . idom $ g -------------------------------------------------------------------------------- /nofib/real/compress/Uncompress.hs: -------------------------------------------------------------------------------- 1 | {- 2 | - Uncompress.hs 3 | - 4 | - This program is a version of the compress utility as defined in 5 | - "A Technique for High Performance Data Compression", Terry A. Welch, 6 | - Computer, vol 17, no 6 1984, pp 8-19 7 | - 8 | - 9 | - Paul Sanders, Systems Research Division, British Telecom Laboratories 1992 10 | - 11 | -} 12 | 13 | module Uncompress (main) where 14 | 15 | import Defaults 16 | import BinConv -- binary conversion routines 17 | import Decode -- decoding routines 18 | 19 | main = getContents >>= \ inp -> 20 | putStr (uncompress inp) 21 | 22 | {- To uncompress a string we first convert the characters to n-bit binaries 23 | - and then to decimals which can then be decoded. 24 | -} 25 | 26 | uncompress = decode . ascii_to_codes . map fromEnum 27 | -------------------------------------------------------------------------------- /nofib/real/fem/inC/assemble_loadvec.c: -------------------------------------------------------------------------------- 1 | /* assemble global load vector */ 2 | 3 | #include "database" 4 | 5 | extern float load_vec[]; 6 | 7 | assemble_loadvec() { 8 | 9 | int i, dgr, to_point; 10 | float px,py,m; 11 | 12 | for (i=1; i<= ndgrs; i=i+1) load_vec[i] = 0.0; 13 | 14 | for (i=1; i<= nplds; i=i+1) { 15 | 16 | to_point = load_info[i].to_point; 17 | px = load_info[i].px; 18 | py = load_info[i].py; 19 | m = load_info[i].m; 20 | 21 | dgr = node_info[to_point].u; 22 | if (dgr!=0) load_vec[dgr] = load_vec[dgr] + px; 23 | 24 | dgr = node_info[to_point].v; 25 | if (dgr!=0) load_vec[dgr] = load_vec[dgr] + py; 26 | 27 | dgr = node_info[to_point].theta; 28 | if (dgr!=0) load_vec[dgr] = load_vec[dgr] + m; 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /nofib/real/veritas/Globals.hs: -------------------------------------------------------------------------------- 1 | module Globals where 2 | 3 | import Tags 4 | 5 | import Core_datatype 6 | 7 | import Type_defs 8 | 9 | type Global_state = ( Int , [Attribute] , Tag_table ) 10 | 11 | initial_gst :: Global_state 12 | 13 | initial_gst = ( -1 , [] , default_tag_tbl ) 14 | 15 | set_print_depth pd ( _ , attL , tags ) = ( pd , attL , tags ) 16 | 17 | set_attributes attL ( pd , _ , tags ) = ( pd , attL , tags ) 18 | 19 | set_tag_table tags ( pd , attL , _ ) = ( pd , attL , tags ) 20 | 21 | get_print_depth ( pd , _ , _ ) = pd 22 | 23 | get_attributes ( _ , attL , _ ) = attL 24 | 25 | get_tag_table ( _ , _ , tags ) = tags 26 | 27 | --different :: Global_state -> Global_state -> Bool 28 | 29 | --different gst1 gst2 = gst1 /= gst2 30 | 31 | fetch_ps ( _ , _ , tgL ) = tgL 32 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/coreExpr0.cor: -------------------------------------------------------------------------------- 1 | 2 | pair alpha beta ::= Pair alpha beta ; 3 | 4 | list item ::= Nil | Cons item (list item) ; 5 | 6 | annExprM bindAnn nodeAnn 7 | 8 | ::= AVar name | 9 | 10 | ANum num | 11 | AConstr name | 12 | 13 | AAp (pair nodeAnn (annExprM bindAnn nodeAnn)) 14 | (pair nodeAnn (annExprM bindAnn nodeAnn)) | 15 | 16 | ALet bool (list (pair bindAnn (pair nodeAnn (annExprM bindAnn nodeAnn)))) 17 | (pair nodeAnn (annExprM bindAnn nodeAnn)) | 18 | 19 | ACase (pair nodeAnn (annExprM bindAnn nodeAnn)) 20 | (list (pair name (pair (list bindAnn) 21 | (pair nodeAnn (annExprM bindAnn nodeAnn))))) | 22 | 23 | ALam (list bindAnn) (pair nodeAnn (annExprM bindAnn nodeAnn)) ; 24 | 25 | ;; 26 | 27 | main = 42 28 | 29 | 30 | -------------------------------------------------------------------------------- /nofib/real/anna/cor_files/bug.cor: -------------------------------------------------------------------------------- 1 | list a ::= Nil | Cons a (list a); 2 | tree a ::= Leaf | Branch (tree a) a (tree a); 3 | ;; 4 | 5 | insert x t = case t of 6 | Leaf -> Branch Leaf x Leaf; 7 | Branch l x1 r -> 8 | case x==x1 of 9 | True -> Branch l x1 r; 10 | False -> case x Branch (insert x l) x1 r; 12 | False -> Branch l x1 (insert x r) 13 | end 14 | end 15 | end; 16 | 17 | listToTree l = 18 | letrec ltt = \tr li -> case li of 19 | Nil -> tr; 20 | Cons x xs -> ltt (insert x tr) xs 21 | end 22 | in ltt Leaf l; 23 | -------------------------------------------------------------------------------- /core2MLIR/matmul-mlir.hs: -------------------------------------------------------------------------------- 1 | -- matmul that uses custom MLIR instructions to lower efficiently 2 | -- import qualified Data.Vector.Unboxed as V 3 | 4 | -- Fast 5 | data Vector = Vector [Int] | VAdd Vector Vector | VMul Vector Vector | VSum Vector deriving(Show) 6 | a, x, b :: Vector 7 | 8 | a = Vector [1, 2, 3, 4, 5, 6, 7, 8, 9] 9 | x = Vector [3, 1, 4, 1, 5, 1, 6, 1, 7] 10 | b = Vector [10, 20, 30, 40, 50, 60, 70] 11 | 12 | outv = VAdd (VMul a x) b 13 | outf = VSum outv 14 | 15 | -- Slow 16 | {- 17 | -- a * x + b 18 | a, x, b :: Vector Int 19 | a = fromList [1, 2, 3, 4, 5, 6, 7, 8, 9] 20 | x = fromList [3, 1, 4, 1, 5, 1, 6, 1, 7] 21 | b = fromList [10, 20, 30, 40, 50, 60, 70] 22 | 23 | outv = V.zipWith (+) (V.zipWith (*) a x) b 24 | outf = V.foldl (+) 0 outv 25 | 26 | main :: IO () 27 | main = print outv >> print outf 28 | -} 29 | -------------------------------------------------------------------------------- /nofib/smp/chan/chan.hs: -------------------------------------------------------------------------------- 1 | -- benchmarks communication on Chan 2 | -- 3 | -- This is a synthetic benchmark that is sensitive to scheduler 4 | -- behaviour. In GHC 6.12 and earlier we triggered a context switch 5 | -- shortly after waking up a thread, whereas in 6.14 and later we 6 | -- stopped doing that. This benchmark performs worse with 6.14 7 | -- becauuse not doing the context switch allows a lot of data to build 8 | -- up in the Chan, making GC expensive. 9 | 10 | import Control.Concurrent 11 | import Control.Concurrent.Chan 12 | import System.Environment 13 | import Control.Monad 14 | 15 | main = do 16 | [n] <- fmap (fmap read) getArgs 17 | c <- newChan 18 | m <- newEmptyMVar 19 | a <- forkIO $ forM_ [1..n] $ \i -> writeChan c i 20 | b <- forkIO $ do forM_ [1..n] $ \i -> readChan c; putMVar m () 21 | takeMVar m 22 | 23 | -------------------------------------------------------------------------------- /test/makefile: -------------------------------------------------------------------------------- 1 | # Yes I hate myself, but this is far too convenient to be able to write 2 | # pipelines which involve tee and allow such pipelines to fail. 3 | targets = fib add case-int fib-strict k-lazy either playground test-ops case-usage rec generic-op-printing 4 | 5 | all: $(targets) 6 | 7 | $(targets): %: %.mlir 8 | make -C ~/work/mlir/coremlir/build 9 | ../build/bin/hask-opt $< 10 | ../build/bin/hask-opt ./$< > $@-roundtrip.mlir 11 | # ../build/bin/hask-opt ./$@-roundtrip.mlir 12 | # ../build/bin/hask-opt ./$@-roundtrip.mlir -lower-std 13 | # ../build/bin/hask-opt ./$@-roundtrip.mlir -lower-std -lower-llvm 14 | # ../build/bin/hask-opt ./$@-roundtrip.mlir -lower-std -lower-llvm -jit 15 | 16 | 17 | 18 | 19 | # GDB execution 20 | # make -C ../build && gdb -ex run --args ../build/bin/hask-opt fib.mlir > fib-roundtrip.mlir 21 | --------------------------------------------------------------------------------