search for: argmemon

Displaying 20 results from an estimated 93 matches for "argmemon".

Did you mean: argmemonly
2020 Jul 11
3
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
Hi all, Let's see an example (from Alexandre Isoard) first: **************************************************************************************** ; RUN: opt -ipsccp -deadargelim -licm -O2 -S < %s @g = internal global i32 0 ; Function Attrs: argmemonly define internal void @foo(i32* nonnull dereferenceable(4) %arg, i32 %val) #0 { entry: store i32 %val, i32* %arg ret void } define i32 @bar(i32 %n) { entry: store i32 1, i32* @g br label %loop loop: ; preds = %bb1, %bb %i = phi i32 [ %i.inc...
2020 Jul 14
3
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
...gt; Hi all, > > Let's see an example (from Alexandre Isoard) first: > > **************************************************************************************** > ; RUN: opt -ipsccp -deadargelim -licm -O2 -S < %s > > @g = internal global i32 0 > > ; Function Attrs: argmemonly > define internal void @foo(i32* nonnull dereferenceable(4) %arg, i32 %val > ) #0 { > entry: > store i32 %val, i32* %arg > ret void > } > > define i32 @bar(i32 %n) { > entry: > store i32 1, i32* @g > br label %loop > > loop:...
2015 Dec 09
5
RFC: New function attribute HasInaccessibleState
...Maybe GlobalsAA and/or a GlobalsAA-centric attribution pass could partition writes as: 1. Stores to local allocas 2. Stores through pointer parameters 3. Stores to globals defined in this compilation unit 4. Other Attributing functions with attributes: readonly: only writes of type 1 argmemonly: only writes of type 1/2 almost-readonly: only writes of type 1/4 almost-argmemonly: only writes of type 1/2/4 and when visiting a call instruction to determine what sort of writes it entails: - calls to almost-readonly functions and almost-argmemonly functions imply a write of type 4 -...
2020 Jul 15
2
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
...exandre Isoard) first: >>> **************************************************************************************** >>>     ; RUN: opt -ipsccp -deadargelim -licm -O2 -S < %s >>> >>>     @g = internal global i32 0 >>> >>>     ; Function Attrs: argmemonly >>>     define internal void @foo(i32* nonnull dereferenceable(4) %arg, >>>     i32 %val) #0 { >>>     entry: >>>       store i32 %val, i32* %arg >>>       ret void >>>     } >>> >>>     define i32 @bar(i32 %n) { >>>...
2016 Mar 21
3
New intrinsic property IntrOnlyWrite
...se places to use the new > mechanism. This could be separate changes, but should be considered > required as part of adding the new property. That makes a lot of sense. > Another way you might consider slicing the problem is to introduce a > WriteOnlyArg property. When combined with ArgMemOnly, this would more > precisely model the pseudo store (right?) and is a better fit for the > memset/memcpy use case already handled in BasicAA. This is unsufficient for our use case. Let me try to explain with an example (also for your later comments). We have an intrinsic declare void @ll...
2016 Mar 22
0
New intrinsic property IntrOnlyWrite
...> mechanism. This could be separate changes, but should be considered >> required as part of adding the new property. > > That makes a lot of sense. > >> Another way you might consider slicing the problem is to introduce a >> WriteOnlyArg property. When combined with ArgMemOnly, this would more >> precisely model the pseudo store (right?) and is a better fit for the >> memset/memcpy use case already handled in BasicAA. > > This is unsufficient for our use case. Let me try to explain with an > example (also for your later comments). We have an intri...
2015 Dec 08
3
RFC: New function attribute HasInaccessibleState
...hey're: 1. a store to a local alloca 2. a store to a global defined in this compilation unit 3. a store through a pointer parameter 4. a call to a function that it has inferred is "ReadOnly-like" (or that is actually readonly) 5. a call to a function that it has inferred is "ArgMemOnly-like" (or that is actually argmemonly) 6. other so that: - if it gets through a function and all modifications are of type 1, 2, or 4, it could summarize that function as "ReadOnly-like"; it could report two calls to "ReadOnly-like" functions as not aliasing in their wr...
2015 Dec 14
2
RFC: New function attribute HasInaccessibleState
...e "HasInaccessibleState" to denote "this function might access globals, but none of these > globals can alias with any memory location accessible from the IR being optimized". > 2. Mark malloc/free as (HasInaccessibleState, ReadNone) and printf as (HasInaccessibleState, ArgMemOnly) ... (similarly > other libc functions). You'll have to mark free as argmemonly + read-write, since the following transform needs to be illegal: val = *ptr free(ptr) => free(ptr) val = *ptr In fact, I think you can mark @free as argmemonly *today* without any problems....
2018 Mar 22
2
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
The new @llvm.memcpy API does not have an 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...
2016 Mar 24
0
attribute of intrinsic function
...nction Attrs: nounwind > define void @_Z3fooPi(i8* %a) #0 { > call void @llvm.foo5(i8* %a) > call void @llvm.foo5(i8* %a) > ret void > } > ; Function Attrs: nounwind > declare void @llvm.foo5(i8*) #0 > attributes #0 = { nounwind } I'd expect foo4 to have the "argmemonly" attribute. How did you generate this IR? If you round-trip to bitcode, what happens? I expect the attribute to be added. -- Mehdi > > > /****** the intrinsic function foo6 is used******/ > ; Function Attrs: nounwind > define void @_Z3fooPi(i8* %a) #0 { > call void...
2016 Jan 04
3
Can someone give me some pointer on alias analysis ?
...ific suggestions for how to refine the semantics, please make them. Getting the details right is always the hard part. :) > > You might also consider using a variant of your allocation function which takes a pointer to the global state it needs to modify. Doing this would allow you to use argmemonly to restrict the aliasing while still allowing whole program optimization. I haven't tried this in practice, but it seems like it would probably work... > > I do not wish to make suggestion before I understand where this is coming from. So far, from what I've collected, use cases a...
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...pilation. Such a flag could be added to most libc/system calls such as printf/malloc/free. (libc and system calls do access/modify internal variables such as errno). Example attributes (in addition to what are already set): malloc/free: HasInaccessibleState, ReadNone printf: HasInaccessibleState, ArgMemOnly realloc: HasInaccessibleState, ReadOnly (not sure). The intention behind introducing this attribute is to relax the conditions in GlobalsAA as below: (this code is in GlobalsAAResult::AnalyzeCallGraph) if (F->isDeclaration()) { // Try to get mod/ref behaviour from function at...
2016 Mar 24
4
attribute of intrinsic function
Hi, When I define an intrinsic function with memory write permission, my assumption is that we can either attach [IntrReadWriteArgMem] or [] to the intrinsic function. Based on the comment of the source code , "IntrReadWriteArgMem - This intrinsic reads and writes only from memory that one of its arguments points to, but may access an unspecified amount." "If no property is set,
2016 Nov 25
2
Translation of custom attribute (defined for variables) from clang to llvm
...i32* %1 to i8* call void @llvm.lifetime.start(i64 4, i8* %2) store volatile i32 5, i32* %1, align 4 %3 = load volatile i32, i32* %1, align 4 %4 = load volatile i32, i32* %1, align 4 %5 = add i32 %4, %3 call void @llvm.lifetime.end(i64 4, i8* %2) ret i32 %5 } ; Function Attrs: argmemonly nounwind declare void @llvm.lifetime.start(i64, i8* nocapture) #1 ; Function Attrs: argmemonly nounwind declare void @llvm.lifetime.end(i64, i8* nocapture) #1 attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-f...
2015 Dec 04
4
RFC: New function attribute HasInaccessibleState
...be added to most libc/system calls such as > printf/malloc/free. (libc and system calls do access/modify internal > variables such as errno). > > Example attributes (in addition to what are already set): > malloc/free: HasInaccessibleState, ReadNone > printf: HasInaccessibleState, ArgMemOnly > realloc: HasInaccessibleState, ReadOnly (not sure). > > The intention behind introducing this attribute is to relax the conditions > in GlobalsAA as below: > (this code is in GlobalsAAResult::AnalyzeCallGraph) > > if (F->isDeclaration()) { > // Try to...
2018 Mar 22
0
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
...I does not have an 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 ali...
2018 Nov 29
2
AliasAnalysis does not look though a memcpy
...%1 = bitcast i32** %var.addr to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %0, i8* align 8 %1, i64 8, i1 false) ; Load a copy of `var' %var.tmp = load i32*, i32** %var.addr.tmp %should.be.42 = load i32, i32* %var.tmp ret void } ; Function Attrs: argmemonly nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1 attributes #1 = { argmemonly nounwind } I run it with opt, and get the following: $ opt -basicaa -print-alias-sets memcpy.ll -disable-output Alias sets for function '...
2015 Dec 11
3
RFC: New function attribute HasInaccessibleState
...accessibleState > > Yeah, I'd agree (rewording slightly) that "state which is only > modified by external code" is well-defined (and likely to be in the > "other" bucket of any individual analysis). I do, as other have, > find it odd to redefine readonly and argmemonly in terms of this and > require its propagation up the call graph, as opposed to introducing > new "writes only external" and "writes only arg and external" > attributes. As I stated in some other e-mail, I'm against adding this as a "subtractive" attrib...
2016 Mar 19
4
New intrinsic property IntrOnlyWrite
Hi, I'd like to draw your attention to http://reviews.llvm.org/D18291, in which I propose a new intrinsic property for intrinsics that are lowered to instructions that mayStore, but are neither mayLoad nor hasSideEffects. This is relevant for AMDGPU, where we have store instructions that don't operate on pointers. The codegen backend understands these perfectly well as stores, and so
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...gt;> printf/malloc/free. (libc and system calls do access/modify internal >>> variables such as errno). >>> >>> Example attributes (in addition to what are already set): >>> malloc/free: HasInaccessibleState, ReadNone >>> printf: HasInaccessibleState, ArgMemOnly >>> realloc: HasInaccessibleState, ReadOnly (not sure). >>> >>> The intention behind introducing this attribute is to relax the >>> conditions in GlobalsAA as below: >>> (this code is in GlobalsAAResult::AnalyzeCallGraph) >>> >>>...