diff options
author | Andrew Pinski <pinskia@gmail.com> | 2023-10-15 19:15:38 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gmail.com> | 2023-10-24 11:18:12 +0000 |
commit | 0fc13e8c0e39c51e82deb93f324d9d86ad8d7460 (patch) | |
tree | 721e75dd8d73907e3da3fcffe07571304d783644 /gcc/gcov-io.h | |
parent | 452c4f32373feb6b2c1c1d91b5ec6fe7e7ce0000 (diff) | |
download | gcc-0fc13e8c0e39c51e82deb93f324d9d86ad8d7460.zip gcc-0fc13e8c0e39c51e82deb93f324d9d86ad8d7460.tar.gz gcc-0fc13e8c0e39c51e82deb93f324d9d86ad8d7460.tar.bz2 |
Improve factor_out_conditional_operation for conversions and constants
In the case of a NOP conversion (precisions of the 2 types are equal),
factoring out the conversion can be done even if int_fits_type_p returns
false and even when the conversion is defined by a statement inside the
conditional. Since it is a NOP conversion there is no zero/sign extending
happening which is why it is ok to be done here; we were trying to prevent
an extra sign/zero extend from being moved away from definition which no-op
conversions are not.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
PR tree-optimization/104376
PR tree-optimization/101541
* tree-ssa-phiopt.cc (factor_out_conditional_operation):
Allow nop conversions even if it is defined by a statement
inside the conditional.
gcc/testsuite/ChangeLog:
PR tree-optimization/101541
* gcc.dg/tree-ssa/phi-opt-39.c: New test.
Diffstat (limited to 'gcc/gcov-io.h')
0 files changed, 0 insertions, 0 deletions