Skip to content
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions compiler/core/lam_util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ let refine_let ~kind param (arg : Lam.t) (l : Lam.t) : Lam.t =
| Lam_primitive.Pmakeblock _ -> true
| _ -> false
in
(* Helper for spotting RHS expressions that are safe to inline everywhere.
These are the obviously pure shapes where substituting the original value
cannot introduce extra work or side effects. *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. "does not have side effects" is enough of a description? If so isn't there a function already.
Otherwise, let's keep it as is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw some_not_nest could have side effects in the expression inside right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch, updated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no whitespace changes all over the file, one moment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok should be fine now

let is_alias_candidate (lam : Lam.t) =
match lam with
| Lvar _ | Lconst _ -> true
Expand Down
Loading