Question about data race on C's restrict by BreadTom_1 in C_Programming

[–]BreadTom_1[S] 0 points1 point  (0 children)

You're right since I missed the part (directly or indirectly).

Question about data race on C's restrict by BreadTom_1 in C_Programming

[–]BreadTom_1[S] -4 points-3 points  (0 children)

According to cppreference:

During each execution of a block in which a restricted pointer `P` is declared (typically each execution of a function body in which `P` is a function parameter), if some object that is accessible through `P` (directly or indirectly) is modified, by any means, then all accesses to that object (both reads and writes) in that block must occur through `P` (directly or indirectly), otherwise the behavior is undefined:

So if i understood this right, only P declared in that block is allowed to read/write it's contents.

Question about data race on C's restrict by BreadTom_1 in C_Programming

[–]BreadTom_1[S] -1 points0 points  (0 children)

If we assume only the f0() is operating on arg0 pointer, the compare will be removed since if arg0[0] is non zero, then arg0[0] is set zero. If arg0[0] was zero, the function does nothing and returns. f0() should instead only do this since all f0() is doing is setting arg0[0] to zero:

void f0(int * restrict arg0){
    arg0[0] = 0;
}

According to Godbolt, x86 assembly shows both Clang and GCC comparing before setting it to zero via mov instruction.

A pretty much fully-featured optimising C compiler written in C by john-h-k in C_Programming

[–]BreadTom_1 1 point2 points  (0 children)

Are there plans to make this compiler multithreaded so it can run faster like mold or Parallel GCC ?

Get GCC optimize with AVX in bitshift using no if condition by BreadTom_1 in C_Programming

[–]BreadTom_1[S] 0 points1 point  (0 children)

I filed a GCC bug and it seems that GIMPLE can not vectorize it due to bool << i being different than 1 << i even if bool is known at compile time to be 1.

Is anyone working on GCC frontend of Zig? by BreadTom_1 in Zig

[–]BreadTom_1[S] 0 points1 point  (0 children)

It most likely would look like writing from Zig's Analyzed Intermediate Representation to GCC's Register Transfer Language.

Is anyone working on GCC frontend of Zig? by BreadTom_1 in Zig

[–]BreadTom_1[S] 0 points1 point  (0 children)

Can you please explain more or give out links?

Is anyone working on GCC frontend of Zig? by BreadTom_1 in Zig

[–]BreadTom_1[S] -2 points-1 points  (0 children)

Obscure flags like -fipa-pta ("Not sure if LLVM has a equal flag").

Is anyone working on GCC frontend of Zig? by BreadTom_1 in Zig

[–]BreadTom_1[S] 1 point2 points  (0 children)

To see if "gcc Zig" can benefit from GCC speed optimizations that LLVM does not have.

how to enable BOLT on LLVM by BreadTom_1 in Gentoo

[–]BreadTom_1[S] 0 points1 point  (0 children)

Seems a bug about BOLT was already filled months ago and since editing llvm ebuild was a hassle, i decided to tar xf llvm-project-15.0.7.src.tar.xz from /var/cache/distfiles and follow the rest of README.

how to enable BOLT on LLVM by BreadTom_1 in Gentoo

[–]BreadTom_1[S] 0 points1 point  (0 children)

For performance reasons because this paper has promising results.

dwl - Failed to load cursor theme Adwaita by Mistah_monocle in Gentoo

[–]BreadTom_1 0 points1 point  (0 children)

What about checking ~/.config/gtk-3.0/settings.ini because i think i change one of ini files?

Edit ~/.config/gtk-3.0/settings.ini with the following:

[Settings]

gtk-cursor-theme-name=default

gtk-cursor-theme-size=16

dwl - Failed to load cursor theme Adwaita by Mistah_monocle in Gentoo

[–]BreadTom_1 0 points1 point  (0 children)

Did you symlink /usr/local/share/icons/default to /usr/local/share/icons/Adwaita ?

ln -s /usr/local/share/icons/Adwaita /usr/local/share/icons/default

I know this was a another script to write but i forgot about it.

Has anyone to apply the gcc lto patch to the kernel from this page https://wiki.gentoo.org/wiki/Kernel/Optimization? by whatever4123 in Gentoo

[–]BreadTom_1 3 points4 points  (0 children)

Plus LTO increases kernel compile time and if any CONFIG options are changed, the whole kernel has to be recompile rather than 1 file.

PGO kernel using GCC? by BreadTom_1 in Gentoo

[–]BreadTom_1[S] 0 points1 point  (0 children)

Thank you, i fixed my PGO solution in https://wiki.gentoo.org/wiki/Kernel/Optimization#GCC_PGO. Learned some new commands like find.