[X86] Avoid SFB - Fix inconsistent codegen with/without debug info
authorRobert Lougher <rob.lougher@gmail.com>
Fri, 10 May 2019 15:55:06 +0000 (15:55 +0000)
committerRobert Lougher <rob.lougher@gmail.com>
Fri, 10 May 2019 15:55:06 +0000 (15:55 +0000)
commit986b6b86bb8e0f64c52f9fbf81697e398d79107a
tree113e944bef37a7f39d2d511601281b1411ba23f9
parenta0b1518a4a5738765619fd09a58d12573163ec79
[X86] Avoid SFB - Fix inconsistent codegen with/without debug info

Fixes https://bugs.llvm.org/show_bug.cgi?id=40969

The functions findPotentiallyBlockedCopies and buildCopy are currently not
accounting for the presence of debug instructions. In the former this results
in the optimization not being trigerred, and in the latter results in
inconsistent codegen.

This patch enables the optimization to be performed in a debug build and
ensures the codegen is consistent with non-debug builds.

Patch by Chris Dawson.

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

llvm-svn: 360436
llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
llvm/test/CodeGen/X86/avoid-sfb-g-no-change.mir [new file with mode: 0644]