Multiverse: Extending LLVM by Compiler-Assisted Dynamic Variability for Structs

Function Multiverse is a compiler-assisted approach to realize dynamic variability efficiently. It is designed to combine the flexibility and simplicity of control flow branches with the performance of binary patching. Therefore, Multiverse provides a compiler-assisted hybrid approach between dynamic and static variability. Configuration possibilities are detected during compilation and used as a basis to compile specialized code manifestations which are put in place at run-time. It has been shown that Multiverse can be successfully applied in a real-world software project like the Linux Kernel.

Multiverse addresses the need for tailored and self-adapting software systems. However, variability often manifests itself at more than just the control flow level. In many cases it also targets the composition of data structure definitions.

  struct my_type {
      int a;
  #ifdef CONFIG_HAS_B
      int b;
  #endif
  };

The goal of this project is to extend Multiverse to make hybrid variability possible that also includes variation of structure definitions. The existing Multiverse compiler plugin is to be extended to generate the superset definition of each affected structure based on the configuration switches. Variant generation must be extended to also include functions with accesses to the respective multivariant structures. In order to keep the combinatorial explosion under control, automatic accessor function generation may be used. Branched configuration switches imply union behaviour.

  struct my_type {
      int a;
  #ifdef CONFIG_DECIMAL_B
      double b;
  #else
      int b;
  #endif
  };

The Multiverse run-time library should be extended to support the variability on structure type level. The implementation is to be systematically evaluated using synthetic test programs and benchmarks.

EuroSys Conference A
Multiverse: Compiler-Assisted Management of Dynamic Variability in Low-Level System Software
Florian Rommel, Christian Dietrich, Michael Rodin, Daniel LohmannFourteenth EuroSys Conference 2019 (EuroSys '19)ACM Press2019.
PDF Slides 10.1145/3302424.3303959 [BibTex]
DSPL Workshop
Function Multiverses for Dynamic Variability
Valentin Rothberg, Christian Dietrich, Alexander Graf, Daniel LohmannFoundations and Applications of Self* Systems2016.
PDF [BibTex]