aboutsummaryrefslogtreecommitdiff
path: root/gcc/multiple_target.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2020-06-26 15:23:05 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2020-06-26 15:26:48 +0200
commitb3d77404c060c0d65d8d4c97254995737d0fc032 (patch)
treeea830543f92f5c3fc7054078e9352a15d9f1093e /gcc/multiple_target.c
parent2ca78835619f0f24c1fe5d74828d8dc95900fe96 (diff)
downloadgcc-b3d77404c060c0d65d8d4c97254995737d0fc032.zip
gcc-b3d77404c060c0d65d8d4c97254995737d0fc032.tar.gz
gcc-b3d77404c060c0d65d8d4c97254995737d0fc032.tar.bz2
Take into account range info to optimize range tests into bit tests
The patch is aimed at addressing the following two issues: 1. In order to protect the shift operation from undefinedness, the new bit test is guarded with a new test, but this new test uses the range of the bit test values, not that of the shift operation so, if the input is in the range of the shift operation but not of the bit test values, then the subsequent VRP pass cannot eliminate the new test. Moreover changing the new test to use the range of the shift operation, instead of that of the bit test values, in the general case would pessimize the cases which are in between. 2. If the new test can be eliminated, then it becomes profitable to do the optimization into a bit test for one fewer comparison in the source code. Therefore the patch changes optimize_range_tests_to_bit_test to use the range info of the input in order to eliminate the new test. gcc/ChangeLog: * tree-ssa-reassoc.c (dump_range_entry): New function. (debug_range_entry): New debug function. (update_range_test): Invoke dump_range_entry for dumping. (optimize_range_tests_to_bit_test): Merge the entry test in the bit test when possible and lower the profitability threshold. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_Set_Membership): Expand the membership test using left associativity instead of right associativity. gcc/testsuite/ChangeLog: * gnat.dg/opt86_pkg.ads: New helper. * gnat.dg/opt86a.adb: New test. * gnat.dg/opt86b.adb: Likewise. * gnat.dg/opt86c.adb: Likewise.
Diffstat (limited to 'gcc/multiple_target.c')
0 files changed, 0 insertions, 0 deletions