Skip to content

3863 llvm term cache #3882

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

Merged
merged 5 commits into from
May 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion booster/library/Booster/LLVM/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import System.Posix.DynamicLinker qualified as Linker

import Booster.LLVM.TH (dynamicBindings)
import Booster.Pattern.Base
import Booster.Pattern.Binary hiding (Block)
import Booster.Pattern.Binary
import Booster.Pattern.Util (sortOfTerm)
import Booster.Trace
import Booster.Trace qualified as Trace
Expand Down
7 changes: 2 additions & 5 deletions booster/library/Booster/Pattern/ApplyEquations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,9 @@ llvmSimplify term = do
withTermContext result $
emitEquationTrace t Nothing (Just "LLVM") Nothing $
Success result
toCache LLVM t result
Copy link
Contributor

Choose a reason for hiding this comment

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

We have another cache access in llvmSimplify, that will actually also write to cache too. Should we remove it as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that one should stay, the two here are duplicates. We need to cache the LLVM result for performance.

pure result
| otherwise = do
result <- cb t
toCache LLVM t result
pure result
| otherwise =
cb t

----------------------------------------
-- Interface functions
Expand Down
Loading
Loading