Displaying 4 results from an estimated 4 matches for "addcomp_sub".
2010 Jan 13
2
[LLVMdev] Cross-module function inlining
...ator.
int* acc = malloc(sizeof(int));
*acc = 0;
for (i = 0; i < entries; i ++)
*acc += values[i];
result = *acc;
// Deallocate the memory.
free(values);
free(acc);
return 0;
}
Here's a fragment of the final machine assembly (with -O3):
_main:
ADDCOMP out=r1 in1=r1 in2=4 conf=`ADDCOMP_SUB
WMEM in=r2 in_addr=r1 conf=`WMEM_SI
CONST_16B out=r3 conf=12
JUMP nl_out=r2/*RA*/ addr_in=&_malloc conf=`JUMP_ALWAYS_ABS // Call
In case this is important, here is the relevant declarations from the 'stdlib.h' that is in use:
_PTR _EXFUN(malloc,(size_t __size));
_VOID _EXFUN(...
2010 Jan 14
0
[LLVMdev] Cross-module function inlining
...*acc += values[i];
> result = *acc;
>
> // Deallocate the memory.
> free(values);
> free(acc);
>
> return 0;
> }
>
>
> Here's a fragment of the final machine assembly (with -O3):
>
> _main:
> ADDCOMP out=r1 in1=r1 in2=4 conf=`ADDCOMP_SUB
> WMEM in=r2 in_addr=r1 conf=`WMEM_SI
> CONST_16B out=r3 conf=12
> JUMP nl_out=r2/*RA*/ addr_in=&_malloc conf=`JUMP_ALWAYS_ABS // Call
>
>
> In case this is important, here is the relevant declarations from the
> 'stdlib.h' that is in use:
>
> _PTR _EXFUN(...
2010 Jan 13
0
[LLVMdev] Cross-module function inlining
On 13 January 2010 12:05, Mark Muir <mark.i.r.muir at gmail.com> wrote:
> On 13 Jan 2010, at 16:43, Nick Lewycky wrote:
>
> > Mark Muir wrote:
> >> - Run the existing Clang tool on each source file, using -emit-llvm to
> generate a .bc file for each module.
> >> - Run llvm-link to merge them into a single .bc file.
> >> - Run llc to generate a
2010 Jan 13
2
[LLVMdev] Cross-module function inlining
On 13 Jan 2010, at 16:43, Nick Lewycky wrote:
> Mark Muir wrote:
>> - Run the existing Clang tool on each source file, using -emit-llvm to generate a .bc file for each module.
>> - Run llvm-link to merge them into a single .bc file.
>> - Run llc to generate a complete machine assembly.
>>
>> However, with optimisations enabled, the resulting code is not as