[X86][FastISel] During X86 fastisel, the address of indirect call was resolved
authorQuentin Colombet <qcolombet@apple.com>
Mon, 14 Oct 2013 22:32:09 +0000 (22:32 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 14 Oct 2013 22:32:09 +0000 (22:32 +0000)
commit41d6f451a50fa669fa3f71acc741de3c35f4bb40
treea1529530f9e21708113771770791b1cb819a6ba2
parenta6a9ac5aa1092067e6e1546226d8bdd6a4bfcf99
[X86][FastISel] During X86 fastisel, the address of indirect call was resolved
through bitcast, ptrtoint, and inttoptr instructions. This is valid
only if the related instructions are in that same basic block, otherwise
we may reference variables that were not live accross basic blocks
resulting in undefined virtual registers.

The bug was exposed when both SDISel and FastISel were used within the same
function, i.e., one basic block is issued with FastISel and another with SDISel,
as demonstrated with the testcase.

<rdar://problem/15192473>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192636 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/2013-10-14-FastISel-incorrect-vreg.ll [new file with mode: 0644]