[AArch64][FastISel] Always use AND before checking the branch flag.
authorJuergen Ributzka <juergen@apple.com>
Thu, 6 Aug 2015 22:44:15 +0000 (22:44 +0000)
committerJuergen Ributzka <juergen@apple.com>
Thu, 6 Aug 2015 22:44:15 +0000 (22:44 +0000)
commit138cd6dae83ff8802cc9fd16fae4efb0a6a6ab11
tree10b556fe0abfbcc164a7157d208c9b436ac64d0e
parent6f653ee44c24a4e8190e741b1d493651e6ebaded
[AArch64][FastISel] Always use AND before checking the branch flag.

When we are not emitting the condition for the branch, because the condition is
in another BB or SDAG did the selection for us, then we have to mask the flag in
the register with AND.

This is required when the condition comes from a truncate, because SDAG only
truncates down to a legal size of i32.

This fixes rdar://problem/22161062.

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