[all-commits] [llvm/llvm-project] 25b9ed: [DAGCombine] Fix multi-use miscompile in load comb...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Feb 13 07:41:13 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25b9ed6e4964344e3710359bec4c831e5a8448b9
      https://github.com/llvm/llvm-project/commit/25b9ed6e4964344e3710359bec4c831e5a8448b9
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-02-13 (Tue, 13 Feb 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/X86/load-combine.ll

  Log Message:
  -----------
  [DAGCombine] Fix multi-use miscompile in load combine (#81586)

The load combine replaces a number of original loads with one new loads
and also replaces the output chains of the original loads with the
output chain of the new load. This is incorrect if the original load is
retained (due to multi-use), as it may get incorrectly reordered.

Fix this by using makeEquivalentMemoryOrdering() instead, which will
create a TokenFactor with both chains.

Fixes https://github.com/llvm/llvm-project/issues/80911.




More information about the All-commits mailing list