Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
For this code:
float foo(float x, float y)
{
return x * y/y;
}
gcc(trunk,9,8,7,6,5) with '-O3 -ffast
: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
For this code:
float foo(float a, float b, float c)
{
return a * -b - c;
}
gcc(trunk) with '-O3 -ffast-math -march=haswell' produces this:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91250
--- Comment #2 from Alexander Zaitsev ---
But on this example all is fine:
float foo(float a, float b, float c)
{
return -a * -b - c;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91250
--- Comment #1 from Alexander Zaitsev ---
Another example of missed optimization:
float foo(float a, float b, float c)
{
return -a * b - c;
}
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
For the code below:
int Test(bool cond1, bool cond2)
{
if (cond1)
{
if (cond2)
{
return 42;
}
}
return 43;
}
gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91540
--- Comment #1 from Alexander Zaitsev ---
Godbolt playground: https://godbolt.org/z/MFSH1D
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with optimization flags '--std=c++17 -O3 -march=native -ffast-math'
for this code:
double
: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
#include
double tes
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
double test(double a
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
#include
double tes
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
#include
double tes
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
#include
double test(double a)
{
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83353
--- Comment #1 from Alexander Zaitsev ---
The same issue about cos(acos(x)).
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this
code:
#include
double tes
++
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '--std=c++17 -O3' for this code:
int test(int a)
{
int res = 0;
int* i = new int;
for(*i = 0; *i < a; *i = *i + 1)
{
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc (trunk) with '-O3 -std=c++17 -ffast-math -funsafe-math-optimizations' for
this code:
int test(int x)
{
return (x+x)/x;
}
generates:
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc (trunk) with '-O3 -std=c++17' for this code:
unsigned test()
{
int arr[] = {5,4,3,2,1};
int sum = 0;
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '-O3 -std=c++17 -ffast-math' for this:
#include
int test(int x)
{
if(x == std::numeric_limits::max())
{
return x+1;
}
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc trunk with '-O3 -ffast-math -std=c++17' for this code:
double test(double x, double y)
{
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82478
Alexander Zaitsev changed:
What|Removed |Added
CC||zamazan4ik at tut dot by
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with -O3 -std=c++17 for this code:
unsigned int foo(unsigned int x)
{
if(x % 2 == 0)
{
return x * 2;
}
if(x % 4 == 0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85747
Alexander Zaitsev changed:
What|Removed |Added
CC||zamazan4ik at tut dot by
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) for this code:
#include
template int foo(int) { return 1; }
template int foo(decltype(T{})) { return 2; }
template int foo
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '-O3' option for this code:
int foo()
{
int a[10];
for(int i = 0; i < 10; ++i)
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with '-O3 -march=native --std=c++11 -Wall' for this code:
#include
#include
using namespace std;
int main() {
int n = 1;
int m = 1;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84560
--- Comment #1 from Alexander Zaitsev ---
On GCC 7.3.1 for this code I have:
internal compiler error: в expand_expr_real_1, в expr.c:9908
memset(d[n - 1], 0, sizeof(int));
^
Please submit a full bug report,
with preproc
: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
I suggest use pdqsort for std::sort, because pdqsort is really faster. Here you
can find benchmarks: https://github.com/orlp/pdqsort
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83352
--- Comment #2 from Alexander Zaitsev ---
What about longer sqrt functions call?
gcc(trunk) -O3 -ffast-math:
double test(double a)
{
return sqrt(sqrt(sqrt(sqrt(sqrt(a);
}
test(double):
andpd xmm0, XMMWORD PTR .LC0[rip]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83353
--- Comment #3 from Alexander Zaitsev ---
FMPOV compiler should optimize as much as possible. If it's too time consuming,
I prefer some additional compiler option like
-f-do-some-math-time-consuming-optimization.
And yes - developers canot write
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83354
Alexander Zaitsev changed:
What|Removed |Added
Status|WAITING |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83348
--- Comment #2 from Alexander Zaitsev ---
Thank you for the great comment! Should I close this issue?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83350
--- Comment #2 from Alexander Zaitsev ---
Sure. Do you know about any activity in gcc in implementing or integrating
built-in math engine for optimizing such expressions?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83354
--- Comment #2 from Alexander Zaitsev ---
Yes, you are right. My bad. Closing this issue.
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
gcc(trunk) with -O3 -std=c++17 for this code:
#include
#include
int foo(std::vector v) {
int l = v[0];
for(const auto& x
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87849
--- Comment #1 from Alexander Zaitsev ---
Same for code without using STL algorithms and containers:
int min(int a, int b)
{
return a < b ? a : b;
}
int max(int a, int b)
{
return a > b ? a : b;
}
int foo(int* v, int size) {
int l
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96821
Alexander Zaitsev changed:
What|Removed |Added
CC||zamazan4ik at tut dot by
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
For the following code:
bool foo(int var)
{
if (var == 42) [[unlikely]] return true;
if (var == 322) [[unlikely]] return true;
if (var == 1337) [[likely]] return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114761
--- Comment #5 from Alexander Zaitsev ---
> Is this based on real code or you just was looking at the differences between
> gcc and clang here?
Really, not on a real code. I came up with this example when I found that GCC
for this example does
: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
LLVM infrastructure supports a diagnostic for checking mismatches between
user-provided __builtin_expect/[[likely]] hints and PGO profiles:
https://clang.llvm.org/docs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114851
--- Comment #3 from Alexander Zaitsev ---
> Though I do wonder if the "hints" are used instead of the PGO here.
We already discussed this question a bit in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112806 . If I understand
correctly, no clea
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
Target Milestone: ---
Hi!
According to the Facebook Research Paper
(https://research.facebook.com/publications/bolt-a-practical-binary-optimizer-for-data-centers-and-beyond/),
LLVM BOLT (https
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Hi. I have several questions regarding .gcda profiles re-usage between GCC
versions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112717
--- Comment #3 from Alexander Zaitsev ---
> I thought this was documented but I don't see. There is no guarantee for
> forward or backwards compatibility at all. In fact iirc there is a version
> stored in the files to make sure the correct ve
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112806
--- Comment #3 from Alexander Zaitsev ---
> https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Other-Builtins.html#index-fprofile-arcs-1
I already read this and still do not understand the actual behavior. If PGO
profiles show that the branch is "co
-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: zamazan4ik at tut dot by
CC: marxin at gcc dot gnu.org
Target Milestone: ---
According to the GCC documentation
(https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) the only
option is to dump
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112829
--- Comment #2 from Alexander Zaitsev ---
Am I right that right now in GCC there are no ready-to-use alternatives to "int
__llvm_profile_write_buffer(char *Buffer)" from LLVM and it should be
implemented somehow manually (as you described)?
46 matches
Mail list logo