chore: missing profileitM (#4753)
This PR addresses the absence of the `profileitM` function in two auxiliary functions. The added `profileitM` instances are particularly useful for diagnosing performance issues in declarations that contain many repeated sub-terms.
This commit is contained in:
parent
1a9cbc96f1
commit
f986a2e9ef
2 changed files with 3 additions and 2 deletions
|
|
@ -52,7 +52,8 @@ private def getLevelParamsPreDecls (preDefs : Array PreDefinition) (scopeLevelNa
|
|||
| Except.error msg => throwError msg
|
||||
| Except.ok levelParams => pure levelParams
|
||||
|
||||
def fixLevelParams (preDefs : Array PreDefinition) (scopeLevelNames allUserLevelNames : List Name) : TermElabM (Array PreDefinition) := do
|
||||
def fixLevelParams (preDefs : Array PreDefinition) (scopeLevelNames allUserLevelNames : List Name) : TermElabM (Array PreDefinition) :=
|
||||
do profileitM Exception s!"fix level params" (← getOptions) do
|
||||
-- We used to use `shareCommon` here, but is was a bottleneck
|
||||
let levelParams ← getLevelParamsPreDecls preDefs scopeLevelNames allUserLevelNames
|
||||
let us := levelParams.map mkLevelParam
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ def shouldUseWF (preDefs : Array PreDefinition) : Bool :=
|
|||
preDef.termination.decreasingBy?.isSome
|
||||
|
||||
|
||||
def addPreDefinitions (preDefs : Array PreDefinition) : TermElabM Unit := withLCtx {} {} do
|
||||
def addPreDefinitions (preDefs : Array PreDefinition) : TermElabM Unit := withLCtx {} {} do profileitM Exception "add pre-definitions" (← getOptions) do
|
||||
for preDef in preDefs do
|
||||
trace[Elab.definition.body] "{preDef.declName} : {preDef.type} :=\n{preDef.value}"
|
||||
let preDefs ← preDefs.mapM ensureNoUnassignedMVarsAtPreDef
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue