Displaying 5 results from an estimated 5 matches for "extracted_sum".
2006 Oct 05
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
...return sum;
}
The problematic issue here is that the va_list is opened and used twice,
which should work according to GCC. If I convert the program's LLVM
bytecode to the following pseudo-bytecode:
int va_double_sum(int count,...){
/*declare va_list*/
/*llvm.va_start va_list*/
/*call extracted_sum(count,va_list)*/
/*llvm.va_end va_list*/
}
int extracted_sum(int count,/*vararg-argument*/){
/*see original va_double_sum WITHOUT the llvm.va_start's and
llvm.va_end's and WITH all uses of the original va_list replaced with
the extra vararg-argument*/
}
Apparently, the problem is ho...
2006 Oct 03
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Tue, 3 Oct 2006, Bram Adams wrote:
>> You'd have to change it to something like:
>> void foo(int X, ...) {
>> P = va_start();
>> bar(X, P);
>> }
>>
>> void bar(int X, valist P) {
>> use(P);
>> }
>
> Can the other va_...-intrinsics be used in bar as were the "P =
> va_start" in bar? The va_start probably is
2006 Oct 03
2
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 3-okt-06, om 20:48 heeft Chris Lattner het volgende geschreven:
> You'd have to change it to something like:
>
> void foo(int X, ...) {
> P = va_start();
> bar(X, P);
> }
>
> void bar(int X, valist P) {
> use(P);
> }
Can the other va_...-intrinsics be used in bar as were the "P =
va_start" in bar? The va_start probably is unnecessary
2006 Oct 05
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Thu, 5 Oct 2006, Bram Adams wrote:
> Apparently, the problem is how to "rewind" the vararg-argument back to
> its first element when the second loop is reached, as it seems that the
> code just continues at position count and beyond, resulting in overflow.
>
> I'm not sure whether this code snippet is valid ANSI C, and if it is,
> one probably shouldn't use
2006 Oct 05
1
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 5-okt-06, om 16:05 heeft Ryan Brown het volgende geschreven:
> I don't know if that's valid but what about something like this:
> int va_double_sum(int count,...){
> /*declare va_list for each original va_start*/
> /*llvm.va_start for each va_list*/
> /*call extracted_sum(count,va_list1, va_list2, ...)*/
> }
That should work, I think, ...
Op 5-okt-06, om 20:51 heeft Chris Lattner het volgende geschreven:
> Why not va_copy the input valist?
... and so would this. The only problem left is that both require an
easy way to replace each use of the original va...