Skip to content
Snippets Groups Projects
Commit fe4de704 authored by Grebant Sandro's avatar Grebant Sandro
Browse files

Polyhedra analysis benchmarks

parents
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
ARCH=arm-none-eabi-
CC=$(ARCH)gcc
LD=$(ARCH)ld
OBJDUMP=$(ARCH)objdump
CFLAGS=-O0 -g -nostdlib
LDFLAGS=-nostdlib -g
GOALS=ln ln_complex
all: $(GOALS)
%.o : %.c
% : %.o
clean:
rm -f *.csv *.o $(GOALS)
ln.c 0 → 100644
/**
* This artificial benchmark can stress the polyhedra analysis In
* fact, the analysis analyzes several times each loop body until a
* fixpoint is reached. Thus this benchmark nests loops on several
* depth to demonstrate that modular analysis is way faster in this
* case
*/
/* Sample function that performs computations */
int compute(int x, int y, int z, int a){
int res = 0;
res += x;
res += y;
res += z;
res += a;
return res;
}
/* no loop */
int ln0(){
int res = 0;
res = compute(0,0,0,0);
return res;
}
/* loop nest l */
int ln1(int x){
int res = 0;
for(int i = 0; i < x; i++)
res += compute(i,0,0,0);
}
/* loop nest l > l */
int ln2(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
res += compute(i,j,0,0);
return res;
}
/* loop nest l > l > l */
int ln3(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
for(int k = 0; k < x; k++)
res += compute(i,j,k,0);
return res;
}
/* loop nest l > l > l > l */
int ln4(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
for(int k = 0; k < x; k++)
for(int l = 0; l < x; l++)
res += compute(i,j,k,l);
}
/* Sample main function */
int main(){
ln0(1,2,3,4);
ln1(10);
ln2(10);
ln3(10);
}
/**
* This artificial benchmark can stress the polyhedra analysis In
* fact, the analysis analyzes several times each loop body until a
* fixpoint is reached. Thus this benchmark nests loops on several
* depth to demonstrate that modular analysis is way faster in this
* case
*/
/* Sample function that performs computations */
int compute(int x, int y, int z, int a){
int res = 0;
if(x > res)
res += 1;
else
res -=1;
if(y < res)
res -= 2;
else
res += 2;
if(z > x)
res += 3;
else
res += 68;
if(a > 0)
res -= 45;
else
res += 1800;
return res;
}
/* no loop */
int ln0(){
int res = 0;
res = compute(0,0,0,0);
return res;
}
/* loop nest l */
int ln1(int x){
int res = 0;
for(int i = 0; i < x; i++)
res += compute(i,0,0,0);
}
/* loop nest l > l */
int ln2(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
res += compute(i,j,0,0);
return res;
}
/* loop nest l > l > l */
int ln3(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
for(int k = 0; k < x; k++)
res += compute(i,j,k,0);
return res;
}
/* loop nest l > l > l > l */
int ln4(int x){
int res = 0;
for(int i = 0; i < x; i++)
for(int j = 0; j < x; j++)
for(int k = 0; k < x; k++)
for(int l = 0; l < x; l++)
res += compute(i,j,k,l);
}
/* Sample main function */
int main(){
ln0(1,2,3,4);
ln1(10);
ln2(10);
ln3(10);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment