tree-optimization/98213 - cache PHI walking result in SM
authorRichard Biener <rguenther@suse.de>
Wed, 9 Dec 2020 14:48:36 +0000 (15:48 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 9 Dec 2020 16:27:25 +0000 (17:27 +0100)
commit84d08255f9f2f7137caf648fcc9dc36101bc893c
tree235f02b67a891ab9b3a1cfb2a85ad32dd4ba8b38
parent0b37233152b55fb256d7537d7e76067edc52cb88
tree-optimization/98213 - cache PHI walking result in SM

This avoids exponential work when walking PHIs in loop store motion.
Fails are quickly propagated and thus need no caching.

2020-12-09  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98213
* tree-ssa-loop-im.c (sm_seq_valid_bb): Cache successfully
processed PHIs.
(hoist_memory_references): Adjust.

* g++.dg/pr98213.C: New testcase.
gcc/testsuite/g++.dg/pr98213.C [new file with mode: 0644]
gcc/tree-ssa-loop-im.c