diff options
-rw-r--r-- | compiler/GHC/Stg/Syntax.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index 972efc5f44..abbf4131d7 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -180,6 +180,8 @@ stgArgType (StgLitArg lit) = literalType lit stripStgTicksTop :: (StgTickish -> Bool) -> GenStgExpr p -> ([StgTickish], GenStgExpr p) stripStgTicksTop p = go [] where go ts (StgTick t e) | p t = go (t:ts) e + -- This special case avoid building a thunk for "reverse ts" when there are no ticks + go [] other = ([], other) go ts other = (reverse ts, other) -- | Strip ticks of a given type from an STG expression returning only the expression. |