idNewStrictness, idNewStrictness_maybe,
idWorkerInfo,
idUnfolding,
- idSpecialisation, idCoreRules,
+ idSpecialisation, idCoreRules, idHasRules,
idCafInfo,
idLBVarInfo,
idOccInfo,
idCoreRules :: Id -> [CoreRule]
idCoreRules id = specInfoRules (idSpecialisation id)
+idHasRules :: Id -> Bool
+idHasRules id = not (isEmptySpecInfo (idSpecialisation id))
+
setIdSpecialisation :: Id -> SpecInfo -> Id
setIdSpecialisation id spec_info = modifyIdInfo (`setSpecInfo` spec_info) id
import CoreUtils ( exprIsTrivial, isDefaultAlt )
import Id ( isDataConWorkId, isOneShotBndr, setOneShotLambda,
idOccInfo, setIdOccInfo, isLocalId,
- isExportedId, idArity, idSpecialisation,
+ isExportedId, idArity, idHasRules,
idType, idUnique, Id
)
-import IdInfo ( isEmptySpecInfo )
import BasicTypes ( OccInfo(..), isOneOcc, InterestingCxt )
import VarSet
| inlineCandidate bndr rhs = 2 -- Likely to be inlined
- | not (isEmptySpecInfo (idSpecialisation bndr)) = 1
+ | idHasRules bndr = 1
-- Avoid things with specialisations; we'd like
-- to take advantage of them in the subsequent bindings