[FastISel][AArch64] Don't fold instructions that are not in the same basic block.
authorJuergen Ributzka <juergen@apple.com>
Fri, 29 Aug 2014 00:19:21 +0000 (00:19 +0000)
committerJuergen Ributzka <juergen@apple.com>
Fri, 29 Aug 2014 00:19:21 +0000 (00:19 +0000)
commitcf45151b2c859e29f07ac1f77f69ac00f2ced4fc
tree5ad9f4ca293da204343e6272dc63abdf93f35e62
parent6acfc547061ddbc3cf78ef877ddca8363b5df741
[FastISel][AArch64] Don't fold instructions that are not in the same basic block.

This fix checks first if the instruction to be folded (e.g. sign-/zero-extend,
or shift) is in the same machine basic block as the instruction we are folding
into.

Not doing so can result in incorrect code, because the value might not be
live-out of the basic block, where the value is defined.

This fixes rdar://problem/18169495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216700 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64FastISel.cpp
test/CodeGen/AArch64/fast-isel-folding.ll [new file with mode: 0644]