This page lists the current and past Easy issues of the week from the newsletter.
If you want to propose one for the next week's issue. Please add them in the proposal section at the bottom and mention who to contact. Note this can be any of the GNU toolchain projects.
- Week 61
op0 != 0 ? op0 & op1 : 0 can be optimized to just op0 & op1 in RTL
- Week 60
~a < -a can be optimized to a != 0 for unsigned types
- Week 59
Missed optimization: fold (a^b) <= 3 to b < 4 for bool a
- Week 57
- Missed optimization in math expression: optimize float / in some cases
- Week 56
(a&-a) < 0 -> a == INT_MIN
- Week 55
a << CST >> CST can be simplified into a if upper CST bits of a are known to be zero
- Week 54
- (int)(((unsigned)a) + CST) should be simplified into a + CST if a+CST is known not to overflow in int
- Week 53
- umax(a,b)==0 folding into a|b==0 gets in the way sometimes
- Week 52
smax(a,-a) -> abs (simplification) for RTL
- Week 51
a==b imples (a+b)&1 is known to 0
- Week 50
a/b -> 1 if it is known that a==b in VRP without DOM
- Week 49
(si)~(ui)si_var should be converted into just ~si_var
- Week 48
smax <smin <a, nonneg>, 0> can be simplified into umin<a, nonneg> (RTL)
- Note this bug is an invalid transformation. It was a misunderstanding of the reflection on the number line.
- Week 46/47 - Andrea was on vacation
- Week 45
MIN<nonnegative,a> >= 0 is not simplified into a >= 0
- Week 44a (Andrea Pinski)
ICE with return type of typedef of void and #pragma omp declare simd
- Week 44b (Jeff Law)
- For RISC-V, prefer li+slli rather than lui+add for some constants
- Week 43
strlen(s) != 0 not folded into *s
- Week 42a (Andrea Pinski)
(x == MAX_VALUE) ? y : MIN<x, y> -> MIN<x,y>
- Week 42b (Jeff Law)
- Improve RISC-V sequence for conditional xor with a constant
- Week 41
- MAX(x, -1) can use orr with ash operand (aarch64)
- Week 40
BOOL_BITFIELD in system.h can be removed
- Week 39
Missed (x == 0) | ((x | y) == 0) to (x == 0)
- Week 38
signbit comparisons -> copysign optimization
- Week 37
a == INT_MIN ? INT_MIN : -a is not converted into (signed)-(unsigned)a
- Week 36
(a & ~CST) ^ CST -> a | CST
- Week 35
(A > PZ) ? ABS(A) : PZ -> MAX(A, PZ)
- Week 34
some force_gimple_operand_gsi in tree-strlen.cc should be replaced by gimple_build/gimple_convert
- Week 33
((~x) & y) ^ (x | y) is x
- Week 32
(__int128_var >> 127) & 1 is not optimized to ((unsigned __int128)__int128_var ) >> 127 in gimple level
- Week 31
(a ^ c) & (a | c) -> a ^ c not done on the gimple/tree level
- Week 30
- Missed optimisation: std::in_range simpler size check
- Week 29
(x ^ (-CMP)) + CMP -> CMP ? -x : x
- Week 28
Missed optimization for branch folding with unsigned arithmetic wraparound
- Week 27
(len | N) == len is transformed to len & N != 0
- Week 26
(a>>N) != (b>>N) is not optimized to (a^b) >= (1<<N)
- Week 25
Transform if (a[i] > 0) sum += a[i] into sum += max (0, a[i]) when vectorizing and have conditional add
- Week 24
lower mempcpy to memcpy when result is unused
Proposals
- Example:
- lower mempcpy to memcpy when result is unused
- Andrea Pinski