search for: nocaptur

Displaying 20 results from an estimated 585 matches for "nocaptur".

Did you mean: nocapture
2018 Apr 25
2
Help on understanding assume shape array processing and array descriptors in LLVM IR
...,Lj INTEGER, INTENT(IN) :: Istr, Iend, Jstr,Jend INTEGER :: i, j REAL*8, INTENT(INOUT) :: a(Li:,Lj:) REAL*8, INTENT(IN) :: b(Li:,Lj:) --snip-- I got the below LLVM IR, the parameters received. --snip-- ; Function Attrs: norecurse nounwind define void @test_(i64* noalias nocapture %a, i64* noalias nocapture readonly %b, i64* noalias nocapture readonly %li, i64* noalias nocapture readonly %lj, i64* noalias nocapture readonly %istr, i64* noalias nocapture readonly %iend, i64* noalias nocapture readonly %jstr, i64* noalias nocapture readonly %jend, i64* noalias nocapture reado...
2018 Apr 25
0
Help on understanding assume shape array processing and array descriptors in LLVM IR
...,Lj INTEGER, INTENT(IN) :: Istr, Iend, Jstr,Jend INTEGER :: i, j REAL*8, INTENT(INOUT) :: a(Li:,Lj:) REAL*8, INTENT(IN) :: b(Li:,Lj:) --snip-- I got the below LLVM IR, the parameters received. --snip-- ; Function Attrs: norecurse nounwind define void @test_(i64* noalias nocapture %a, i64* noalias nocapture readonly %b, i64* noalias nocapture readonly %li, i64* noalias nocapture readonly %lj, i64* noalias nocapture readonly %istr, i64* noalias nocapture readonly %iend, i64* noalias nocapture readonly %jstr, i64* noalias nocapture readonly %jend, i64* noalias nocapture reado...
2017 Apr 28
2
Return on nocapture pointer
...u it make sense to extend the definition in LangRef? If so I will be happy to upload a patch. Piotr 2017-04-28 17:58 GMT+02:00 Hal Finkel <hfinkel at anl.gov>: > > > On 04/28/2017 10:22 AM, Piotr Padlewski via llvm-dev wrote: > > Hi, > I have a question about semantics of nocapture attribute: > "This indicates that the callee does not make any copies of the pointer > that outlive the callee itself. " > Is returing a pointer considered outliving callee? For example is this > code valid: > > > Yes, it includes returning the pointer. The code belo...
2017 Apr 28
3
Return on nocapture pointer
Hi, I have a question about semantics of nocapture attribute: "This indicates that the callee does not make any copies of the pointer that outlive the callee itself. " Is returing a pointer considered outliving callee? For example is this code valid: define i8* @foo(i8* nocapture %p) ret i8* %p } The documentation also mention that &...
2012 Oct 08
3
[LLVMdev] Meaning of the nocapture attribute (possible bug?)
Regarding the nocapture attribute the language ref says: "the callee does not make any copies of the pointer that outlive the callee itself". >From I inferred that it is OK for the callee to make a copy of the pointer that doesn't outlive the call. However if I write some code that does this the opti...
2012 Oct 15
2
[LLVMdev] Meaning of the nocapture attribute (possible bug?)
Is this code valid? Function f takes a "nocapture" pointer p, and passes it to function g that does not have nocapture in its parameter list. There is nothing to stop g from "capturing" p. -Krzysztof On 10/8/2012 8:54 AM, Duncan Sands wrote: > Hi Richard, I think it is a bug. > > Ciao, Duncan. > > On 08/10/12 1...
2012 Oct 08
0
[LLVMdev] Meaning of the nocapture attribute (possible bug?)
Hi Richard, I think it is a bug. Ciao, Duncan. On 08/10/12 14:34, Richard Osborne wrote: > Regarding the nocapture attribute the language ref says: "the callee does not > make any copies of the pointer that outlive the callee itself". From I inferred > that it is OK for the callee to make a copy of the pointer that doesn't outlive > the call. However if I write some code that does this t...
2020 Jan 22
4
Inlining + CSE + restrict pointers == funtimes
...(see https://godbolt.org/z/-mdjPV): int called(int* __restrict__ a, int* b, int* c) { return *a + *b + *c; } int foo(int * x, int * y) { return *x + *y + called(x, x, y); } int bar(int * x, int * y) { return called(x, x, y) + *x + *y; } Which becomes: define dso_local i32 @called(i32* noalias nocapture readonly %0, i32* nocapture readonly %1, i32* nocapture readonly %2) local_unnamed_addr #0 ! dbg !7 { %4 = load i32, i32* %0, align 4, !dbg !19, !tbaa !20 %5 = load i32, i32* %1, align 4, !dbg !24, !tbaa !20 %6 = add nsw i32 %5, %4, !dbg !25 %7 = load i32, i32* %2, align 4, !dbg !26, !tbaa !20 %8...
2012 May 22
4
[LLVMdev] How to get llvm bitcode executed
...are void @__cxa_end_catch() declare void @__cxa_call_unexpected(i8*) declare void @_ZdlPv(i8*) nounwind declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn declare void @_ZSt17__throw_bad_allocv() noreturn declare noalias i8* @_Znwm(i64) declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind declare void @_ZSt20...
2013 May 21
4
[LLVMdev] malloc / free & memcpy optimisations.
The front end I'm building for an existing interpreted language is unfortunately producing output similar to this far too often; define void @foo(i8* nocapture %dest, i8* nocapture %src, i32 %len) nounwind { %1 = tail call noalias i8* @malloc(i32 %len) nounwind tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %src, i32 %len, i32 1, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %len, i32 1, i1 false) tail call voi...
2012 Oct 16
0
[LLVMdev] Meaning of the nocapture attribute (possible bug?)
Hi Krzysztof, > Is this code valid? yes, I think so. > Function f takes a "nocapture" pointer p, and passes it to function g that does > not have nocapture in its parameter list. There is nothing to stop g from > "capturing" p. It would be wrong for the optimizers to deduce a nocapture attribute for f in this context, as they don't know anything about th...
2018 Mar 22
2
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
...parameter. Instead the docs say to use the align <n> attribute. How is this supposed to work with different alignments? For example, I have one memcpy with align 4, align 4, and another with align 1, align 1. ; Function Attrs: argmemonly nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly align 4, i8* nocapture readonly align 4, i64, i1) #3 ; Function Attrs: argmemonly nounwind declare void @llvm.memcpy.p0i8.p0i8.i64.1(i8* nocapture writeonly align 1, i8* nocapture readonly align 1, i64, i1) #3 When I add these multiple definitions to the module, llvm mangles the name,...
2011 Mar 24
0
[LLVMdev] mblaze backend: unreachable executed
...oblem are the following: %196 = call %0 @_Z13gatherDiffuseRK3vecS_S1_RKfS3_Pii(%struct.vec* %normal, double %tmp629, float %174, %struct.vec* %light_position, float* %nohit, float* %epsilon, i32* %66, i32 %5) nounwind and define linkonce_odr %0 @_Z13gatherDiffuseRK3vecS_S1_RKfS3_Pii(%struct.vec* nocapture %normal, double %hit_point.0, float %hit_point.1, %struct.vec* nocapture %light_position, float* nocapture %nohit, float* nocapture %epsilon, i32* nocapture %stack, i32 %start_bvh) nounwind inlinehint ssp { which then goes into the body of the function. Josef
2011 Mar 15
3
[LLVMdev] mblaze backend: unreachable executed
>> I don't think my backend is modified enough from the MBlaze backend that is >> in the release to be causing this error. I am however looking through the >> various files of the backend to try to find where the calling convention >> might be causing problems with f32 data types. > Form the backtrace it seems like you haven't defined how to return f32 > stuff
2012 Oct 16
0
[LLVMdev] Meaning of the nocapture attribute (possible bug?)
Hi all, Are you sure that the problem here is with the nocapture flag and not with the noalias? Removing noalias from the function definition of @f results in the expected output. My guess is that something goes wrong in determining that *%q can be based on %p through @g which results in a 'no alias' relation for the two where there should be a ...
2020 Jun 28
2
__restirct ignored when including headers like <cmath>
...aders. For example, this code: void vec_add(int* __restrict a, int* __restrict b, int n) { #pragma unroll 4 for(int i=0; i<n; ++i) { a[i] += b[i]; } } results in: ; Function Attrs: nofree norecurse nounwind define dso_local void @_Z7vec_addPiS_i(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32 %n) local_unnam ed_addr #0 { entry: . . ... (note the noaliass before function arguments). But this code: #include <cmath> void vec_add(int* __restrict a, int* __restrict b, int n) { #pragma unroll 4 for(int i=...
2014 Jul 10
2
[LLVMdev] Telling the optimizer a value is always null at the start
...yout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" target triple = "i686-pc-windows-msvc" @str1 = linkonce_odr unnamed_addr constant [3 x i8] c"go\00", align 1 @str2 = linkonce_odr unnamed_addr constant [5 x i8] c"done\00", align 1 define void @inlineeh(i8** nocapture readnone %ex) { %1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @str1, i32 0, i32 0)) ret void } declare i32 @printf(i8* nocapture readonly, ...) #0 define void @testeh(i8** nocapture %ex) #0 { %1 = bitcast i8** %ex to i8* %2 = tail call {}* @llvm...
2012 May 22
0
[LLVMdev] How to get llvm bitcode executed
...t; declare void @__cxa_call_unexpected(i8*) > declare void @_ZdlPv(i8*) nounwind > declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn > declare void @_ZSt17__throw_bad_allocv() noreturn > declare noalias i8* @_Znwm(i64) > declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind > declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind > declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind > declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind >...
2018 Mar 22
0
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
...use the align <n> attribute. How is this supposed to > work with different alignments? > > For example, I have one memcpy with align 4, align 4, and another with > align 1, align 1. > > ; Function Attrs: argmemonly nounwind > declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly align > 4, i8* nocapture readonly align 4, i64, i1) #3 > > ; Function Attrs: argmemonly nounwind > declare void @llvm.memcpy.p0i8.p0i8.i64.1(i8* nocapture writeonly > align 1, i8* nocapture readonly align 1, i64, i1) #3 > > > When I add these multiple definition...
2017 Apr 26
1
Function LICM for readonly, nocapture functions
...eturn B[0]+B[N-1]; } Among other optimizations that I may want to happen, I'd hope that the call to strlen could be moved outside the loop via LICM. Unfortunately, this is not the case. Looking at the IR I found the following. The function strlen is marked readonly and the argument is marked nocapture. ; Function Attrs: nounwind readonly declare i64 @strlen(i8* nocapture) local_unnamed_addr #2 attributes #2 = { nounwind readonly ... } Presumably this should be enough to permit LICM to move it out of the loop. Upon a further investigation, the issue appeared to be that canSinkOrHoistInst di...