OSDN Git Service

[CodeGen] Avoid handling DBG_VALUE in the LivePhysRegs (addUses,removeDefs,stepForward)
authorMatt Davis <Matthew.Davis@sony.com>
Mon, 19 Mar 2018 16:06:40 +0000 (16:06 +0000)
committerMatt Davis <Matthew.Davis@sony.com>
Mon, 19 Mar 2018 16:06:40 +0000 (16:06 +0000)
commitdb1b5f0c0f9b06a49609ed69cb19b4ddbe48fe41
tree30f5a6163c1a90cd16986c3f793032b6a3d79de0
parentd767d0a7b459989985ddd95b2a6ad23db6be564f
[CodeGen] Avoid handling DBG_VALUE in the LivePhysRegs (addUses,removeDefs,stepForward)

Summary:
This patch prevents DBG_VALUE instructions from influencing
LivePhysRegs::stepBackwards and stepForwards.  In at least one case,
specifically branch folding, the stepBackwards logic was having an
influence on code generation.  The result was that certain code
compiled with '-g -O2' would differ from that compiled with '-O2'
alone. It seems that the original logic, accounting for DBG_VALUE,
was influencing the placement of an IMPLICIT_DEF which had a later
impact on how blocks were processed in branch folding.

Reviewers: kparzysz, MatzeB

Reviewed By: kparzysz

Subscribers: bjope, llvm-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327862 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LivePhysRegs.cpp
test/CodeGen/X86/dbg-changes-codegen-branch-folding2.mir [new file with mode: 0644]