search for: va_start

Displaying 20 results from an estimated 410 matches for "va_start".

2020 Aug 31
1
[PATCH v2] nouveau: fix the start/end range for migration
...-105,11 +105,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); /* Sanity check arguments */ if (args->reserved0 || args->reserved1) @@ -118,8 +118,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; if (args->v...
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 now in bar, but where dus the va_end need to be: at the end of foo or of ba...
2006 Oct 05
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
...Lattner wrote: > All the non-vastart calls can be anywhere. va_end in particular codegens > to a noop on all targets llvm currently supports, fwiw. > Things go well, except for the following (pathological?) C program: int va_double_sum(int count,...){ int i,sum=0; va_list ap; va_start(ap,count); for(i=0;i<count;i++){ sum+=va_arg(ap,int); } va_end(ap); va_start(ap,count);/* same vararg opened twice!!! */ for(i=0;i<count;i++){ sum+=va_arg(ap,int); } va_end(ap); return sum; } The problematic issue here is that the va_list is opened and used twice,...
2020 Aug 27
2
[PATCH] nouveau: fix the start/end range for migration
...-105,11 +105,14 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); + /* If no end address is given, assume a single page. */ + if (args->va_end == 0) + args->va_end = args->va_start + PAGE_SIZE; /* Sanity check arguments */ if (args->rese...
2011 Aug 15
2
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
Hi, I am using llc (llvm 2.9) to generate the MIPS assembly, but failed when compile any codes with va_start()/va_end()/va_arg(). Here is the minimal step to reproduce the failure: llvm-gcc-4.2 -emit-llvm hello.c -c -o hello.bc llc -march=mips hello.bc -o hello.s llc show this erroe message: LLVM ERROR: Cannot select: 0xa1873a0: ch = vaend 0xa187290:1, 0xa185ae0, 0xa187318 [ID=38] 0xa185ae0: i32 = Fra...
2006 Oct 02
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi, Op 2-okt-06, om 21:35 heeft Chris Lattner het volgende geschreven: > I think the easiest way to do this is to do the 'complement' as you > describe, but specially handle the varargs case. Basically you > need to > call va_start in the original function, and pass the valist pointer > down. > This shouldn't be too hard. OK. I've been rethinking my use of lib/Transforms/Utils/ CodeExtractor::ExtractCodeRegion(...) to obtain my first goal, but I don't think I need such a complex algorithm after all. B...
2009 Mar 24
0
[LLVMdev] va_start
Hi, When I try to use va_start(ptr), I got the following problem : Type *Tys = PointerType::get(IntegerType::get(8), 0); return Intrinsic::getDeclaration(llvm_module,Intrinsic::vastart,&Tys,1); ............... The Name generated is "llvm.va_start.p0i8", so, it's not found, abending the process. and Len = 1...
2009 Mar 24
0
[LLVMdev] va_start
Hi, When I try to use va_start(ptr), I got the following problem : Type *Tys = Type::VoidTy; Or Type *Tys = PointerType::get(IntegerType::get(8), 0); return Intrinsic::getDeclaration(llvm_module,Intrinsic::vastart,&Tys,1); ............... The Name generated is "llvm.va_start.p0i8", so, it's not found, abe...
2020 Nov 03
0
[PATCH AUTOSEL 5.9 33/35] drm/nouveau/nouveau: fix the start/end range for migration
...-105,11 +105,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); /* Sanity check arguments */ if (args->reserved0 || args->reserved1) @@ -118,8 +118,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; if (args->v...
2020 Nov 03
0
[PATCH AUTOSEL 5.8 27/29] drm/nouveau/nouveau: fix the start/end range for migration
...-116,11 +116,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); /* Sanity check arguments */ if (args->reserved0 || args->reserved1) @@ -129,8 +129,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; if (args->v...
2020 Nov 03
0
[PATCH AUTOSEL 5.4 22/24] drm/nouveau/nouveau: fix the start/end range for migration
...-112,11 +112,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); /* Sanity check arguments */ if (args->reserved0 || args->reserved1) @@ -125,8 +125,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; if (args->v...
2011 Aug 15
0
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
...011 at 2:18 AM, Leo Chen. <leo.q.chen at gmail.com> wrote: > Hi, > > I am using llc (llvm 2.9) to generate the MIPS assembly I would suggest trying trunk; there have been a lot of improvements recently to the MIPS backend. -Eli > but failed > when compile any codes > with va_start()/va_end()/va_arg(). > > Here is the minimal step to reproduce the failure: > llvm-gcc-4.2 -emit-llvm hello.c -c -o hello.bc > llc -march=mips hello.bc -o hello.s > > llc show this erroe message: > LLVM ERROR: Cannot select: 0xa1873a0: ch = vaend 0xa187290:1, > 0xa185ae0, 0x...
2020 Oct 26
0
[PATCH v2] nouveau: fix the start/end range for migration
...-105,11 +105,11 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, struct nouveau_cli *cli = nouveau_cli(file_priv); struct drm_nouveau_svm_bind *args = data; unsigned target, cmd, priority; - unsigned long addr, end, size; + unsigned long addr, end; struct mm_struct *mm; args->va_start &= PAGE_MASK; - args->va_end &= PAGE_MASK; + args->va_end = ALIGN(args->va_end, PAGE_SIZE); /* Sanity check arguments */ if (args->reserved0 || args->reserved1) @@ -118,8 +118,6 @@ nouveau_svmm_bind(struct drm_device *dev, void *data, return -EINVAL; if (args->v...
2011 Aug 15
1
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg()
...PS targeted llvm-gcc build. It's unclear from your usage example how llvm-gcc was configured. You can't reliably use an x86 llvm-gcc to generate bitcode and pass that to llc targeting a difference arch. -Jim > -Eli > >> but failed >> when compile any codes >> with va_start()/va_end()/va_arg(). >> >> Here is the minimal step to reproduce the failure: >> llvm-gcc-4.2 -emit-llvm hello.c -c -o hello.bc >> llc -march=mips hello.bc -o hello.s >> >> llc show this erroe message: >> LLVM ERROR: Cannot select: 0xa1873a0: ch = vaend 0...
2006 Oct 03
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Mon, 2 Oct 2006, Bram Adams wrote: > So, I wonder what problems may show up in this algorithm (steps 4, 5 > and 6 seem to be crucial). The vararg-case could be a problem in step > 5, although the va_start intrinsic isn't tied to the surrounding > Function at first sight. There is an implicit dependency between vastart and the function it lives in. Specifically, if you have: void foo(int X, ...) { P = va_start(); use(P); } You can't change this to: void foo(int X, ...) { bar...
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 unnecessary now in bar, > but where dus the va_end...
2011 Aug 16
0
[LLVMdev] llc with -march=mips failed to compile va_start()/va_end()/va_arg() (RESOLVED)
...mple how llvm-gcc was configured. You can't reliably use an x86 llvm-gcc to generate bitcode and pass that to llc targeting a difference arch. >> >> -Jim >> >>> -Eli >>> >>>> but failed >>>> when compile any codes >>>> with va_start()/va_end()/va_arg(). >>>> >>>> Here is the minimal step to reproduce the failure: >>>> llvm-gcc-4.2 -emit-llvm hello.c -c -o hello.bc >>>> llc -march=mips hello.bc -o hello.s >>>> >>>> llc show this erroe message: >>>&...
2006 Jun 13
1
R-2.3.1 does not install on FreeBSD 4.11-RELEASE (PR#8971)
...ll_Name: Kenji Rikitake Version: 2.3.1 OS: FreeBSD 4.11-RELEASE-p18 Submission from: (NULL) (220.157.163.221) After doing ./configure --disable-mbcs (as default in FreeBSD 4.x) and make the compilation stops at src/main/printutils.c as: printutils.c: In function `Rvprintf': printutils.c:582: `va_start' used in function with fixed args printutils.c:591: syntax error before `}' the following patch includes two fixes: 1) removing unnecessary va_start() and va_end() macro for Rvprintf() in src/main/printutils.c 2) fixing error by adding {} around calling error() in src/main/printutils.c...
2006 Oct 01
2
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
...a Function (no clones!) into a new Function that has the exact same signature, and adding a call to the new Function in the old one. I tried out lib/ Transforms/Utils/CodeExtractor::ExtractCodeRegion(...), but this one unfortunately checks first to see whether there are any allocas and/ or va_starts and returns a null pointer in that case. Could this check be omitted? If not, is there another way to do the extraction? One of the obstacles I face when trying to do the complement (creating new Function and adding call to original in it), is to find out how to pass the varargs argument of...
2014 Aug 26
2
[LLVMdev] [BUG] Varargs example in LangRef segfaults
...gRef (http://llvm.org/docs/LangRef.html#variable-argument-handling-intrinsics) lists an example that segfaults. Try the following on x86_64: -- 8< -- define i32 @test(i32 %X, ...) { ; Initialize variable argument processing %ap = alloca i8* %ap2 = bitcast i8** %ap to i8* call void @llvm.va_start(i8* %ap2) ; Read a single integer argument %tmp = va_arg i8** %ap, i32 ; Demonstrate usage of llvm.va_copy and llvm.va_end %aq = alloca i8* %aq2 = bitcast i8** %aq to i8* call void @llvm.va_copy(i8* %aq2, i8* %ap2) call void @llvm.va_end(i8* %aq2) ; Stop processing of arguments....