[FastISel] Undo phi node updates when falling-back to SelectionDAG.
authorJuergen Ributzka <juergen@apple.com>
Thu, 28 Aug 2014 02:06:55 +0000 (02:06 +0000)
committerJuergen Ributzka <juergen@apple.com>
Thu, 28 Aug 2014 02:06:55 +0000 (02:06 +0000)
commit4a76317ebb880d4ea3d5fc9e80e9c02a2f69cee3
tree84b1f033cb0940800abe253fd35be3302a15e8cb
parentd24494d672f750493a6456ed76500aec053c24b0
[FastISel] Undo phi node updates when falling-back to SelectionDAG.

The included test case would fail, because the MI PHI node would have two
operands from the same predecessor.

This problem occurs when a switch instruction couldn't be selected. This happens
always, because there is no default switch support for FastISel to begin with.

The problem was that FastISel would first add the operand to the PHI nodes and
then fall-back to SelectionDAG, which would then in turn add the same operands
to the PHI nodes again.

This fix removes these duplicate PHI node operands by reseting the
PHINodesToUpdate to its original state before FastISel tried to select the
instruction.

This fixes <rdar://problem/18155224>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216640 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/FunctionLoweringInfo.h
lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/AArch64/fast-isel-switch-phi.ll [new file with mode: 0644]