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

More query optimization #726

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
(ruleset cicm)
(ruleset cicm-index)

(relation InvCodeMotionCandidate (Expr Expr))

(rule (
(= (TCPair t1 c1) (ExtractedExpr e1))
(= (TCPair t1 c2) (ExtractedExpr e2))
(ContextOf e1 (InIf true pred1 orig_ins3))
(ContextOf e2 (InIf true pred2 orig_ins4))
(!= e1 e2)
)
((InvCodeMotionCandidate e1 e2))
:ruleset cicm-index)


(rule (
(= if_e (If pred orig_ins thn els))
Expand Down Expand Up @@ -67,25 +81,32 @@
)
:ruleset cicm)



(rule (
(InvCodeMotionCandidate e1 e2)
(= if_e (If pred orig_ins thn els))
(HasArgType thn (TupleT tylist))
(HasArgType els (TupleT tylist))
(ContextOf if_e outer_ctx)

(ContextOf e1 (InIf true pred orig_ins))
(ContextOf e2 (InIf false pred orig_ins))
(= e1 (Bop o x1 y1))
(HasType e1 (Base ty))

(= e2 (Bop o x2 y2))

(= (TCPair t1 c1) (ExtractedExpr e1))
(> 10 (Expr-size e1))
(ExprIsPure e1)
(ContextOf e1 (InIf true pred orig_ins))
(HasType e1 (Base ty))


(= e2 (Bop o x2 y2))

(HasType e2 (Base ty))
(= (TCPair t2 c2) (ExtractedExpr e2))
(> 10 (Expr-size e2))
(ExprIsPure e2)
(ContextOf e2 (InIf false pred orig_ins))

(= t1 t2)
)
Expand Down
4 changes: 4 additions & 0 deletions dag_in_context/src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pub(crate) fn helpers() -> String {
(saturate
terms-helpers
(saturate terms-helpers-helpers)))

;; cicm index
cicm-index

;; memory-helpers TODO run memory helpers for memory optimizations

;; finally, subsume now that helpers are done
Expand Down
Loading