[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 12 Dec 2014 12:41:22 +0000 (12:41 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 12 Dec 2014 12:41:22 +0000 (12:41 +0000)
commit01236e3eca6b7fba347fb6b88c6fdcd7624d45ad
treee6e12cfd7456b4eda6c95027f9d36e8ec49dde7a
parent7163d0035996b90e7a131376c500e76ee0e0e415
[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.

This patch fixes the issue reported as PR21807. There was a minor difference
in the generated code depending on the -g flag.

The cause was that with -g the machine scheduler used a different
scheduling strategy. This decision was based on the number of instructions
in a schedule region and included debug instructions in that count.

This patch fixes the issue in MISched and provides a test.

Patch by Russell Gallop!

llvm-svn: 224118
llvm/lib/CodeGen/MachineScheduler.cpp
llvm/test/CodeGen/X86/misched-code-difference-with-debug.ll [new file with mode: 0644]