CallStack should not be inlined
The use of CallStack based error messages (since changeset:6740d70d) has led to some code size increase, and I believe this needs to be improved.
While investigating the #10788 (closed), I was looking at the core produced by that code, and I found this in the code:
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main17 :: [Char]
[GblId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 100 0}]
Main.main17 = unpackCString# "vecto_20t0fI93Jj9LUbaZg6e04I"#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main16 :: [Char]
[GblId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 110 0}]
Main.main16 = unpackCString# "Data.Vector.Primitive.Mutable"#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main15 :: [Char]
[GblId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 120 0}]
Main.main15 = unpackCString# "./Data/Vector/Primitive/Mutable.hs"#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main14 :: Int
[GblId,
Caf=NoCafRefs,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Main.main14 = I# 97#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main13 :: Int
[GblId,
Caf=NoCafRefs,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Main.main13 = I# 16#
-- RHS size: {terms: 2, types: 0, coercions: 0}
Main.main12 :: Int
[GblId,
Caf=NoCafRefs,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Main.main12 = I# 21#
-- RHS size: {terms: 8, types: 0, coercions: 0}
Main.main11 :: SrcLoc
[GblId,
Str=DmdType,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 80}]
Main.main11 =
SrcLoc
Main.main17
Main.main16
Main.main15
Main.main14
Main.main13
Main.main14
Main.main12
This is clearly a CallStack from a library, and there is no point in copying that into the (every?) use of wherever that came from, as it will only increase code size and slow down compilation.
I don’t know how to fix it, though. Float out CallStacks more aggressively? Or is the problem that unfoldings are recorded before that can happen?
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.2 |
Type | Task |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |