OSDN Git Service

[PowerPC] Use helper functions to check sign-/zero-extended value
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 18 Oct 2017 10:31:19 +0000 (10:31 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 18 Oct 2017 10:31:19 +0000 (10:31 +0000)
commitcbd850f350921d0afdbdee35d5599b257cd1e8b3
treeedbdc481fc989ed45495449b109f6c633d43ba6f
parent42759c20ed438ba600d364de2c2e91b0a335ab3e
[PowerPC] Use helper functions to check sign-/zero-extended value

Helper functions to identify sign- and zero-extending machine instruction is introduced in rL315888.
This patch makes PPCInstrInfo::optimizeCompareInstr use the helper functions. It simplifies the code and also makes possible more optimizations since the helper can do more analysis than the original check code; I observed about 5000 more compare instructions are eliminated while building LLVM.

Also, this patch fixes a bug in helpers on ANDIo instruction handling due to the order of checks. This bug causes a failure in an existing test case for optimizeCompareInstr.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316071 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCInstrInfo.cpp
test/CodeGen/PowerPC/opt-cmp-inst-cr0-live.ll