[Bug tree-optimization/115034] Missed optimization: reduntant store of identical value in the slot

2024-05-10 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115034 --- Comment #2 from XChy --- (In reply to Andrew Pinski from comment #1) > Note there is some memory model requirements here that I always forget if > this can happen or not. Hmm. Could you please provide some documents about the memory model

[Bug tree-optimization/115035] New: Missed optimization: fold min/max in phi

2024-05-10 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115035 Bug ID: 115035 Summary: Missed optimization: fold min/max in phi Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug tree-optimization/115034] New: Missed optimization: reduntant store of identical value in the slot

2024-05-10 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115034 Bug ID: 115034 Summary: Missed optimization: reduntant store of identical value in the slot Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/114797] Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797 --- Comment #2 from XChy --- It looks like for completely overlapped memset, it's merged: https://godbolt.org/z/4r7Eqr1Ee With clobber, that's not the case: https://godbolt.org/z/8jhaEbKqo

[Bug tree-optimization/114797] New: Missed optimization : fail to merge memset with unrelated clobber

2024-04-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114797 Bug ID: 114797 Summary: Missed optimization : fail to merge memset with unrelated clobber Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/114737] New: Missed optimization : fail to optimize load with select clobber

2024-04-16 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114737 Bug ID: 114737 Summary: Missed optimization : fail to optimize load with select clobber Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/114725] New: Missed optimization: more precise range for and

2024-04-15 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114725 Bug ID: 114725 Summary: Missed optimization: more precise range for and Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug tree-optimization/114712] New: Missed optimization: simplify if-else basic blocks that share common destinations

2024-04-13 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114712 Bug ID: 114712 Summary: Missed optimization: simplify if-else basic blocks that share common destinations Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/114711] Missed optimization: fold load of global constant array if there is obivous pattern

2024-04-13 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114711 --- Comment #3 from XChy --- (In reply to Andrew Pinski from comment #1) > Note the openssl code issue was reported in pr 114682 Oh, thanks for transferring this LLVM issue! And because I'm recently trying to transfer some of my LLVM issues to

[Bug tree-optimization/114711] New: Missed optimization: fold load of global constant array if there is obivous pattern

2024-04-13 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114711 Bug ID: 114711 Summary: Missed optimization: fold load of global constant array if there is obivous pattern Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/114704] Missed optimization : eliminate store if the value is known in all predecessors

2024-04-13 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114704 --- Comment #3 from XChy --- (In reply to Andrew Pinski from comment #1) > Confirmed. A more general testcase: > ``` > void dummy(); > > void src(int *p, int a){ > int t = *p; > if(t == a) > goto then; > else { >

[Bug tree-optimization/114704] New: Missed optimization : eliminate store if the value is known in all predecessors

2024-04-12 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114704 Bug ID: 114704 Summary: Missed optimization : eliminate store if the value is known in all predecessors Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/114702] New: Missed optimization: fail to infer c - b != if a + b != c

2024-04-12 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114702 Bug ID: 114702 Summary: Missed optimization: fail to infer c - b != if a + b != c Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/114331] New: Missed optimization: indicate knownbits from dominating condition switch(trunc(a))

2024-03-13 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114331 Bug ID: 114331 Summary: Missed optimization: indicate knownbits from dominating condition switch(trunc(a)) Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/113487] Missed optimization:simplify demanded bits on multi-use instructions like select

2024-01-18 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113487 --- Comment #2 from XChy --- I may miss something here... Apart from this one, it seems that GCC doesn't simplify **one-use** instruction based on demanded bits too: https://godbolt.org/z/67bYxd8hY But LLVM indeed handle the one-use case.

[Bug tree-optimization/113487] New: Missed optimization:simplify demanded bits on multi-use instructions like select

2024-01-18 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113487 Bug ID: 113487 Summary: Missed optimization:simplify demanded bits on multi-use instructions like select Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/113105] Missing optimzation: fold `div(v, a) * b + rem(v, a)` to `div(v, a) * (b - a) + v`

2023-12-23 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105 --- Comment #5 from XChy --- (In reply to Jakub Jelinek from comment #4) > So, e.g. on x86_64, > unsigned int > f1 (unsigned val) > { > return val / 10 * 16 + val % 10; > } > > unsigned int > f2 (unsigned val) > { > return val / 10 * 6 +

[Bug tree-optimization/113071] `((a == c) || (a == b)) ? a : b` is sometimes not optimized to `(a == c) ? c : b`

2023-12-23 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113071 XChy changed: What|Removed |Added CC||xxs_chy at outlook dot com --- Comment #1 from

[Bug tree-optimization/113105] Missing optimzation: fold `div(v, a) * b + rem(v, a)` to `div(v, a) * (b - a) + v`

2023-12-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105 --- Comment #2 from XChy --- (In reply to Jakub Jelinek from comment #1) > When it is signed v / a * b + v % a, I think it can introduce UB which > wasn't there originally. > E.g. for v = 0, a = INT_MIN and b = 3. So, if it isn't done just for

[Bug tree-optimization/113105] New: Missing optimzation: fold `div(v, a) * b + rem(v, a)` to `div(v, a) * (b - a) + v`

2023-12-21 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113105 Bug ID: 113105 Summary: Missing optimzation: fold `div(v, a) * b + rem(v, a)` to `div(v, a) * (b - a) + v` Product: gcc Version: 14.0 Status: UNCONFIRMED

[Bug tree-optimization/112982] New: Missing optimization: fold max(b, a + 1) to b when a < b

2023-12-12 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112982 Bug ID: 112982 Summary: Missing optimization: fold max(b, a + 1) to b when a < b Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/112900] New: Missing optimization: canonicalize `select c, x - 1, x + 1` to `x + (select c, -1, 1)` (or reversely)

2023-12-07 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112900 Bug ID: 112900 Summary: Missing optimization: canonicalize `select c, x - 1, x + 1` to `x + (select c, -1, 1)` (or reversely) Product: gcc Version: 14.0 Status:

[Bug tree-optimization/112884] New: Missing optimization: fold a%2==0 ? a/2*2 : 0 to a%2==0 ? a : 0

2023-12-06 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112884 Bug ID: 112884 Summary: Missing optimization: fold a%2==0 ? a/2*2 : 0 to a%2==0 ? a : 0 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/112857] Missing optimzation: fold (b + ~a) > 0 to a - b < -1

2023-12-05 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112857 --- Comment #3 from XChy --- (In reply to Richard Biener from comment #2) > careful about overflow. I'm not a developer of GCC, but for "(b + ~a) > 0 -> a - b < -1", I can say it's a valid refinement for both signed and unsigned, with SMT

[Bug tree-optimization/112857] Missing optimzation: fold (b + ~a) > 0 to a - b < -1

2023-12-05 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112857 --- Comment #4 from XChy --- (In reply to Andrew Pinski from comment #1) > For the above, GCC is able to get the best code for g0, g10, g1, and g4 > (though g1 and g4 are still `(b-a) > 0` at the gimple level. While LLVM is > able to get it

[Bug tree-optimization/112857] New: Missing optimzation: fold (b + ~a) > 0 to a - b < -1

2023-12-04 Thread xxs_chy at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112857 Bug ID: 112857 Summary: Missing optimzation: fold (b + ~a) > 0 to a - b < -1 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3