[AArch64] Add pass to enable additional comparison optimizations by CSE.
authorJiangning Liu <jiangning.liu@arm.com>
Fri, 5 Sep 2014 02:55:24 +0000 (02:55 +0000)
committerJiangning Liu <jiangning.liu@arm.com>
Fri, 5 Sep 2014 02:55:24 +0000 (02:55 +0000)
commitb20b9bf9fd60ba1d769e33ff6680099473d59a7d
treeaf59c0baf0f7f84a44e5c15c276c5e971abffc20
parent7935e70de2e0cce7d9f2a03e67c63829cefd48a9
[AArch64] Add pass to enable additional comparison optimizations by CSE.

Patched by Sergey Dmitrouk.

This pass tries to make consecutive compares of values use same operands to
allow CSE pass to remove duplicated instructions. For this it analyzes
branches and adjusts comparisons with immediate values by converting:

GE -> GT
GT -> GE
LT -> LE
LE -> LT

and adjusting immediate values appropriately. It basically corrects two
immediate values towards each other to make them equal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217220 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64.h
lib/Target/AArch64/AArch64ConditionOptimizer.cpp [new file with mode: 0644]
lib/Target/AArch64/AArch64TargetMachine.cpp
lib/Target/AArch64/CMakeLists.txt
test/CodeGen/AArch64/combine-comparisons-by-cse.ll [new file with mode: 0644]