diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-07-27 21:27:25 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-07-27 21:27:25 +0000 |
commit | 9f209a97f2f3427760418104e9bd0a65479809b7 (patch) | |
tree | f5d213ad71e642a571f05a3988abffffb4f4bee7 /test/CodeGen/AArch64/tbi.ll | |
parent | 876aa0d1c66ddcb1952d5153b4cb8486d5ac0ecc (diff) |
[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
Diffstat (limited to 'test/CodeGen/AArch64/tbi.ll')
-rw-r--r-- | test/CodeGen/AArch64/tbi.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/tbi.ll b/test/CodeGen/AArch64/tbi.ll index ab2d31b7cac..153bd4e6438 100644 --- a/test/CodeGen/AArch64/tbi.ll +++ b/test/CodeGen/AArch64/tbi.ll @@ -100,3 +100,14 @@ define i32 @ld_and32_narrower(i64 %p) { %load = load i32, i32* %cast ret i32 %load } + +; BOTH-LABEL:ld_and8: +; BOTH: and x +define i32 @ld_and8(i64 %base, i8 %off) { + %off_masked = and i8 %off, 63 + %off_64 = zext i8 %off_masked to i64 + %p = add i64 %base, %off_64 + %cast = inttoptr i64 %p to i32* + %load = load i32, i32* %cast + ret i32 %load +} |