Skip to content

Instantly share code, notes, and snippets.

View joaobispo's full-sized avatar

João Bispo joaobispo

View GitHub Profile
@joaobispo
joaobispo / inlining_example_after.c
Created October 17, 2022 15:19
Code for testing inlining - After
#include <stdio.h>
void funA(int x, int *X, int *Y) {
{
int i;
i = 0;
bool decomp_0;
decomp_0 = i < 100;
while(decomp_0) {
X[i] = Y[i] * x;
i++;
@joaobispo
joaobispo / inlining_example_before.c
Created October 17, 2022 15:19
Code for testing inlining - Before
#include <stdio.h>
void funA(int x, int *X, int *Y) {
for (int i = 0; i < 100; i++) {
X[i] = Y[i] * x;
}
}
int funD(int x) {
return x * x * x;
@joaobispo
joaobispo / closure_idivide.lara
Created October 8, 2015 18:51
LARA Example - idivide
// Replaces division operations in closure function with a MATISSE primitive that performs integer division
aspectdef closure_idivide
select function{"closure"} end
apply
call replace_operator("/", "N", "2", "matisse_idivide");
call replace_operator("/", "ii", "2", "matisse_idivide");
end
end