OSDN Git Service

[AArch64] Swap comparison operands if that enables some folding.
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Sat, 13 Oct 2018 07:43:56 +0000 (07:43 +0000)
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>
Sat, 13 Oct 2018 07:43:56 +0000 (07:43 +0000)
commit952b7309b14ccede0e01ccd43f85d8c28aa99280
tree4c79f70d4e456c61536dbafa7bddd5d08702f5a4
parent3baba1cf36ad30ab99ca557ab8f208c3be88aaaf
[AArch64] Swap comparison operands if that enables some folding.

Summary:
AArch64 can fold some shift+extend operations on the RHS operand of
comparisons, so swap the operands if that makes sense.

This provides a fix for https://bugs.llvm.org/show_bug.cgi?id=38751

Reviewers: efriedma, t.p.northover, javed.absar

Subscribers: mcrosier, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D53067

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344439 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/and-mask-removal.ll
test/CodeGen/AArch64/lack-of-signed-truncation-check.ll
test/CodeGen/AArch64/sat-add.ll
test/CodeGen/AArch64/signed-truncation-check.ll
test/CodeGen/AArch64/swap-compare-operands.ll [new file with mode: 0644]