7 Commits

Author SHA1 Message Date
Arthur Eubanks
e422c0d3b2 [GlobalOpt] Perform store->dominated load forwarding for stored once globals
The initial land incorrectly optimized forwarding non-Constants in non-nosync/norecurse functions. Bail on non-Constants since norecurse should cause global -> alloca promotion anyway.

The initial land also incorrectly assumed that StoredOnceStore was the only store to the global, but it actually means that only one value other than the global initializer is stored. Add a check that there's only one store.

Compile time tracker:
https://llvm-compile-time-tracker.com/compare.php?from=c80b88ee29f34078d2149de94e27600093e6c7c0&to=ef2c2b7772424b6861a75e794f3c31b45167304a&stat=instructions

Reviewed By: nikic, asbirlea, jdoerfert

Differential Revision: https://reviews.llvm.org/D128128
2022-06-24 09:09:26 -07:00
Arthur Eubanks
b257acd266 [test][GlobalOpt] Update precommitted test 2022-06-23 09:56:31 -07:00
Arthur Eubanks
13ff7d6f39 Revert "[GlobalOpt] Perform store->dominated load forwarding for stored once globals"
This reverts commit 6f348b146b69a50d5fb1b9fbfd14bc1d204e45c4.

Am seeing internal test failures plus a linux kernel breakage reported due to this.
2022-06-20 10:26:47 -07:00
Arthur Eubanks
6f348b146b [GlobalOpt] Perform store->dominated load forwarding for stored once globals
Compile time tracker:
https://llvm-compile-time-tracker.com/compare.php?from=1e556f459b44dd0ca4073e932f66ecb6f40fe31a&to=6d7bed4e1e72c6a8592748626091274209740a40&stat=instructions

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128128
2022-06-19 10:27:20 -07:00
Arthur Eubanks
1e556f459b [test][GlobalOpt] Update precommitted test 2022-06-18 21:58:16 -07:00
Arthur Eubanks
213d489707 [test][GlobalOpt] Precommit more tests
And fix up existing tests to not have so much UB.
2022-06-18 19:36:48 -07:00
Arthur Eubanks
07b9937d0c [test][GlobalOpt] Precommit test 2022-06-18 15:44:27 -07:00