Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Readnone/Readonly Function Attributes and Optimization"
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 unwinding
can be done by having functions return an
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 memory
2017 Jan 05
3
RFC: Allow readnone and readonly functions to throw exceptions
On 01/05/2017 10:55 AM, Sanjoy Das wrote:
> 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
>>>
2017 Jan 05
6
RFC: Allow readnone and readonly functions to throw exceptions
On 01/05/2017 12:17 PM, Reid Kleckner wrote:
> On Thu, Jan 5, 2017 at 9:19 AM, Hal Finkel via llvm-dev
> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>
>
> On 01/05/2017 10:55 AM, Sanjoy Das wrote:
>
> Hi Hal,
>
> On Thu, Jan 5, 2017 at 6:12 AM, Hal Finkel <hfinkel at anl.gov
> <mailto:hfinkel
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
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 (...) {
>
2017 Jan 05
2
RFC: Allow readnone and readonly functions to throw exceptions
On 01/05/2017 01:20 PM, Sanjoy Das wrote:
> Hi Hal,
>
> On Thu, Jan 5, 2017 at 11:10 AM, Hal Finkel via llvm-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 =
2017 Jan 05
3
RFC: Allow readnone and readonly functions to throw exceptions
On 01/05/2017 03:10 PM, Reid Kleckner wrote:
> On Thu, Jan 5, 2017 at 10:39 AM, Hal Finkel <hfinkel at anl.gov
> <mailto:hfinkel at anl.gov>> wrote:
>
> I don't understand why that's desirable, and I think it would
> severely limit our ability to infer these attributes for functions
> that unwind. You'd need to prove things -- likely
2017 Jan 05
2
RFC: Allow readnone and readonly functions to throw exceptions
On 01/05/2017 12:45 PM, Mehdi Amini wrote:
>
>> On Jan 5, 2017, at 10:39 AM, Hal Finkel via llvm-dev
>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>
>>
>> On 01/05/2017 12:17 PM, Reid Kleckner wrote:
>>> On Thu, Jan 5, 2017 at 9:19 AM, Hal Finkel via llvm-dev
>>> <llvm-dev at lists.llvm.org
2017 Jan 03
3
RFC: Allow readnone and readonly functions to throw exceptions
On Tue, Jan 3, 2017 at 10:47 AM, Michael Kuperstein via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
>
> On Tue, Jan 3, 2017 at 9:59 AM, Sanjoy Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi Michael,
>>
>> On Mon, Jan 2, 2017 at 11:49 PM, Michael Kuperstein
>> <michael.kuperstein at gmail.com> wrote:
>> > This
2017 Jan 03
2
RFC: Allow readnone and readonly functions to throw exceptions
Hi Michael,
On Mon, Jan 2, 2017 at 11:49 PM, Michael Kuperstein
<michael.kuperstein at gmail.com> wrote:
> This sounds right to me.
>
> IIUC, historically, readonly and readnone are meant to model the "pure" and
> "const" GCC attributes. These attributes make pretty strong guarantees:
>
> "[a pure] function can be subject to common subexpression
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
2012 May 25
3
[LLVMdev] alloc_size metadata
On Fri, 25 May 2012 17:43:52 +0200
Duncan Sands <baldrick at free.fr> wrote:
> Hi John,
>
> On 25/05/12 17:22, John Criswell wrote:
> > On 5/25/12 2:16 AM, Duncan Sands wrote:
> >> Hi John,
> >>
> >>>>> I'm implementing the alloc_size function attribute in clang.
> >>>> does anyone actually use this attribute? And if
2009 Jul 24
0
[LLVMdev] setOnlyReadsMemory / setDoesNotAccessMemory
Nyx wrote:
> 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
2012 May 29
0
[LLVMdev] alloc_size metadata
>> On 25/05/12 17:22, John Criswell wrote:
>> > On 5/25/12 2:16 AM, Duncan Sands wrote:
>> >> Hi John,
>> >>
>> >>>>> I'm implementing the alloc_size function attribute in clang.
>> >>>> does anyone actually use this attribute? And if they do, can it
>> >>>> really buy them anything? How about
2014 Jan 24
2
[LLVMdev] Removing ReadOnly from math intrinsics
In include/llvm/IR/Intrinsics.td there is code to mark sqrt and several
other math intrinsics as "ReadOnly", even though they do not read memory.
According to the comments this was done as an attempt to model changes to
the FP rounding mode. This is too conservative, and unnecessarily blocks
transformations such as commoning and vectorization.
I have heard from others that FP
2011 Sep 10
2
[LLVMdev] readnone
If a function accesses a global constant array of constants--in my case
a constant array of function pointers, and does NOT reference this
array via a function argument (it instead directly references this global),
is this enough to disallow the application of the readnone attribute to the
function in question?
Thanks in advance
Garrison
2014 Jan 25
2
[LLVMdev] Removing ReadOnly from math intrinsics
On Fri, Jan 24, 2014 at 4:17 PM, Philip Reames <listmail at philipreames.com>wrote:
> On 1/24/14 3:52 PM, Raul Silvera wrote:
>
> In include/llvm/IR/Intrinsics.td there is code to mark sqrt and several
> other math intrinsics as "ReadOnly", even though they do not read memory.
>
> According to the comments this was done as an attempt to model changes
> to
2009 Oct 05
5
[LLVMdev] Functions: sret and readnone
Hi all,
I'm currently building a DSL 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
2011 Sep 10
2
[LLVMdev] readnone
Nick Lewycky wrote:
> I was sure that I remember "opt -functionattrs" being taught to do this,
> but I just tried it out and it doesn't. This is a missed optz'n
> opportunity, testcase:
>
> @x = constant i32 0
> define void @foo() {
> load i32* @x
> ret void
> }
>
> is only marked readonly when it should be readnone. Could