tree-optimization/94949 - fix load eliding in SM
authorRichard Biener <rguenther@suse.de>
Tue, 5 May 2020 09:00:09 +0000 (11:00 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 5 May 2020 10:35:05 +0000 (12:35 +0200)
commit0424a5ece5307cc22bbc0fe97edf4707d7a798ed
tree8aa71eb224c9168fd0e7165b7256c4359f848e52
parent1bd3a8af85356e64ec27309dba7fb2fca2343ffe
tree-optimization/94949 - fix load eliding in SM

This fixes the case of not using the multithreaded model when
only conditionally storing to the destination.  We cannot elide
the load in this case.

2020-05-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/94949
* tree-ssa-loop-im.c (execute_sm): Check whether we use
the multithreaded model or always compute the stored value
before eliding a load.

* gcc.dg/torture/pr94949.c: New testcase.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr94949.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c