[AArch64][GlobalISel] Use ZExtValue for zext(xor) when invert tb(n)z
authorguopeilin <guopeilin1@huawei.com>
Mon, 6 Sep 2021 03:11:23 +0000 (11:11 +0800)
committerguopeilin <guopeilin1@huawei.com>
Mon, 6 Sep 2021 03:12:07 +0000 (11:12 +0800)
commit5f48c144c58f6d23e850a1978a6fe05887103b17
treec9a8577f198412a6d715ef6d5b6878c4e1b77624
parentfa69ccd189694d0b992323738443ac05a2bcb9ca
[AArch64][GlobalISel] Use ZExtValue for zext(xor) when invert tb(n)z

Currently, we use SExtValue to decide whether to invert tbz or tbnz.
However, for the case zext (xor x, c), we should use ZExt rather
than SExt otherwise we will generate totally opposite branches.

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D108755
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-xor-tbz-tbnz.mir