diff options
author | Andi Kleen <ak@gcc.gnu.org> | 2024-08-01 20:10:27 -0700 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2024-08-25 09:48:04 -0700 |
commit | c9ccc3961f5b8d333f5081b377cd9ee9e33079f7 (patch) | |
tree | 5867e7e1439ca0d2e42780b032adfcacd1121cc5 /libcpp/files.cc | |
parent | 382fcf03e0ff6b32ce321fea6a81b87c8aa8f0c2 (diff) | |
download | gcc-c9ccc3961f5b8d333f5081b377cd9ee9e33079f7.zip gcc-c9ccc3961f5b8d333f5081b377cd9ee9e33079f7.tar.gz gcc-c9ccc3961f5b8d333f5081b377cd9ee9e33079f7.tar.bz2 |
Support if conversion for switches
The gimple-if-to-switch pass converts if statements with
multiple equal checks on the same value to a switch. This breaks
vectorization which cannot handle switches.
Teach the tree-if-conv pass used by the vectorizer to handle
simple switch statements, like those created by if-to-switch earlier.
These are switches that only have a single non default block,
They are handled similar to COND in if conversion.
This makes the vect-bitfield-read-1-not test fail. The test
checks for a bitfield analysis failing, but it actually
relied on the ifcvt erroring out early because the test
is using a switch. The if conversion still does not
work because the switch is not in a form that this
patch can handle, but it fails much later and the bitfield
analysis succeeds, which makes the test fail. I marked
it xfail because it doesn't seem to be testing what it wants
to test.
PR tree-optimization/115866
gcc/ChangeLog:
* tree-if-conv.cc (if_convertible_switch_p): New function.
(if_convertible_stmt_p): Check for switch.
(get_loop_body_in_if_conv_order): Handle switch.
(predicate_bbs): Likewise.
(predicate_statements): Likewise.
(remove_conditions_and_labels): Likewise.
(ifcvt_split_critical_edges): Likewise.
(ifcvt_local_dce): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/vect-switch-ifcvt-1.c: New test.
* gcc.dg/vect/vect-switch-ifcvt-2.c: New test.
* gcc.dg/vect/vect-switch-search-line-fast.c: New test.
* gcc.dg/vect/vect-bitfield-read-1-not.c: Change to xfail.
Diffstat (limited to 'libcpp/files.cc')
0 files changed, 0 insertions, 0 deletions