Alessandro Di Federico
a6759b9231
LLVMIRForMLIR: name structs with growing numbers
2024-06-18 17:56:24 +02:00
Alessandro Di Federico
61358cd862
Clift: adopt revng pipe for unit testing
2024-06-18 17:56:24 +02:00
Alessandro Di Federico
3dc8cf5e84
Minor changes
2024-06-18 17:56:24 +02:00
Pietro Fezzardi
4fc37fe7eb
DLA: improve ArrangeAccessesHierarchically logs
2024-06-18 11:19:50 +02:00
Pietro Fezzardi
64d41a9b1d
DLA: fix ArrangeAccessesHierarchically iteration
...
Before this commit the code was wrong in 2 ways:
- if failed to iterate on children, because it iterated a range that was
effectively [begin, begin) instead of [begin, end)
- the update of the ARootNext iterator in the loop was broken, but it
was impossible to realize that since the loop was never taken
This commit fixes both these intertwined problems.
2024-06-18 11:19:50 +02:00
Pietro Fezzardi
9d24e9372d
Clift FieldAttr::verify: improve debug message
2024-06-18 11:17:41 +02:00
Pietro Fezzardi
b9ef4b205c
Clift parseCompositeType: improve debug messages
2024-06-18 11:17:18 +02:00
Lauri Vasama
6803317f56
Remove type completeness check in FieldAttr verify
2024-06-13 14:03:28 +03:00
Pietro Fezzardi
7e44777c98
ModelToHeader: reduce lifetime of TypeInlineHelper
2024-06-07 17:59:06 +02:00
Pietro Fezzardi
84a40d0239
TypeInlineHelper: clean up members and methods
2024-06-07 17:59:06 +02:00
Pietro Fezzardi
d82255b3fa
Don't inline pointer types
...
Support for them was subtly bugged in case of recursive types, and
properly supporting this is not trivial.
We disable them for now.
2024-06-07 17:59:06 +02:00
Pietro Fezzardi
7a38a257b9
Refactor TypeInlineHelper::findTypesToInline
...
This change is a preparation for further decoupling of the
TypeInlineHelper from its custom dependency graph type, to try and reuse
the DependencyGraph used in ModelToHeader.
2024-06-07 17:59:06 +02:00
Pietro Fezzardi
e052dee40f
Drop isCandidateForInline
2024-06-07 17:59:06 +02:00
Pietro Fezzardi
8a7b5d4a25
ModelToHeader: refactor printTypeDefinitions
...
This refactoring makes the code less redundant, more concise,
and more explicit about how it handle's type inlining, while adding
documentation.
2024-06-07 17:58:36 +02:00
Pietro Fezzardi
a44679f847
ModelToPTMLTypeHelpers.cpp: fix unaligned Doxygen
2024-06-07 17:55:52 +02:00
Giacomo Vercesi
e0336096af
S3StorageClient: actually check presence of file
...
In the `type` function, if a file is present in the index then it should
also be checked in the bucked via a HEAD call. This allows revng to
successfully start up even if a file in the `index.yml` files has been
deleted on S3.
2024-06-06 15:45:02 +02:00
Pietro Fezzardi
44a4a77d53
Backend: prevent emission of const variables
...
At the moment in C we can't emit variable declarations with inline
initialization. Not for some substantial problem, but we haven't
implemented it yet. As a result if TypeMap.at(VarDeclCall) returns a
const-qualified type we will end up generating C code that doesn't
compile, when it tries to assign a value to the variable for
initializing it separately from the declaration.
To work around this, until we don't support emission of variable
declarations with inline initialization, we have to strip away
constness.
2024-06-06 11:27:48 +02:00
Pietro Fezzardi
7caa5eda96
PeepholeOptimizationPass can reorder instructions
2024-06-06 10:43:17 +02:00
Lauri Vasama
cccee1ed99
Add structured Clift type alias generation
2024-06-05 15:07:23 +02:00
Lauri Vasama
bfe353d1f6
Improve Clift type and type attribute verification
2024-06-05 15:07:23 +02:00
Lauri Vasama
dad3aa5406
Remove unhelpful assert in model type import
2024-06-05 15:07:23 +02:00
Lauri Vasama
d822e463e2
Use clift::ValueType instead of mlir::Type
2024-06-05 15:07:23 +02:00
Lauri Vasama
6470dd34ff
Miscellaneous Clift cleanup for consistency
2024-06-05 15:07:23 +02:00
Lauri Vasama
7ff16c9c2b
Add abort on unsupported type in Clift printType
2024-06-05 15:07:23 +02:00
Lauri Vasama
9f7cfa183f
Reorganize Clift code
2024-06-05 15:07:23 +02:00
Lauri Vasama
3ebf26bedf
Improve static_asserts for kindToKind
2024-06-05 15:07:23 +02:00
Lauri Vasama
34d488a086
Add using directives for mlir::clift
2024-06-05 15:07:23 +02:00
Lauri Vasama
0c8a04432e
Fix use of size_t to represent type ID
2024-06-05 15:07:23 +02:00
Lauri Vasama
4ebe4fb140
Rename remaining Clift type definition attributes
2024-06-05 15:07:23 +02:00
Lauri Vasama
a310080fbd
Rename Clift StructType and UnionType attributes
2024-06-05 15:07:23 +02:00
Lauri Vasama
8f19b5f351
Remove redundant global namespace qualifiers
2024-06-05 15:07:23 +02:00
Pietro Fezzardi
e78aaad61a
ALAPVariableDeclaration: fix ValueCompareNode
...
`ValueCompareNode`s have an associated `BasicBlock` which must be taken
into account when performing the ALAP Variable Declaration routine.
2024-06-04 00:10:28 +02:00
Pietro Fezzardi
677155d436
TANP: fix off-by-one in wrapping ICmp reduction
...
This bug caused the expression x + (-2) < -3 to be rewritten as
(x > 2) || (x < -1), instead of (x > 2) && (x < -1).
We had tests for a very similar case, but this specific example was
triggered by having the two constant terms in the inequality with a
difference of only one.
This commit rewrites and unifies the logic for handling inequalities,
and adapts the test for checking this specific additional corner case.
2024-06-04 00:10:27 +02:00
Djordje Todorovic
6941df12a3
Add SimplifySwitch Pipe
2024-05-29 16:27:52 +02:00
Djordje Todorovic
e527656074
ValueMaterializer: Handle Intrinsic::fshl in DFG
2024-05-29 16:25:53 +02:00
Djordje Todorovic
5c44773b02
ValueMaterializer: Handle llvm::Argument in DFG
2024-05-29 16:25:53 +02:00
Lauri Vasama
ba58ec8edb
Add import-clift-types pipe
2024-05-29 15:43:35 +02:00
Lauri Vasama
ba914a1bb5
Replace MLIR container and LLVM import pipe
2024-05-29 15:43:35 +02:00
Lauri Vasama
a8e2bb8c48
Add ImportModelType pass, register in clift-opt
2024-05-29 15:43:35 +02:00
Lauri Vasama
7abadd08ae
Add model types to Clift MLIR import
2024-05-29 15:43:35 +02:00
Lauri Vasama
8063efb1e2
Install MLIRCliftDialect library
2024-05-29 15:43:35 +02:00
Lauri Vasama
f4ff27b221
Add ScalarTupleType for RawFunctionType return
2024-05-29 15:43:35 +02:00
Lauri Vasama
9f99866edd
Move CliftStorage.h to lib/
2024-05-29 15:43:35 +02:00
Lauri Vasama
6db424b02b
Factor Clift type parsing out into separate files
2024-05-29 15:43:35 +02:00
Lauri Vasama
10a80de57f
Fix Clift type parsing
...
* Allow empty parameter list for FunctionAttr.
* Allow empty field list for struct but not union.
2024-05-29 15:43:35 +02:00
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
b5b79709be
Fix spelling of OnUnexpectedToken
2024-05-29 15:43:35 +02:00
Lauri Vasama
dbdb4aabcb
Add alias for error emission function_ref
2024-05-29 15:43:35 +02:00
Lauri Vasama
58e5a55403
Add support for typedef as enum underlying type
2024-05-29 15:43:35 +02:00