Backport of clang svn@r216114

    critical-anti-dependency breaker: don't use reg def info from kill insts (PR20308)

    In PR20308 ( http://llvm.org/bugs/show_bug.cgi?id=20308 ), the critical-anti-dependency breaker
    caused a miscompile because it broke a WAR hazard using a register that it thinks is available
    based on info from a kill inst. Until PR18663 is solved, we shouldn't use any def/use info from
    a kill because they are really just nops.

    This patch adds guard checks for kills around calls to ScanInstruction() where the DefIndices
    array is set. For good measure, add an assert in ScanInstruction() so we don't hit this bug again.

    The test case is a reduced version of the code from the bug report.

    Differential Revision: http://reviews.llvm.org/D4977

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216114 91177308-0d34-0410-b5e6-96231b3b80d8

Change-Id: Id952809e707b84ce0e28cf24d649b5c4ba932b22
Signed-off-by: Alexey Volkov <alexey.v.volkov@intel.com>
2 files changed