[all-commits] [llvm/llvm-project] 9b79d0: [MergedLoadStoreMotion] Merge stores with conflict...

Jeffrey Byrnes via All-commits all-commits at lists.llvm.org
Tue Apr 4 12:02:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b79d0b610ccf5557266232d8c7a132ef9ee9365
      https://github.com/llvm/llvm-project/commit/9b79d0b610ccf5557266232d8c7a132ef9ee9365
  Author: Jeff Byrnes <jeffrey.byrnes at amd.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M llvm/include/llvm/IR/Instruction.h
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
    A llvm/test/Transforms/MergedLoadStoreMotion/st_sink_conflict_type.ll
    A llvm/test/Transforms/PhaseOrdering/bitcast-store-branch.ll

  Log Message:
  -----------
  [MergedLoadStoreMotion] Merge stores with conflicting value types

Since memory does not have an intrinsic type, we do not need to require value type matching on stores in order to sink them. To facilitate that, this patch finds stores which are sinkable, but have conflicting types, and bitcasts the ValueOperand so they are easily sinkable into a PHINode. Rather than doing fancy analysis to optimally insert the bitcast, we always insert right before the relevant store in the diamond branch. The assumption is that later passes (e.g. GVN, SimplifyCFG) will clean up bitcasts as needed.

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




More information about the All-commits mailing list