Marginally improve compile times

Disable a few optimizations in the TH-generated modules and add a fallthrough
case to prevent the coverage checker from firing.
This commit is contained in:
Tristan Ravitch 2017-11-21 17:20:29 -08:00
parent 7256fd597f
commit c7af261d66
3 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fno-spec-constr -fno-specialise -fmax-simplifier-iterations=1 -fno-call-arity #-}
module Data.Macaw.PPC.Semantics.PPC32
( execInstruction
) where

View File

@ -2,6 +2,7 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fno-spec-constr -fno-specialise -fmax-simplifier-iterations=1 -fno-call-arity #-}
module Data.Macaw.PPC.Semantics.PPC64
( execInstruction
) where

View File

@ -97,7 +97,12 @@ instructionMatcher ltr specialCases formulas = do
opcodeVar <- newName "opcode"
operandListVar <- newName "operands"
let normalCases = map (mkSemanticsCase ltr ipVarName operandListVar) (Map.toList formulas)
lamE [varP ipVarName, conP 'D.Instruction [varP opcodeVar, varP operandListVar]] (caseE (varE opcodeVar) (normalCases ++ specialCases))
let fallthroughCase = match wildP (normalB [| error ("Unimplemented instruction: " ++ show $(varE opcodeVar)) |]) []
let allCases = concat [ normalCases
, specialCases
, [fallthroughCase]
]
lamE [varP ipVarName, conP 'D.Instruction [varP opcodeVar, varP operandListVar]] (caseE (varE opcodeVar) allCases)
-- | Generate a single case for one opcode of the case expression.
--