Skip to content

Commit

Permalink
Merge pull request #591 from GaloisInc/bh-performance
Browse files Browse the repository at this point in the history
Remove completely unnecessary call to `mkTypedTerm`.
  • Loading branch information
brianhuffman authored Nov 18, 2019
2 parents 47aa9f3 + 207dab9 commit 0177adb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/saw-core
1 change: 1 addition & 0 deletions src/SAWScript/Crucible/LLVM/Builtins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ setupLLVMCrucibleContext bic opts lm@(LLVMModule _ llvm_mod mtrans) action = do
, _ccBackend = sym
, _ccLLVMSimContext = lsimctx
, _ccLLVMGlobals = lglobals
, _ccBasicSS = biBasicSS bic
}
)

Expand Down
2 changes: 2 additions & 0 deletions src/SAWScript/Crucible/LLVM/MethodSpecIR.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import qualified SAWScript.Crucible.Common.Setup.Type as Setup

import qualified SAWScript.Crucible.LLVM.CrucibleLLVM as CL

import Verifier.SAW.Rewriter (Simpset)
import Verifier.SAW.SharedTerm
import Verifier.SAW.TypedTerm

Expand Down Expand Up @@ -211,6 +212,7 @@ data LLVMCrucibleContext arch =
, _ccBackend :: Sym
, _ccLLVMSimContext :: Crucible.SimContext (Crucible.SAWCruciblePersonality Sym) Sym (CL.LLVM arch)
, _ccLLVMGlobals :: Crucible.SymGlobalState Sym
, _ccBasicSS :: Simpset
}

makeLenses ''LLVMCrucibleContext
Expand Down
4 changes: 2 additions & 2 deletions src/SAWScript/Crucible/LLVM/Override.hs
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ refreshTerms sc ss =
where
freshenTerm tt =
case asExtCns (ttTerm tt) of
Just ec -> do new <- liftIO (mkTypedTerm sc =<< scFreshGlobal sc (ecName ec) (ecType ec))
return (termId (ttTerm tt), ttTerm new)
Just ec -> do new <- liftIO (scFreshGlobal sc (ecName ec) (ecType ec))
return (termId (ttTerm tt), new)
Nothing -> error "refreshTerms: not a variable"

------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions src/SAWScript/Crucible/LLVM/ResolveSetupValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ import qualified Data.SBV.Dynamic as SBV (svAsInteger)
import SAWScript.Crucible.Common (Sym)
import SAWScript.Crucible.Common.MethodSpec (AllocIndex(..), SetupValue(..))

import SAWScript.Prover.Rewrite
import SAWScript.Crucible.LLVM.MethodSpecIR

--import qualified SAWScript.LLVMBuiltins as LB
Expand Down Expand Up @@ -369,7 +368,7 @@ resolveSAWTerm cc tp tm =
Just (Some w)
| Just LeqProof <- isPosNat w ->
do sc <- Crucible.saw_ctx <$> readIORef (W4.sbStateManager sym)
ss <- basic_ss sc
let ss = cc^.ccBasicSS
tm' <- rewriteSharedTerm sc ss tm
mx <- case getAllExts tm' of
[] -> do
Expand Down

0 comments on commit 0177adb

Please sign in to comment.