aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-range.cc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2024-05-09 22:45:54 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2024-05-09 22:45:54 +0100
commitf2449b55fb2d32fc4200667ba79847db31f6530d (patch)
treeb71644e009f0da5532ef843af94a550723813094 /gcc/value-range.cc
parent646db3d30bd071a1b671b4f91c9ea2ab7f2be21c (diff)
downloadgcc-f2449b55fb2d32fc4200667ba79847db31f6530d.zip
gcc-f2449b55fb2d32fc4200667ba79847db31f6530d.tar.gz
gcc-f2449b55fb2d32fc4200667ba79847db31f6530d.tar.bz2
Constant fold {-1,-1} << 1 in simplify-rtx.cc
This patch addresses a missed optimization opportunity in the RTL optimization passes. The function simplify_const_binary_operation will constant fold binary operators with two CONST_INT operands, and those with two CONST_VECTOR operands, but is missing compile-time evaluation of binary operators with a CONST_VECTOR and a CONST_INT, such as vector shifts and rotates. The first version of this patch didn't contain a switch statement to explicitly check for valid binary opcodes, which bootstrapped and regression tested fine, but my paranoia has got the better of me, so this version now checks that VEC_SELECT or some funky (future) rtx_code doesn't cause problems. 2024-05-09 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * simplify-rtx.cc (simplify_const_binary_operation): Constant fold binary operations where the LHS is CONST_VECTOR and the RHS is CONST_INT (or CONST_DOUBLE) such as vector shifts.
Diffstat (limited to 'gcc/value-range.cc')
0 files changed, 0 insertions, 0 deletions