search for: nofree

Displaying 20 results from an estimated 22 matches for "nofree".

Did you mean: nonfree
2018 Jul 11
8
[RFC] A nofree (and nosynch) function attribute: Mixing dereferenceable and delete
Hi, everyone, I'd like to propose adding a nofree function attribute to indicate that a function does not, directly or indirectly, call a memory-deallocation function (e.g., free, C++'s operator delete). Clang/LLVM can currently misoptimize functions that:  1. Have a reference argument.  2. Free the memory backing the object to which the ref...
2018 Jul 11
3
[RFC] A nofree (and nosynch) function attribute: Mixing dereferenceable and delete
...9;t think we have a bug along these lines), and I'd at least smell the need for a sanitizer. > > -- Sanjoy > On Tue, Jul 10, 2018 at 7:01 PM Hal Finkel via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Hi, everyone, >> >> I'd like to propose adding a nofree function attribute to indicate that >> a function does not, directly or indirectly, call a memory-deallocation >> function (e.g., free, C++'s operator delete). Clang/LLVM can currently >> misoptimize functions that: >> >> 1. Have a reference argument. >> &gt...
2018 Jul 12
2
[RFC] A nofree (and nosynch) function attribute: Mixing dereferenceable and delete
Thanks, Richard. Based on the feedback from this thread, I'll move forward with the patches for nofree, nosync, adding a new corresponding dereferenceable attribute (my suggestion is to name this dereferenceable_on_entry; suggestions welcome), and updating Clang is emit this new attribute instead of the current one.  -Hal On 07/11/2018 06:43 PM, Richard Smith wrote: > On Wed, 11 Jul 2018 at 16:...
2020 Jul 11
3
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
...loop (as the value of @g isn't changed, but it is changed), and will cause function return wrong constant value '1', instead of '%n' (the correct value) , like following: **************************************************************************************** ; Function Attrs: nofree norecurse nounwind writeonly define i32 @bar(i32 %n) local_unnamed_addr #0 { entry: ret i32 1 } attributes #0 = { nofree norecurse nounwind writeonly } **************************************************************************************** And if remove the 'argmemonly' attribute, fun...
2020 Jul 14
3
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
...g isn't changed, but it > is changed), and will cause function return wrong constant value '1', > instead of '%n' (the correct value) , like following: > **************************************************************************************** > > ; Function Attrs: nofree norecurse nounwind writeonly > define i32 @bar(i32 %n) local_unnamed_addr #0 { > entry: > ret i32 1 > } > > attributes #0 = { nofree norecurse nounwind writeonly } > **************************************************************************************** > > > And if...
2020 Jun 28
2
__restirct ignored when including headers like <cmath>
...ge behaviour in which Clang ignores __restirct when I include some standard headers. 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,...
2020 Jun 24
4
[RFC] `opt-out` attribute list for intrinsics
Hi all, A while back we started annotating intrinsics with new attributes ( https://reviews.llvm.org/D65377) After some discussion it was decided it would be good to have an `opt-out` attribute list for intrinsics. Some attributes that can be added to the list could be: nosync, nofree, nounwind, willreturn For now, there are 2 approaches: 1. Filtering opt-out attributes in tablegen source ( https://reviews.llvm.org/D70365) 2. Having tablegen handle opt-out list ( https://reviews.llvm.org/D70365?id=229732) How do people feel about these approaches? Is any of the tw...
2020 Jul 15
2
Bug in pass 'ipsccp' on function attribute 'argmemonly'?
...use >>>     function return wrong constant value '1', instead of '%n' (the >>>     correct value) , like following: >>> **************************************************************************************** >>> >>>     ; Function Attrs: nofree norecurse nounwind writeonly >>>     define i32 @bar(i32 %n) local_unnamed_addr #0 { >>>     entry: >>>     ret i32 1 >>>     } >>> >>>     attributes #0 = { nofree norecurse nounwind writeonly } >>> ************************************...
2019 Aug 08
2
Suboptimal code generated by clang+llc in quite a common scenario (?)
...ot deeper and found that at least the x86 is affected as well. This is the referred code: char pp[3]; char *scscx = pp; int tst( char i, char j, char k ) { scscx[0] = i; scscx[1] = j; scscx[2] = k; return 0; } The above gets compiled for the x86 architecture like this: ; Function Attrs: nofree norecurse nounwind optsize uwtable define i32 @tst(i8 signext %i, i8 signext %j, i8 signext %k) local_unnamed_addr #1 { entry: %0 = load i8*, i8** @scscx, align 8, !tbaa !11 store i8 %i, i8* %0, align 1, !tbaa !13 %1 = load i8*, i8** @scscx, align 8, !tbaa !11 %arrayidx1 = getelementptr inb...
2020 Jul 16
2
LLVM 11 and trunk selecting 4 wide instead of 8 wide loop vectorization for AVX-enabled target
...ame = "main" target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc-coff" %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0" = type { float*, i32, [4 x i8] } ; Function Attrs: nofree define dllexport void @func(float* noalias nocapture %output, %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0"* nocapture nonnull readonly dereferenceable(16) %a, %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0"* nocapture nonnull readonly dereferenceable(16) %b) loc...
2020 Jul 16
2
LLVM 11 and trunk selecting 4 wide instead of 8 wide loop vectorization for AVX-enabled target
...:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" >> target triple = "x86_64-pc-windows-msvc-coff" >> >> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0" = type { float*, >> i32, [4 x i8] } >> >> ; Function Attrs: nofree >> define dllexport void @func(float* noalias nocapture %output, >> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0"* nocapture nonnull >> readonly dereferenceable(16) %a, >> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0"* nocapture nonnull...
2020 Jul 16
4
LLVM 11 and trunk selecting 4 wide instead of 8 wide loop vectorization for AVX-enabled target
...28-n8:16:32:64-S128" >>>> target triple = "x86_64-pc-windows-msvc-coff" >>>> >>>> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0" = type { float*, >>>> i32, [4 x i8] } >>>> >>>> ; Function Attrs: nofree >>>> define dllexport void @func(float* noalias nocapture %output, >>>> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPointer.0"* nocapture nonnull >>>> readonly dereferenceable(16) %a, >>>> %"Burst.Compiler.IL.Tests.VectorsMaths/FloatPoi...
2020 Feb 27
2
TBAA for struct fields
...'foo': Alias Set Tracker: 2 alias sets for 2 pointer values. AliasSet[0x563d8f6a8bd0, 1] must alias, Mod Pointers: (i32* %f2, LocationSize::precise(4)) AliasSet[0x563d8f6bc080, 1] must alias, Mod Pointers: (float* %f1, LocationSize::precise(4)) IR of foo: ; Function Attrs: nofree norecurse nounwind uwtable writeonly define dso_local void @foo(%struct.P* nocapture %p1, %struct.P* nocapture %p2) local_unnamed_addr #0 { entry: %f2 = getelementptr inbounds %struct.P, %struct.P* %p1, i64 0, i32 1 store float 0x3FF3333340000000, float* %f2, align 4, !tbaa !2 %f1 = getelemen...
2019 Nov 28
2
SLP example not being vectorized
...1;   A[1] = a2*(a2 + b2)/b2 + 50*b2/a2; } $ clang -emit-llvm -S -O3 arraysum.c -o - ; ModuleID = 'arraysum.c' source_filename = "arraysum.c" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-generic-linux" ; Function Attrs: nofree norecurse nounwind uwtable writeonly define dso_local void @foo(i32, i32, i32, i32, i32* nocapture) local_unnamed_addr #0 {   %6 = add nsw i32 %2, %0   %7 = mul nsw i32 %6, %0   %8 = sdiv i32 %7, %2   %9 = mul nsw i32 %2, 50   %10 = sdiv i32 %9, %0   %11 = add nsw i32 %10, %8   store i32 %1...
2019 Aug 26
2
SCEV related question
Here is original C code: void topup(int a[], unsigned long i) { for (; i < 16; i++) { a[i] = 1; } } Here is the IR before the pass where I expect SCEV to return trip-count value ; Function Attrs: nofree norecurse nounwind uwtable writeonly define dso_local void @topup(i32* nocapture %a, i64 %i) local_unnamed_addr #0 { entry: %cmp3 = icmp ult i64 %i, 16 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry br label %fo...
2019 Aug 08
3
Suboptimal code generated by clang+llc in quite a common scenario (?)
...*scscx = pp; > > int tst( char i, char j, char k ) > > { > > scscx[0] = i; > > scscx[1] = j; > > scscx[2] = k; > > return 0; > > } > > > > The above gets compiled for the x86 architecture like this: > > > > ; Function Attrs: nofree norecurse nounwind optsize uwtable > > define i32 @tst(i8 signext %i, i8 signext %j, i8 signext %k) > local_unnamed_addr #1 { > > entry: > > %0 = load i8*, i8** @scscx, align 8, !tbaa !11 > > store i8 %i, i8* %0, align 1, !tbaa !13 > > %1 = load i8*, i8** @scs...
2019 Oct 01
2
Proposal for llvm.experimental.gc intrinsics for inttoptr and ptrtoint
...oMem annotation suggested: this states that the instruction has no side-effects, but if you expect the value to resume being tracked by the gc, that would imply these instructions do have some sort of observable side effects on memory (possibly ReadOnly, as well as perhaps the absence of nosync and nofree). On Mon, Sep 30, 2019 at 8:35 PM Sanjoy Das via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Adding some folks from Azul. > > On Mon, Sep 30, 2019 at 4:00 PM Jake Ehrlich via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi All, >> >> I'...
2020 Mar 03
2
TBAA for struct fields
...o': Alias Set Tracker: 2 alias sets for 2 pointer values. AliasSet[0x563d8f6a8bd0, 1] must alias, Mod Pointers: (i32* %f2, LocationSize::precise(4)) AliasSet[0x563d8f6bc080, 1] must alias, Mod Pointers: (float* %f1, LocationSize::precise(4)) IR of foo: ; Function Attrs: nofree norecurse nounwind uwtable writeonly define dso_local void @foo(%struct.P* nocapture %p1, %struct.P* nocapture %p2) local_unnamed_addr #0 { entry: %f2 = getelementptr inbounds %struct.P, %struct.P* %p1, i64 0, i32 1 store float 0x3FF3333340000000, float* %f2, align 4, !tbaa !2 %f1 = gete...
2020 Mar 30
2
How to add new AVR targets?
Hey Wilhelm, Could you post the LLVM IR generated from your C++ file? This can be achieved with 'clang -S -emit-llvm' Cheers On Sat, Mar 28, 2020 at 6:36 PM Wilhelm Meier <wilhelm.meier at hs-kl.de> wrote: > Answering partly to myself there was a extern "C" missing. > > But the register pushes ans reti are still missing. > > Whats wrong? > > Am
2019 Aug 25
2
SCEV related question
Hello, I am first time paying with SCEV codebase. I am trying to find out why ScalarEvolution is not able to give correct back edge taken count for an expression. So in my case flow reaches to howFarToZero() and in that function, I have following expressions as SCEV Start = (15 + (-1 * %i) (which is set to Distance SCEV) Step = 1 now, first of all, should I expect Start as ConstantSCEV (15)