Commit Graph

2366 Commits

Author SHA1 Message Date
Lauri Vasama 84f7926c9c Naming and reorganization for consistency 2024-05-29 15:43:35 +02:00
Lauri Vasama 1059c51292 Refactor StructTypeStorage and UnionTypeStorage 2024-05-29 15:43:35 +02:00
Lauri Vasama c24f40ad43 Add missing verify functions 2024-05-29 15:43:35 +02:00
Lauri Vasama 3a547889a3 Move struct,union get,getChecked defs to .cpp
There seem to be some issues with defining these in headers due to the
storage type being incomplete. The storage type is only defined in the
.cpp file.
2024-05-29 15:43:35 +02:00
Lauri Vasama e0eea01527 Reorder StructTypeStorage fields
Looking at the MLIR code, the order should match the order of the
parameters in get and verify.
2024-05-29 15:43:35 +02:00
Lauri Vasama 9730b00e88 Remove UnionType::verify size parameter 2024-05-29 15:43:35 +02:00
Lauri Vasama 9f7117fe81 Move ModelType test into an .inc file for sharing 2024-05-29 15:42:15 +02:00
Lauri Vasama 8ec89c658c Template FunctionMetadataCache for use with MLIR 2024-05-29 15:42:15 +02:00
Lauri Vasama 3e33a300d5 Introduce RawFunctionType::Architecture 2024-05-29 15:42:15 +02:00
Lauri Vasama 185afcf4c0 Fix spelling of FunctionEntryMDName 2024-05-29 15:42:15 +02:00
Pietro Fezzardi 2ee2577152 TypeInlineHelper: drop unused getTypeGraph method 2024-05-29 15:34:26 +02:00
Pietro Fezzardi 746cf5b55d TypeInlineHelper: rename collectStackTypes method
to collectTypesInlinableInStacks and document it.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi df9d7215b5 TypeInlineHelper: remove unnecessary members
`TypeToNumOfRefs` was used only in one method, so it can be computed
directly there on the fly.

`calculateNumOfOccurrences` doesn't need to be a method (it can be a
free function), it doesn't need to run at construction time, and it
doesn't need to return a map. So it's been moved in the `.cpp` file,
renamed to `getCrossReferencedTypes` and changed to return a set. It is
now only called when needed.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi 196a15685f Rename TypeInlineHelper::findStackTypesPerFunction
to TypeInlineHelper::findTypesToInlineInStacks, which is more
descriptive of what the method actually does.
2024-05-29 15:34:26 +02:00
Pietro Fezzardi f1fedf4e4e Drop unused TypeInlineHelper::getTypeToNumOfRefs 2024-05-29 15:34:26 +02:00
Alessandro Di Federico e22ea4b2d8 Minor changes 2024-05-29 12:23:32 +02:00
Alessandro Di Federico 47c3dd8f0f Drop model::Segment::Sections 2024-05-22 10:25:25 +02:00
Alessandro Di Federico 31b1b66f44 Reorder model::Binary fields 2024-05-22 10:25:25 +02:00
Alessandro Di Federico c061f1f971 Make Pipe::checkPrecondition mandatory 2024-05-22 10:25:25 +02:00
Alessandro Di Federico b05ab6ff3c Make Pipe::checkPrecondition mandatory 2024-05-21 09:44:04 +02:00
Djordje Todorovic c4eda86471 MakeModelCast: Change OpaqueFunctionsPool
Introduce new key: use TypePair instead of Type *.
2024-05-16 17:57:22 +02:00
Pietro Fezzardi 1fac9d0586 Fix mayReadMemory for stack custom opcodes
Before this commit, the mayReadMemory helper function was broken for
the two custom opcode functions used to model stack variables:
revng_stack_frame and revng_call_stack_arguments.

This means that those two functions were already considered as reading
memory, while the actually do not.

This commit fixes that, so that mayReadMemory now always properly
returns false for them.
2024-05-14 18:20:50 +02:00
Andrea Gussoni 1ceda0e8cb ASTNode: STL practice consistency 2024-05-07 14:01:56 +02:00
Alessandro Di Federico 31344a3270 Add missing includes 2024-05-03 21:55:33 +02:00
Alessandro Di Federico bf6cefc05a Externalize functions to improve build times 2024-05-03 21:52:40 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico 25c7834b21 Introduce test_adt
This should reduce build times.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico 8eca2e13fe Do not use SmallPtrSet with std::includes 2024-05-03 17:59:34 +02:00
Alessandro Di Federico 452036edf1 Purge instructions to save return address 2024-04-30 15:25:53 +02:00
Alessandro Di Federico 0459b9d084 Introduce RegisterUsageAnalyses 2024-04-19 18:33:00 +02:00
Alessandro Di Federico ba65443293 DetectABI call graph: no multiple identical edges 2024-04-18 17:55:22 +02:00
Alessandro Di Federico 0b4476d824 Introduce FunctionSummary::clone 2024-04-18 17:55:15 +02:00
Alessandro Di Federico ab3d546b0a Introduce GenericGraph::dumpGraph() 2024-04-18 17:50:33 +02:00
Alessandro Di Federico dcfb4621a7 Improve GenericGraph::verify 2024-04-18 17:50:33 +02:00
Alessandro Di Federico 3b135a2a2f MFP: use the provided GraphTraits for RPOT 2024-04-18 17:50:32 +02:00
Alessandro Di Federico d36d0184d3 SerializableGraph: fix template usage 2024-04-18 17:50:32 +02:00
Alessandro Di Federico a1b0ba752c GenericGraph: implement Edge::operator==
This fixes a subtle bug in GenericGraph. Basically, if the label of an
Edge was the Empty data structure, whose `operator==` always returns
`true`, the comparison between edges was broken.
2024-04-18 17:50:32 +02:00
Alessandro Di Federico dae9f33544 Minor changes 2024-04-18 17:50:31 +02:00
Pietro Fezzardi 8b0f4e035c RestructureCFG: update deduplicated dummy nodes
Before this commit, it could happen that some duplicated dummy node
(used to mark backedges) could be left lingering in wrong regions when
collapsing a regions, if they were first iteration outlined.

This commit fixes the problem, by collecting them and letting
`updateNodes` take care of them, removing them from the containing
region and all its parents.
2024-03-25 18:08:35 +01:00
Pietro Fezzardi 454e38e4ff RestructureCFG: handle retreating from SetNodes 2024-03-25 18:08:35 +01:00
Pietro Fezzardi 05cc20cb6e Rename MallocLike Tag to ReturnsPolymorphic
Also add this Tag to the LocalVariable opcode who was missing it.
2024-03-19 09:44:00 +01:00
Pietro Fezzardi ed88c6b459 Use LLVM MemoryEffects in hasSideEffects 2024-03-19 09:44:00 +01:00
Pietro Fezzardi 206936f1c0 Drop redunant ReadsMemory and WritesMemory Tags
Over time, these tags have shifted to basically coincide with the Copy
and Assign tags. There's no need for them anymore they just make the
code more verbose and less straightforward.
2024-03-19 09:44:00 +01:00
Pietro Fezzardi 83d56fb40b Update hasSideEffects helper function
Before this commit the `hasSideEffects` helper function was only a stub,
that was never updated to be aware of recent FunctionTags representing
custom opcodes without side-effects.

This commit updates it, so that now it is less aggressive in marking
harmless stuff as side-effectful.
2024-03-19 09:44:00 +01:00
Pietro Fezzardi df3bd470a1 Enforce determinism on CSV handling
Various parts of revng replace `llvm::GlobalVariable`s representing CSVs
with Allocal/Load/Store. In particular, these are PromoteCSV,
RootAnalyzer and PromoteGlobalToLocalVars.

Before this commit, those places were sloppy when replacing CSVs with
Alloca/Load/Store, and did that iterating on a container sorted by
pointers. This caused Alloca/Load/Store to be emitted in different order
accross runs, which in turn caused more non-determinism down the
pipeline.

This commit fixes the non-deterministic behavior, sorting CSVs based on
their names, which should always be present and deterministic.
2024-03-19 09:43:59 +01:00
Pietro Fezzardi 1baec8ff7b Drop old MonotoneFramework 2024-03-19 09:43:59 +01:00
Pietro Fezzardi 2cd7777030 MFP: add SetIntersectionLattice 2024-03-19 09:43:59 +01:00
Ivan Krysak 64eb2adb7c Minor improvements 2024-03-18 19:32:34 +01:00
Ivan Krysak 6b7650276e EFA: split importModel into multiple methods 2024-03-18 19:32:34 +01:00
Ivan Krysak 024e5b931c STLExtras: introduce revng::to helper 2024-03-18 19:32:34 +01:00