OSDN Git Service

[AArch64][GlobalISel] Walk through G_TRUNC in getTestBitReg
authorJessica Paquette <jpaquette@apple.com>
Thu, 30 Jan 2020 22:53:37 +0000 (14:53 -0800)
committerJessica Paquette <jpaquette@apple.com>
Fri, 31 Jan 2020 19:09:55 +0000 (11:09 -0800)
commitb9bf9305d108d9f9d017d84dc38f4d0a88c5d505
tree540b913a882fd533c5666948acba712dd84da1db
parent574685b879acff462faa1e5e480825033c589778
[AArch64][GlobalISel] Walk through G_TRUNC in getTestBitReg

When you encounter a G_TRUNC, you are moving from a larger type to a smaller
type.

Asking for the i-th bit on a larger value is the same as asking for the i-th
bit on a smaller value.

So, we should always be able to walk through G_TRUNC when computing the bit
for a TB(N)Z.

Differential Revision: https://reviews.llvm.org/D73748
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-trunc-tbz-tbnz.mir [new file with mode: 0644]