[FastISel][AArch64] Fold sign-/zero-extends into the load instruction.
authorJuergen Ributzka <juergen@apple.com>
Tue, 30 Sep 2014 00:49:58 +0000 (00:49 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 30 Sep 2014 00:49:58 +0000 (00:49 +0000)
commita0af4b027199fa5c77e8b1a28b9df769db261958
tree85cc4dc4a1678fe380ff9f30ec1efe2673d9cf3a
parente8a9706edad32f851d6008e38ae88ea296ecb6fd
[FastISel][AArch64] Fold sign-/zero-extends into the load instruction.

The sign-/zero-extension of the loaded value can be performed by the memory
instruction for free. If the result of the load has only one use and the use is
a sign-/zero-extend, then we emit the proper load instruction. The extend is
only a register copy and will be optimized away later on.

Other instructions that consume the sign-/zero-extended value are also made
aware of this fact, so they don't fold the extend too.

This fixes rdar://problem/18495928.

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