search for: readnon

Displaying 20 results from an estimated 720 matches for "readnon".

Did you mean: readnone
2007 Nov 23
3
[LLVMdev] Getting rid of the DoesntAccessMemoryFns and OnlyReadsMemoryFns tables
...While gcc mostly agrees with them, there are the following differences (using -ffast-math, otherwise gcc says that a bunch of math ones are readonly because they depend on the floating point mode; I think gcc is correct to say this): function LLVM says gcc says -------- --------- -------- isalnum readnone readonly isalpha readnone readonly iscntrl readnone readonly isgraph readnone readonly islower readnone readonly isprint readnone readonly ispunct readnone readonly isspace readnone readonly isupper readnone readonly tolower readnone readonly toupper readnone readonly iswalnum readnone r...
2014 May 23
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
On 23 May 2014 09:42, Robert Lougher <rob.lougher at gmail.com> wrote: > Hi Nick, > > Thanks for replying. Bug filed: > http://llvm.org/bugs/show_bug.cgi?id=19842 Thank you! Strangely enough, my first conclusion was that %p was being marked > readnone incorrectly as it wasn't handling the copy via @get_addr. > Sorry -- saying %p alone is ambiguous because there's the %p parameter of @get_pntr and the %p parameter of @store. It is correct to mark %p readnone in @get_pntr. From function entrance to exit, it does not write to the point...
2014 May 23
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
Confirmed, this is a bug. This define i32* @get_pntr(i32* %p) nounwind uwtable { entry: ret i32* %p } define void @store(i32* %p) noinline nounwind uwtable { entry: %call = call i32* @get_pntr(i32* %p) store i32 10, i32* %call, align 4 ret void } run through opt -functionattrs gets a 'readnone' on @store's %p. That's wrong, it clearly stores to it. The bug is due to incorrectly handling the copy of the pointer made by @get_pntr, because @get_pntr itself is marked 'readnone'. Please file a bug. Nick On 22 May 2014 08:15, Robert Lougher <rob.lougher at gmail.co...
2014 May 22
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
On 05/21/2014 02:52 PM, Robert Lougher wrote: > On 21 May 2014 21:40, Robert Lougher <rob.lougher at gmail.com> wrote: >> define i32* @get_pntr(i32* readnone %p) { >> entry: >> ret i32* %p >> } >> >> define void @store(i32* nocapture readnone %p) { >> entry: >> store i32 10, i32* %p, align 4, !tbaa !1 >> ret void >> } >> > Further to my first post, based on the definition of readno...
2014 May 21
4
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
...amp;i); return i; } ----------------------------- If this is compiled in two steps as follows: clang -O1 -emit-llvm test.c -c -o test.bc opt -basicaa -inline -functionattrs -gvn -S test.bc We get the following IR: -------------------------------------------------- define i32* @get_pntr(i32* readnone %p) { entry: ret i32* %p } define void @store(i32* nocapture readnone %p) { entry: store i32 10, i32* %p, align 4, !tbaa !1 ret void } define i32 @test() { entry: %i = alloca i32, align 4 call void @store(i32* %i) ret i32 undef } -------------------------------------------------- As...
2017 Jan 05
3
RFC: Allow readnone and readonly functions to throw exceptions
...ote: > Hi Hal, > > On Thu, Jan 5, 2017 at 6:12 AM, Hal Finkel <hfinkel at anl.gov> wrote: >> On 01/04/2017 10:35 PM, Sanjoy Das via llvm-dev wrote: >>> I just realized that there's an annoying corner case to this scheme -- >>> I can't DSE stores across readnone maythrow function calls because the >>> exception handler could read memory. That is, in: >>> >>> try { >>> *a = 10; >>> call void @readnone_mayunwind_fn(); >>> *a = 20; >>> } catch (...) { >>> assert(*a == 10)...
2017 Jan 05
6
RFC: Allow readnone and readonly functions to throw exceptions
...<mailto:hfinkel at anl.gov>> wrote: > > On 01/04/2017 10:35 PM, Sanjoy Das via llvm-dev wrote: > > I just realized that there's an annoying corner case > to this scheme -- > I can't DSE stores across readnone maythrow function > calls because the > exception handler could read memory. That is, in: > > try { > *a = 10; > call void @readnone_mayunwind_fn(); > *a = 20; >...
2017 Jan 05
3
RFC: Allow readnone and readonly functions to throw exceptions
...I think it would > severely limit our ability to infer these attributes for functions > that unwind. You'd need to prove things -- likely unknowable > things -- about the exception handlers in place around every call > site of a function in order to mark it readonly, readnone, etc. > We'd have the same problem with the attribute parameters. I'm > fairly certain we do need and want to separate these concerns. > This way we can apply callsite specific reasoning to the potential > effects of exception handlers separate from what the fun...
2017 Jan 03
4
RFC: Allow readnone and readonly functions to throw exceptions
LLVM today does not clearly specify if a function specified to not write to memory (i.e. readonly or readnone) is allowed to throw exceptions. LangRef is ambiguous on this issue. The normative statement is "[readnone/readonly functions] cannot unwind exceptions by calling the C++ exception throwing methods" which does not decide an answer for non C++ languages. It used to say (h/t Daniel Berl...
2012 Jun 20
3
[LLVMdev] Readnone/Readonly Function Attributes and Optimization
Dear All, Are functions marked as readnone or readonly in the LLVM IR allowed to generate output or to exhibit exceptional behavior (e.g., calling abort(), generating an MMU fault, etc.)? The SAFECode compiler has a set of run-time checks that pass or fail based solely on the input arguments and, in some cases, global state. They do...
2012 Jun 21
0
[LLVMdev] Readnone/Readonly Function Attributes and Optimization
Hi John, > Are functions marked as readnone or readonly in the LLVM IR allowed to > generate output or to exhibit exceptional behavior (e.g., calling > abort(), generating an MMU fault, etc.)? they are allowed to unwind exceptions for example, since in theory this can occur without scrunching externally visible memory (for example un...
2012 Jun 21
1
[LLVMdev] Readnone/Readonly Function Attributes and Optimization
On 6/21/12 2:23 AM, Duncan Sands wrote: > Hi John, > >> Are functions marked as readnone or readonly in the LLVM IR allowed to >> generate output or to exhibit exceptional behavior (e.g., calling >> abort(), generating an MMU fault, etc.)? > they are allowed to unwind exceptions for example, since in theory this > can occur without scrunching externally visible memor...
2017 Jan 05
2
RFC: Allow readnone and readonly functions to throw exceptions
...: >>> >>> On 01/04/2017 10:35 PM, Sanjoy Das via llvm-dev wrote: >>> >>> I just realized that there's an annoying corner case >>> to this scheme -- >>> I can't DSE stores across readnone maythrow function >>> calls because the >>> exception handler could read memory. That is, in: >>> >>> try { >>> *a = 10; >>> call void @readnone_mayunwind_f...
2017 Jan 05
2
RFC: Allow readnone and readonly functions to throw exceptions
...lvm-dev > <llvm-dev at lists.llvm.org> wrote: >> It is still only a function of its arguments, so it can be CSE'd. > That's a good example -- we can CSE it without worrying about the > memory state flowing in. > > In fact, if we have: > > *a = 10; > call @readnone_may_unwind() > *a = 20; > call @readnone_may_unwind() > *a = 30; > > then we can first transform this to: > > *a = 10; > call @readnone_may_unwind() > *a = 20; > call @readnone_may_unwind() nounwind // only on this call (since we > returned normally) > *a = 30;...
2009 Jul 24
0
[LLVMdev] setOnlyReadsMemory / setDoesNotAccessMemory
...meaning of the flags > these two methods set on a function, and whether they are useful or not for > LLVM to perform optimizations (and if they are, what optimization pass makes > use of them). > If you think of there being a "world" of state and recorded side-effects, a readnone function completely ignores the world, whereas a readonly function can depend on the current state of the world, but can't modify it. Calls to readnone functions are arbitrarily re-orderable (and hence redundant calls can always be joined), but calls to readonly functions can't be re-o...
2009 Oct 05
5
[LLVMdev] Functions: sret and readnone
...L for a computer graphics project that is not unlike NVIDIA's Cg. I have an intrinsic with the following signature float4 sample(texture tex, float2 coords); that is translated to this LLVM IR code: declare void @"sample"(%float4* noalias nocapture sret, %texture, $float2) nounwind readnone The type float4 is basically an array of four floats, which cannot be returned directly on an x86 using the traditional calling conventions but only via the sret mechanism. You might already have spotted that "readnone" attribute, which is causing some problems: The GVN optimization pa...
2011 Jun 01
4
[LLVMdev] AVX Status?
...nfused about mask code as e.g. produced by VCMPPS together with mask operations (which LLVM requires to work on <8 x i32> atm) and corresponding bitcasts. Consider these two examples: define <8 x float> @test1(<8 x float> %a, <8 x float> %b, <8 x i32> %m) nounwind readnone { entry: %cmp = tail call <8 x float> @llvm.x86.avx.cmp.ps.256(<8 x float> %a, <8 x float> %b, i8 1) nounwind readnone %res = tail call <8 x float> @llvm.x86.avx.blendv.ps.256(<8 x float> %a, <8 x float> %b, <8 x float> %cmp) nounwind readnone r...
2009 Jul 24
3
[LLVMdev] setOnlyReadsMemory / setDoesNotAccessMemory
Hello, I'm in a situation where my code is calling many native functions. Sometimes, these calls are simply calls to static "accessor" methods that read a variable in some class object (object pointer as input, member variable value returned as output). I was wondering if using the setOnlyReadsMemory method on the native function objects could help LLVM generate optimized code
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
>but is there or is there not accessible, visible state, Wouldn't ReadNone and/or ReadOnly cover that? If ReadNone is set, it means it doesn't access any of the visible (accessible) states. - Vaivaswatha On Fri, Dec 4, 2015 at 3:17 PM, James Molloy <james at jamesmolloy.co.uk> wrote: > Hi, > > I don't think the attribute as is is strong enough...
2017 Jan 05
2
RFC: Allow readnone and readonly functions to throw exceptions
On 01/04/2017 10:35 PM, Sanjoy Das via llvm-dev wrote: > I just realized that there's an annoying corner case to this scheme -- > I can't DSE stores across readnone maythrow function calls because the > exception handler could read memory. That is, in: > > try { > *a = 10; > call void @readnone_mayunwind_fn(); > *a = 20; > } catch (...) { > assert(*a == 10); > } > > I can't DSE the `*a = 10` store. > > As...