]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LIM: Manually put uninit decl into ssa
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 19 Aug 2025 21:52:18 +0000 (14:52 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 25 Aug 2025 15:26:34 +0000 (08:26 -0700)
When working on PR121279, I noticed that lim
would create an uninitialized decl and marking
it with supression for uninitialization warning.
This is fine but then into ssa would just call
get_or_create_ssa_default_def on that new decl which
could in theory take some extra compile time to figure
that out.
Plus when doing the rewriting for undefinedness, there
would now be a VCE around the decl. This means the ssa
name is kept around and not propagated in some cases.
So instead this patch manually calls get_or_create_ssa_default_def
to get the "uninitalized" ssa name for this decl and
no longer needs the write into ssa nor for undefined ness.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-ssa-loop-im.cc (execute_sm): Call
get_or_create_ssa_default_def for the new uninitialized
decl.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/tree-ssa-loop-im.cc

index aee419aa5b1eb021b0ab1debe1eeaa03e152ad15..0340857058bb76a7fe8be664af2d5d1943333259 100644 (file)
@@ -2355,6 +2355,7 @@ execute_sm (class loop *loop, im_mem_ref *ref,
         loop entry as not to be warned for.  */
       tree uninit = create_tmp_reg (TREE_TYPE (aux->tmp_var));
       suppress_warning (uninit, OPT_Wuninitialized);
+      uninit = get_or_create_ssa_default_def (cfun, uninit);
       load = gimple_build_assign (aux->tmp_var, uninit);
     }
   lim_data = init_lim_data (load);