[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)
commitf09c7a3d0f958c82ecc0c27fc42b1c80cc4d70bb
tree99de08fb3fdce60aa8dcc5e2cd5e9fe0ed4d0eac
parent96ad05ec5e7555ab9ecf4adf9dcd055feb7b3425
[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.

llvm-svn: 244291
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/test/CodeGen/AArch64/fast-isel-branch-cond-mask.ll [new file with mode: 0644]