You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Define "stops working". With optimizations and fortification disabled during preprocessing, what other inlines were there?
Considering goblint/cil#84, which screws up our internal notion of functions, I'd say that would potentially invalidate benchmarking results as well and more likely even cause incremental comparison/update to silently do something wrong. So I'm not sure how well that would work either.
The reason will be displayed to describe this comment to others. Learn more.
I don't think the problem with merging inlines has anything to do with the CFG comparison. I just tried it again, the analysis on zstd runs through even with merge_inlines turned on, but with several warnings such as "The name MEM_32bits is used for two distinct globals". Having two distinct globals with the same name can be problematic because it possibly breaks the general CIL file comparison (used for CFG and AST comparison) which assumes that globals can be uniquely identified by their category (GVar, GVarDecl, GFun) and their name.
I opened the PR #615 to insert a check for duplicate global identifiers to hopefully make the reason for a failure more obvious than the delayed exception in List.iter2 of UpdateCil.ml that often appeared when different function globals share the same name.
The reason will be displayed to describe this comment to others. Learn more.
Actually I suspect goblint/cil#84 isn't just limited to merging of inlines, but also some other functions because there's a bunch of different cases for function merging, but regardless the names are merged unconditionally first.
I therefore suspect that a similar problem leads to this "is used for two distinct globals" if Mergecil eagerly merges the names (makes fundecs share a single varinfo), but then doesn't actually merge the functions, leaving two fundecs around.
The reason will be displayed to describe this comment to others. Learn more.
Have we come to a conclusion on what to do here? So far I ran the benchmarks without this change (that is merge_inlines turned off) because with merge_inline set to true, the incremental runs on zstd do not pass this check from #615. And I think it is not justifiable to incrementally analyze files with duplicate globals when we know that the comparison can not handle this.
The reason will be displayed to describe this comment to others. Learn more.
Well yeah, either way this causes issues for incremental compare/update (although for different reasons), so there's no easy way out.
Do you know the source for these "is used for two distinct globals" warnings?
I'm not sure if this is it, but I happened to look into the compiledb database for ztd and it contains some anomalies: files like debug.c are listed twice with vastly different arguments. For example, the first entry doesn't even have the -DZSTD_NO_INTRINSICS that we want to force it to have. Maybe it's another case of #628 where compiledb leaves some semi-duplicate broken entries?
EDIT: Bear doesn't leave multiple entries for debug.c at least.
62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be careful with this, if we do this, our incremental approach stops working for zstd. CC @stilscher
62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define "stops working". With optimizations and fortification disabled during preprocessing, what other inlines were there?
Considering goblint/cil#84, which screws up our internal notion of functions, I'd say that would potentially invalidate benchmarking results as well and more likely even cause incremental comparison/update to silently do something wrong. So I'm not sure how well that would work either.
62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throws an exception during
List.iter2
on CFG comparison.Edit: Actually, might have been during AST comparison already @stilscher?
62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's just #574, which should be fixed anyway instead of hiding it behind inline merging.
62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the problem with merging inlines has anything to do with the CFG comparison. I just tried it again, the analysis on zstd runs through even with
merge_inlines
turned on, but with several warnings such as "The name MEM_32bits is used for two distinct globals". Having two distinct globals with the same name can be problematic because it possibly breaks the general CIL file comparison (used for CFG and AST comparison) which assumes that globals can be uniquely identified by their category (GVar
,GVarDecl
,GFun
) and their name.I opened the PR #615 to insert a check for duplicate global identifiers to hopefully make the reason for a failure more obvious than the delayed exception in
List.iter2
ofUpdateCil.ml
that often appeared when different function globals share the same name.62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I suspect goblint/cil#84 isn't just limited to merging of inlines, but also some other functions because there's a bunch of different cases for function merging, but regardless the names are merged unconditionally first.
I therefore suspect that a similar problem leads to this "is used for two distinct globals" if
Mergecil
eagerly merges the names (makesfundec
s share a singlevarinfo
), but then doesn't actually merge the functions, leaving twofundec
s around.62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we come to a conclusion on what to do here? So far I ran the benchmarks without this change (that is
merge_inlines
turned off) because withmerge_inline
set totrue
, the incremental runs on zstd do not pass this check from #615. And I think it is not justifiable to incrementally analyze files with duplicate globals when we know that the comparison can not handle this.62d7591
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yeah, either way this causes issues for incremental compare/update (although for different reasons), so there's no easy way out.
Do you know the source for these "is used for two distinct globals" warnings?
I'm not sure if this is it, but I happened to look into the compiledb database for ztd and it contains some anomalies: files like
debug.c
are listed twice with vastly different arguments. For example, the first entry doesn't even have the-DZSTD_NO_INTRINSICS
that we want to force it to have. Maybe it's another case of #628 where compiledb leaves some semi-duplicate broken entries?EDIT: Bear doesn't leave multiple entries for
debug.c
at least.