Skip to content

Commit 19e1fe5

Browse files
authored
perf: do not consult isNoConfusion in whnf (#11571)
This PR lets `whnf` not consult `isNoConfusion`, to speed up this hot path a bit.
1 parent 5bf5c73 commit 19e1fe5

File tree

6 files changed

+1
-40
lines changed

6 files changed

+1
-40
lines changed

src/Lean/AuxRecursor.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ builtin_initialize auxRecExt : TagDeclarationExtension ← mkTagDeclarationExten
2828
def markAuxRecursor (env : Environment) (declName : Name) : Environment :=
2929
auxRecExt.tag env declName
3030

31-
@[export lean_is_aux_recursor]
3231
def isAuxRecursor (env : Environment) (declName : Name) : Bool :=
3332
auxRecExt.isTagged env declName
3433
-- TODO: use `markAuxRecursor` when they are defined
@@ -68,7 +67,6 @@ builtin_initialize noConfusionExt : TagDeclarationExtension ← mkTagDeclaration
6867
def markNoConfusion (env : Environment) (n : Name) : Environment :=
6968
noConfusionExt.tag env n
7069

71-
@[export lean_is_no_confusion]
7270
def isNoConfusion (env : Environment) (n : Name) : Bool :=
7371
noConfusionExt.isTagged env n
7472

src/Lean/Meta/WHNF.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def smartUnfoldingMatchAlt? (e : Expr) : Option Expr :=
7777

7878
def isAuxDef (constName : Name) : MetaM Bool := do
7979
let env ← getEnv
80-
return isAuxRecursor env constName || isNoConfusion env constName
80+
return isAuxRecursor env constName
8181

8282
/--
8383
Retrieves `ConstInfo` for `declName`.

src/library/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ add_library(library OBJECT expr_lt.cpp
33
module.cpp dynlib.cpp replace_visitor.cpp num.cpp
44
class.cpp util.cpp print.cpp annotation.cpp
55
reducible.cpp init_module.cpp
6-
aux_recursors.cpp
76
profiling.cpp time_task.cpp
87
formatter.cpp
98
elab_environment.cpp

src/library/aux_recursors.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/library/aux_recursors.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/library/constructions/cases_on.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Author: Leonardo de Moura
1313
#include "library/suffixes.h"
1414
#include "library/reducible.h"
1515
#include "library/constants.h"
16-
#include "library/aux_recursors.h"
1716
#include "library/constructions/util.h"
1817

1918
namespace lean {

0 commit comments

Comments
 (0)