[FastISel]
authorJuergen Ributzka <juergen@apple.com>
Thu, 28 Aug 2014 00:09:46 +0000 (00:09 +0000)
committerJuergen Ributzka <juergen@apple.com>
Thu, 28 Aug 2014 00:09:46 +0000 (00:09 +0000)
commitd24494d672f750493a6456ed76500aec053c24b0
tree22e99b01543470c259a3c86f4064dceaa56ba0f7
parenta26b1bdcc8d69f504357beda5168df292d2c84b3
[FastISel]

Currently instructions are folded very aggressively for AArch64 into the memory
operation, which can lead to the use of killed operands:
  %vreg1<def> = ADDXri %vreg0<kill>, 2
  %vreg2<def> = LDRBBui %vreg0, 2
  ... = ... %vreg1 ...

This usually happens when the result is also used by another non-memory
instruction in the same basic block, or any instruction in another basic block.

This fix teaches hasTrivialKill to not only check the LLVM IR that the value has
a single use, but also to check if the register that represents that value has
already been used. This can happen when the instruction with the use was folded
into another instruction (in this particular case a load instruction).

This fixes rdar://problem/18142857.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216634 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/FastISel.h
lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/AArch64/fast-isel-addressing-modes.ll