[all-commits] [llvm/llvm-project] 2d2835: [InstCombine] Add test reproducing PR51435 (NFC)

Ricky Zhou via All-commits all-commits at lists.llvm.org
Sun Jan 30 07:07:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d283528ba97fd3e74ade688a0580ca2eb0c7bae
      https://github.com/llvm/llvm-project/commit/2d283528ba97fd3e74ade688a0580ca2eb0c7bae
  Author: Ricky Zhou <ricky+llvm at rzhou.org>
  Date:   2022-01-30 (Sun, 30 Jan 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/phi.ll

  Log Message:
  -----------
  [InstCombine] Add test reproducing PR51435 (NFC)

Baseline test for D115113

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


  Commit: 30ac5f9e64366a4190ccb205cc774732bc1131c8
      https://github.com/llvm/llvm-project/commit/30ac5f9e64366a4190ccb205cc774732bc1131c8
  Author: Ricky Zhou <ricky+llvm at rzhou.org>
  Date:   2022-01-30 (Sun, 30 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
    M llvm/test/Transforms/InstCombine/phi.ll

  Log Message:
  -----------
  [InstCombine] Do not combine atomic and non-atomic loads

Before this change, InstCombine was willing to fold atomic and
non-atomic loads through a PHI node as long as the first PHI argument
is not an atomic load. The combined load would be non-atomic, which is
incorrect.

Fix this by only combining the loads in a PHI node when all of the
arguments are non-atomic loads.

Thanks to Eli Friedman for pointing out the bug at
https://github.com/llvm/llvm-project/issues/50777#issuecomment-981045342!

Fixes #50777

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


Compare: https://github.com/llvm/llvm-project/compare/69b835486f5e...30ac5f9e6436


More information about the All-commits mailing list