[all-commits] [llvm/llvm-project] 2ddcf7: [InstCombine] Perform memset -> load forwarding

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Nov 3 08:05:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ddcf721a0e8dafec5196001b2472480f0011887
      https://github.com/llvm/llvm-project/commit/2ddcf721a0e8dafec5196001b2472480f0011887
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M llvm/lib/Analysis/Loads.cpp
    M llvm/test/Transforms/InstCombine/load-store-forward.ll

  Log Message:
  -----------
  [InstCombine] Perform memset -> load forwarding

InstCombine does some basic store to load forwarding. One case it
currently misses is the case where the store is actually a memset.
This patch adds support for this case. This is a minimal
implementation that only handles a load at the memset base address,
without an offset.

GVN is already capable of performing this optimization. Having it
in InstCombine can help with phase ordering issues, similar to the
existing store to load forwarding.

Differential Revision: https://reviews.llvm.org/D137323




More information about the All-commits mailing list