chore(lesson4): Add writeup #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_INCREMENTAL: 1 | |
jobs: | |
lesson2: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Clone Bril | |
run: rm -rf bril && git clone https://github.com/sampsyo/bril && cd bril && git reset --hard 94764e92585c7133d08ac14cf3c563d1d272434a | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: pip | |
cache-dependency-path: /bril/bril-txt/pyproject.toml | |
- name: Install Flit | |
run: pip install flit | |
- name: Install Python tools | |
run: cd bril/bril-txt ; flit install --symlink | |
- name: Install Turnt | |
# run: pip install turnt # Use instead if pip turnt version >= 1.7 | |
uses: actions/checkout@v4 | |
with: | |
repository: cucapra/turnt | |
path: './turnt' | |
- name: Install Turnt part 2 | |
run: cd turnt ; flit install --symlink | |
- name: Test build-cfg | |
run: make build_cfg \ | |
ROOT="/home/runner/work/cs6120/cs6120" \ | |
BRIL="bril" | |
lesson3: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Clone Bril | |
run: rm -rf bril && git clone https://github.com/sampsyo/bril | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Install brili | |
run: cd bril && deno install --global brili.ts | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: pip | |
cache-dependency-path: bril/bril-txt/pyproject.toml | |
- name: Install Flit | |
run: pip install flit | |
- name: bril-txt | |
run: cd bril/bril-txt ; flit install --symlink | |
- name: brench | |
run: cd bril/brench ; flit install --symlink | |
- name: Test trivial DCE and LVN | |
run: | | |
cd lesson3 | |
cargo build --package tdce | |
cargo build --package lvn | |
bril2json <../bril/examples/test/tdce/combo.bril | brili -p | |
bril2json <../bril/examples/test/tdce/combo.bril | ../target/debug/tdce | bril2json | brili -p | |
cat ../bril/examples/test/tdce/combo.bril | tail -n +2 > ../bril/examples/test/tdce/combo.bril.temp | |
cat ../bril/examples/test/tdce/combo.bril.temp > ../bril/examples/test/tdce/combo.bril | |
cat ../bril/examples/test/tdce/double-pass.bril | tail -n +2 > ../bril/examples/test/tdce/double-pass.bril.temp | |
cat ../bril/examples/test/tdce/double-pass.bril.temp > ../bril/examples/test/tdce/double-pass.bril | |
cat ../bril/examples/test/tdce/reassign-dkp.bril | tail -n +2 > ../bril/examples/test/tdce/reassign-dkp.bril.temp | |
cat ../bril/examples/test/tdce/reassign-dkp.bril.temp > ../bril/examples/test/tdce/reassign-dkp.bril | |
brench brench.toml ../bril/benchmarks/**/*.bril ../bril/examples/test/tdce/*.bril | grep connected-components --invert-match | python3 check_brench.py | |
lesson4: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Clone Bril | |
run: rm -rf bril && git clone https://github.com/sampsyo/bril && cd bril && git reset --hard 94764e92585c7133d08ac14cf3c563d1d272434a | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: pip | |
cache-dependency-path: /bril/bril-txt/pyproject.toml | |
- name: Install Flit | |
run: pip install flit | |
- name: Install Python tools | |
run: cd bril/bril-txt ; flit install --symlink | |
- name: Install Turnt | |
# run: pip install turnt # Use instead if pip turnt version >= 1.7 | |
uses: actions/checkout@v4 | |
with: | |
repository: cucapra/turnt | |
path: './turnt' | |
- name: Install Turnt part 2 | |
run: cd turnt ; flit install --symlink | |
- name: Test reaching definitions analysis | |
run: | | |
cd lesson4/dataflow | |
python3 check.py def ../../bril/benchmarks/**/*.bril ../../bril/examples/test/df/*.bril | |
- name: Test live variables analysis | |
run: | | |
cd lesson4/dataflow | |
python3 match_outputs.py \ | |
"python3 ../../bril/examples/df.py live | grep ' in:'" \ | |
"cargo run --package dataflow --quiet -- --analysis live | grep in:" \ | |
../../bril/benchmarks/core/*.bril ../../bril/examples/test/df/*.bril \ | |
--exclude is-decreasing.bril --exclude recfact.bril --exclude relative-primes.bril # differ on definition of basic block | |
- name: Snapshot test analyses on examples/test/df/ programs | |
run: | | |
cd lesson4/dataflow | |
cd turnt && turnt df_copied_from_bril/*.bril |