]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
allow vuses in ifcombine blocks
authorAlexandre Oliva <oliva@adacore.com>
Thu, 7 Nov 2024 05:47:15 +0000 (02:47 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 7 Nov 2024 05:47:15 +0000 (02:47 -0300)
Disallowing vuses in blocks for ifcombine is too strict, and it
prevents usefully moving fold_truth_andor into ifcombine.  That
tree-level folder has long ifcombined loads, absent other relevant
side effects.

for  gcc/ChangeLog

* tree-ssa-ifcombine.c (bb_no_side_effects_p): Allow vuses,
but not vdefs.

gcc/tree-ssa-ifcombine.cc

index 39702929fc01174d7bde4994f63299bc145c7bfb..57b7e4b62f291c98b67f4c7d03ce52fe6eb9b204 100644 (file)
@@ -130,7 +130,7 @@ bb_no_side_effects_p (basic_block bb)
       enum tree_code rhs_code;
       if (gimple_has_side_effects (stmt)
          || gimple_could_trap_p (stmt)
-         || gimple_vuse (stmt)
+         || gimple_vdef (stmt)
          /* We need to rewrite stmts with undefined overflow to use
             unsigned arithmetic but cannot do so for signed division.  */
          || ((ass = dyn_cast <gassign *> (stmt))