Tempo Specializer: A Partial Evaluator for C
Tempo is an offline partial evaluator for C, developed at IRISA/INRIA and LABRI in France. It analyzes which inputs are known at specialization time, performs alias and side-effect analyses, and then generates specialized code either at compile time or at run time. It has been applied to operating systems, networking, computer graphics, and scientific computing, yielding substantial speedups.
Basically, everything in blue (bold) will disappear after specialization; only red (standard font) parts will remain.
- looperhacks
I know this has nothing to do with TFA, just want to check my understanding of C. Doesn't the code example have a bug?
miniprintf(char fmt[], int val[])
{
int i = 0;
while( *fmt != '\0' ) {
if( *fmt != '%' )
putchar(*fmt);
else
switch(*++fmt) {
case 'd' : putint(val[i++]); break;
case '%' : putchar('%'); break;
default : prterror(*fmt); break;
}
fmt++;
}
}
If the static string was "%", the else branch would move past the end of the string. Assuming prterror doesn't crash the program, this reads out-of-bounds, right?
- RossBencina
While unsuccessfully searching for the Tempo source code I found LLPE, a partial evaluator for LLVM bitcode: https://www.llpe.org/
- MiroslavPokorny
> The Tempo specializer has been made publicly available under a licence in April 1998. At of March 99, it was being used by about thirty people around the world. The binary version of Tempo has just (July 2000) been made available without any restrictions, and we expect a full unrestricted source release under GPL to follow soon.
- alex7o
We need a partial evaluator for llvm bytecode imo so it works with all languages
- hizlikovboy27
Does anyone know if there's a modern build of it? the download on the page is an i386 Linux binary tested on RedHat 6.1