Skip to content

Commit

Permalink
index working
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Feb 7, 2025
1 parent ec3ca48 commit e5b96bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
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

0 comments on commit e5b96bb

Please sign in to comment.