Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rewrite constant_fold_pass using dataflow framework #1603

Open
wants to merge 73 commits into
base: acl/const_fold2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
9e47b7f
Revert "(TEMP) Rm total_context"
acl-cqc Oct 8, 2024
668c030
Revert "(TEMP) remove const_fold2 module"
acl-cqc Oct 8, 2024
ea10ed3
Merge branch 'acl/const_fold2' (early part) into acl/const_fold3
acl-cqc Oct 14, 2024
949ef70
Update const_fold2/value_handle.rs, dataflow/total_context.rs
acl-cqc Oct 14, 2024
1d714c8
Merge branch 'acl/const_fold2' (early part) into acl/const_fold3
acl-cqc Oct 14, 2024
1f41056
Odd updates to total_context.rs - REVERT ??
acl-cqc Oct 14, 2024
0b71236
Merge branch 'acl/const_fold2' into acl/const_fold3
acl-cqc Oct 21, 2024
502d4a2
Fix/make-compile total_context.rs
acl-cqc Oct 21, 2024
25c4a82
total_context: return PartialValue, as need some repr of Sum
acl-cqc Oct 21, 2024
e7f6ad1
const_fold2: disable missing-docs warning
acl-cqc Oct 21, 2024
8a8db96
fix context, value_handle
acl-cqc Oct 21, 2024
1810198
Merge branch 'acl/const_fold2' into acl/const_fold3
acl-cqc Oct 23, 2024
58f707a
TotalContext: don't get_optype, use the ExtensionOp via DataflowOpTrait
acl-cqc Oct 23, 2024
0566481
TotalContext: do not require Eq, Hash, etc.
acl-cqc Oct 23, 2024
a497723
HugrValueContext -> ConstFoldContext, empty, no need for Eq/Hash/etc.
acl-cqc Oct 23, 2024
8b83284
Merge branch 'acl/const_fold2' into acl/const_fold3
acl-cqc Oct 23, 2024
d14cc69
TotalContext requires ConstLoader
acl-cqc Oct 23, 2024
56b10f5
WIP implement ConstLoader, munge ValueHandle construction
acl-cqc Oct 23, 2024
dff52bd
Restructure ValueHandle: no keys for HashedConsts, add functions.
acl-cqc Oct 23, 2024
af651e0
(TEMP / to undo later?) Remove ValueHandle::Function
acl-cqc Oct 25, 2024
29d7e03
Tidy / fix tests
acl-cqc Oct 25, 2024
8b5f6b0
note about keying by outgoingport
acl-cqc Oct 26, 2024
9f9a218
(?to revert?) Handle some LoadFunction's by reading subgraphs from Hugr
acl-cqc Oct 25, 2024
99074e1
Merge branch 'acl/const_fold2' into HEAD
acl-cqc Oct 28, 2024
8058dab
Implement pass via MutRefCell (TODO: Combine with ConstFoldContext)
acl-cqc Oct 28, 2024
a766ed9
Combine ConstFoldContext with MutRefCell, context.rs -> test.rs
acl-cqc Oct 28, 2024
53447fe
Reorder, make look more like original const_fold
acl-cqc Oct 28, 2024
e45a620
copy all old const_fold tests over
acl-cqc Oct 28, 2024
e64f519
tests: Fix test_add
acl-cqc Oct 28, 2024
58a1df2
fix: Improve find_needed_nodes
acl-cqc Oct 28, 2024
6687656
fix: Connect constant to use
acl-cqc Oct 28, 2024
c7ba482
Don't break LoadConstant out_wires; skip unnecessary cloning
acl-cqc Oct 28, 2024
294c8a7
Merge branch 'acl/const_fold2' into HEAD
acl-cqc Oct 28, 2024
7484fb9
Remove old const_fold and rename over
acl-cqc Oct 28, 2024
55f9700
Revert accidental changes to views.rs
acl-cqc Oct 28, 2024
494d849
Hide AnalysisResults::hugr via accessor,destructor,two-step transform
acl-cqc Oct 29, 2024
25f2bb7
Separate out DFContext::hugr(&self) -> &impl HugrView
acl-cqc Oct 29, 2024
522d159
Revert "Separate out DFContext::hugr(&self) -> &impl HugrView"
acl-cqc Oct 29, 2024
ebebb18
RIP TotalContext
acl-cqc Oct 29, 2024
46944f8
Two-stage transform means we don't need to extract HugrView from results
acl-cqc Oct 29, 2024
0b005e4
Go back to Deref, w/ type DFContext::View.
acl-cqc Oct 29, 2024
c4224fe
clippy+doc
acl-cqc Oct 29, 2024
1bb0756
Merge branch 'acl/const_fold2' into acl/const_fold3
acl-cqc Oct 29, 2024
124bad2
Merge branch 'acl/const_fold2' into acl/const_fold3
acl-cqc Oct 30, 2024
e78c006
...and fix by using try_into_value(!)...
acl-cqc Oct 30, 2024
19ec62e
v1 test...fails: tuple can't be removed, nothing removed, but at leas…
acl-cqc Oct 30, 2024
72a3034
v2, discard unknown in middle
acl-cqc Oct 30, 2024
a339cb0
docs
acl-cqc Oct 30, 2024
b871f61
cfg
acl-cqc Oct 30, 2024
2c615c6
drop unused From<OpaqueValue> for Box<dyn-CustomConst>
acl-cqc Oct 30, 2024
514efc1
Merge remote-tracking branch 'origin/acl/const_fold2' into acl/const_…
acl-cqc Oct 31, 2024
5c880e4
...and patch up try_into_wire_value's with type annotations
acl-cqc Oct 31, 2024
ec2cc78
Add recursive might_diverge, assume true for all CFGs
acl-cqc Nov 4, 2024
6ba0b25
Clarify "non-exhaustive" in comment
acl-cqc Nov 4, 2024
e681602
ConstFoldContext needs only & not &mut
acl-cqc Nov 4, 2024
fc44ded
Test constant folding a TailLoop (cannot remove loop)
acl-cqc Nov 4, 2024
ae9cb7c
Add pub fn allow_increase_termination, test allows removing tail-loop
acl-cqc Nov 4, 2024
3a43ae1
Hide allow_increase_termination field now we have method
acl-cqc Nov 4, 2024
f0e84ac
Allow adding inputs (pub traverse_value), fix needing port-num to dis…
acl-cqc Nov 4, 2024
02262d6
traverse_value => partial_from_const, fix docs
acl-cqc Nov 4, 2024
81b8179
fixup! Allow adding inputs
acl-cqc Nov 4, 2024
a038608
Expand test by providing always-break input, refactor/split
acl-cqc Nov 4, 2024
d90190b
refactor: assert_fully_folded takes HugrView
acl-cqc Nov 5, 2024
8f89c88
refactor: find_needed_nodes works out root itself
acl-cqc Nov 5, 2024
a6bb507
CFG test (failing atm)
acl-cqc Nov 5, 2024
3e05639
fix/change-policy: don't break edges from root input
acl-cqc Nov 5, 2024
5b2a2c9
Fix: don't follow CFG edges, but don't panic either
acl-cqc Nov 5, 2024
dcf76a6
clippy, moving might_diverge outside ConstFoldPass+parametrize
acl-cqc Nov 5, 2024
92488fe
Improve const_fold module doc
acl-cqc Nov 5, 2024
23d7aa6
Merge remote-tracking branch 'origin/acl/const_fold2' into HEAD
acl-cqc Nov 14, 2024
03de42e
Merge remote-tracking branch 'origin/acl/const_fold2' into acl/const_…
acl-cqc Nov 18, 2024
e11b3ce
Merge remote-tracking branch 'origin/acl/const_fold2' into acl/const_…
acl-cqc Nov 19, 2024
5b51434
missing docs
acl-cqc Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hugr-passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ bench = false

[dependencies]
hugr-core = { path = "../hugr-core", version = "0.13.3" }
portgraph = { workspace = true }
ascent = { version = "0.7.0" }
itertools = { workspace = true }
lazy_static = { workspace = true }
Expand Down
Loading