aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorJiufu Guo <guojiufu@linux.ibm.com>2022-10-08 12:57:51 +0800
committerJiufu Guo <guojiufu@linux.ibm.com>2023-06-19 11:27:50 +0800
commit41f42d120c4a6643f2f54952c180847d03405e3b (patch)
treefd40091ae91a92eeeec66e83cba3ef23099d37d3 /gcc/tree-vectorizer.h
parentc0bd79300e8fad52ec0fac7c65838a525d544a25 (diff)
downloadgcc-41f42d120c4a6643f2f54952c180847d03405e3b.zip
gcc-41f42d120c4a6643f2f54952c180847d03405e3b.tar.gz
gcc-41f42d120c4a6643f2f54952c180847d03405e3b.tar.bz2
rs6000: Enable const_anchor for 'addi'
There is a functionality as const_anchor in cse.cc. This const_anchor supports to generate new constants through adding small gap/offsets to existing constant. For example: void __attribute__ ((noinline)) foo (long long *a) { *a++ = 0x2351847027482577LL; *a++ = 0x2351847027482578LL; } The second constant (0x2351847027482578LL) can be compated by adding '1' to the first constant (0x2351847027482577LL). This is profitable if more than one instructions are need to build the second constant. * For rs6000, we can enable this functionality, as the instruction 'addi' is just for this when gap is smaller than 0x8000. * One potential side effect of this feature: Comparing with "r101=0x2351847027482577LL ... r201=0x2351847027482578LL" The new r201 will be "r201=r101+1", and then r101 will live longer, and would increase pressure when allocating registers. But I feel, this would be acceptable for this const_anchor feature. With this feature, for GCC source code and SPEC object files, the significant changes are the improvement that: "addi" vs. "2 or more insns: lis+or.."; it also exposes some other optimizations opportunities: like combine/jump2. While the side effect is also occurring in few cases, but it does not impact overall performance. gcc/ChangeLog: * config/rs6000/rs6000.cc (TARGET_CONST_ANCHOR): New define. gcc/testsuite/ChangeLog: * gcc.target/powerpc/const_anchors.c: New test. * gcc.target/powerpc/try_const_anchors_ice.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions