[AArch64][FastISel] Fix integer extend optimization.
authorJuergen Ributzka <juergen@apple.com>
Thu, 9 Apr 2015 20:00:46 +0000 (20:00 +0000)
committerJuergen Ributzka <juergen@apple.com>
Thu, 9 Apr 2015 20:00:46 +0000 (20:00 +0000)
commit117bf240ef0fdb7646f4c3ccc88e8ff504bbac26
treec99e760ddacbad18df486904ef98f273418edd3d
parenta9fa357be4fe628909059eb358370e5d83c64f05
[AArch64][FastISel] Fix integer extend optimization.

The integer extend optimization tries to fold the extend into the load
instruction. This requires us to identify if the extend has already been
emitted or not and act accordingly on it.

The check that was originally performed for this was not sufficient. Besides
checking the ValueMap for a mapped register we also need to check if the
virtual register has already an associated machine instruction that defines it.

This fixes rdar://problem/20470788.

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