[all-commits] [llvm/llvm-project] e422c0: [GlobalOpt] Perform store->dominated load forwardi...

aeubanks via All-commits all-commits at lists.llvm.org
Fri Jun 24 09:09:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e422c0d3b26eaf3e5646960351d4fe6ff7c0b573
      https://github.com/llvm/llvm-project/commit/e422c0d3b26eaf3e5646960351d4fe6ff7c0b573
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/GlobalStatus.h
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    M llvm/lib/Transforms/Utils/GlobalStatus.cpp
    M llvm/test/Transforms/GlobalOpt/shrink-global-to-bool-check-debug.ll
    M llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll
    M llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll
    M llvm/test/Transforms/PhaseOrdering/recompute-globalsaa.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list