Tag build swift-4.0-DEVELOPMENT-SNAPSHOT-2017-08-01-a
[AArch64] Fix legality info passed to demanded bits for TBI opt.

The (seldom-used) TBI-aware optimization had a typo lying dormant since
it was first introduced, in r252573:  when asking for demanded bits, it
told TLI that it was running after legalize, where the opposite was
true.

This is an important piece of information, that the demanded bits
analysis uses to make assumptions about the node.  r301019 added such an
assumption, which was broken by the TBI combine.

Instead, pass the correct flags to TLO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309323 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 9f209a97f2f3427760418104e9bd0a65479809b7)

Conflicts:
      lib/Target/AArch64/AArch64ISelLowering.cpp

rdar://33223810
2 files changed