23 Commits

Author SHA1 Message Date
Alessandro Di Federico 6a594a9133 MFP: rename namespace MFP into mfp 2026-06-11 17:39:53 +02:00
Alessandro Di Federico d03e62c250 MFP: add ExtraState, MFPConfiguration, variant
Three closely-coupled changes that have to land together to keep
every caller compiling:

- Introduce a per-instance ExtraState recording surface (with a
  NoExtraState default) and thread it through applyTransferFunction.
- Replace getMaximalFixedPoint's positional arg list with a single
  MFPConfiguration struct, so callers spell out only the fields they
  need.
- Replace the EntryLabels pointer with an Entry/All/vector* variant
  so callers can ask for the graph entry, every node, or a custom
  list without juggling extra arguments.

Update every existing caller for the new signatures and switch
Liveness::GraphType to a plain Function* (with the inverse
GraphTraits selected at call sites).
2026-06-11 17:39:53 +02:00
Giacomo Vercesi 27f419c8cd Fix and ban namespace clobbering
Fix an instance where the `std` namespace got clobbered into the global
namespace by accident.
2026-02-16 10:34:38 +01:00
Alessandro Di Federico c18aa628e7 Minor changes 2025-12-19 14:38:19 +01:00
Alessandro Di Federico 5820908675 Remove and ban \file 2025-12-16 17:41:55 +01:00
Alessandro Di Federico 939e23445b DataFlowRangeAnalysis: drop overly strict abort 2025-11-11 17:15:49 +01:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 1429b526ab Introduce libtcg
This commit drops libptc in favor of its new form libtcg.

It brings several improvements, among which:

* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
  easier to debug and solves some limitations (e.g., tracking leaking
  pointers).
* Identification of pieces of the CPU state that are read by each helper
  and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
  issues related to code that needed to be mapped where something is
  already present.
* We now have two distinct flavors of helper modules: the full one and
  the "slim" one. The latter contains the definition only of functions
  we intend to inline. It is used in most of the pipeline, a good thing
  since we spend less time optimizing code we don't really care about.
  The full module is only used on the re-compilation branch of the
  pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
  opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
  assembly.
* We now verify that the lifted code only contains code we expect.
2025-10-31 17:25:03 +01:00
Alessandro Di Federico e81dbfd898 Minor changes 2025-10-29 10:56:50 +01:00
Alessandro Di Federico 4fb6b5f4e1 Minor changes 2025-10-24 18:20:48 +02:00
Alessandro Di Federico 7783c0484a AVI: sort entry points by dominance
This commit a non-deterministic bug on ARM's switch-disjoint-ranges
test.

The problem was that we were setting as initial nodes of the monotone
framework all the nodes that are not reachable from the nodes classified
as initial nodes *so far*.
This approach is susceptible to the visit order.
Classifying certain nodes as entry nodes degrades the analysis results
since we associates a top value to them.

Electing initial nodes by traversing a list of nodes sorted by dominance
solves this problem.
2025-10-02 14:32:17 +02:00
Alessandro Di Federico de2a96c34c AVI: set the extremal value ot top 2025-04-15 15:31:10 +02:00
Alessandro Di Federico 744184c90c Do not use CallBase::getCalledFunction
Use our wrapper, which does not return nullptr if the `FunctionType`s do
not match.
2024-08-07 16:07:59 +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
Alessandro Di Federico dae9f33544 Minor changes 2024-04-18 17:50:31 +02:00
Alessandro Di Federico 99fec2cb10 AdvancedValueInfo: improve logging 2023-07-26 10:16:25 +02:00
Alessandro Di Federico dcc7ca3c6b AdvancedValueInfoMFI: zero-extend constraints
This commit introduces a change in AdvancedValueInfoMFI which forces to
consider constraints valid on 32-bit values to be valid on their
untruncated 64-bit counterparts.

While being unsound, this is important to easily devirtualize indirect
branches on 64-bit architectures where often constraints are expressed
on 32-bit switch values.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 0b5404b8ac AdvancedValueInfo: include MFP's DOTGraphTraits
The fact we were missing this include led to dump mute graphs.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 22b3da2a02 Remove {DataFlow,ControlFlowEdges}Graph::Base 2023-07-26 10:16:25 +02:00
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00
Alessandro Di Federico 5885e4f9c8 ValueMaterializer: fix handling of ptr 2023-06-30 16:57:33 +02:00
Alessandro Di Federico a65ccc3413 Introduce ValueMaterializer
`ValueMaterializer` is a rewrite of what was called `AdvancedValueInfo`
which follows the same principles.

The main benefits over the old version is:

* We materialize the data-flow graph and the CFG of the relevant part of
  root. This makes debugging significantly easier.
* We drop the old MonotoneFramework infrastructure in favor of
  getMaximalFixedPoint.
* We significantly reduce the amount of queries we make to
  AdvancedValueInfo.
2023-06-30 13:39:22 +02:00