aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.cc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2023-06-13 17:20:31 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2023-06-13 17:20:31 +0100
commit40eafcd83d6ee644ec48985fd5a9696921ea10e7 (patch)
tree15ad92061909804f4b3d0ad83d6492e823680772 /gcc/tree-loop-distribution.cc
parent06a0f07220cea449b4683f9bb9cce2e5de1e5a35 (diff)
downloadgcc-40eafcd83d6ee644ec48985fd5a9696921ea10e7.zip
gcc-40eafcd83d6ee644ec48985fd5a9696921ea10e7.tar.gz
gcc-40eafcd83d6ee644ec48985fd5a9696921ea10e7.tar.bz2
Avoid duplicate vector initializations during RTL expansion.
This middle-end patch avoids some redundant RTL for vector initialization during RTL expansion. For the simple test case: typedef __int128 v1ti __attribute__ ((__vector_size__ (16))); __int128 key; v1ti foo() { return (v1ti){key}; } the middle-end currently expands: (set (reg:V1TI 85) (const_vector:V1TI [ (const_int 0) ])) (set (reg:V1TI 85) (mem/c:V1TI (symbol_ref:DI ("key")))) where we create a dead instruction that initializes the vector to zero, immediately followed by a set of the entire vector. This patch skips this zeroing instruction when the vector has only a single element. It also updates the code to indicate when we've cleared the vector, so that we don't need to initialize zero elements. 2023-06-13 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * expr.cc (store_constructor) <case VECTOR_TYPE>: Don't bother clearing vectors with only a single element. Set CLEARED if the vector was initialized to zero.
Diffstat (limited to 'gcc/tree-loop-distribution.cc')
0 files changed, 0 insertions, 0 deletions