[all-commits] [llvm/llvm-project] 5f057e: [DAGCombiner] reassociationCanBreakAddressingModeP...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon May 2 16:43:07 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f057eaa0ddf76118a0164b345dff7b382b55234
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-05-02 (Mon, 02 May 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/RISCV/split-offsets.ll

  Log Message:
  [DAGCombiner] reassociationCanBreakAddressingModePattern should check uses of the outer add.

When looking for memory uses,
reassociationCanBreakAddressingModePattern should check uses of
the outer ADD rather than the inner ADD. We want to know if the
two ops we're reassociating are used by a load/store.

In practice, the existing check usually works because CodeGenPrepare
will make one of the load/stores have an offset of 0 relative to
split GEP. That will make the inner add have a memory use.

To test this, I've manually split the GEPs so there is no 0 offset

This issue was recently discussed in the original review D60294.

Reviewed By: luismarques

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

More information about the All-commits mailing list