OSDN Git Service

[PowerPC] fix a bug in redundant compare elimination
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 20 Dec 2017 05:18:19 +0000 (05:18 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Wed, 20 Dec 2017 05:18:19 +0000 (05:18 +0000)
commitfeb947453af660e8488f8a1a9b49c325745d7738
tree21df19c6b50446dad38c96f71d674a7cb505674b
parent06400502e2d6e764bef0ff1135a9478a928e98ce
[PowerPC] fix a bug in redundant compare elimination

This patch fixes a bug in the redundant compare elimination reported in https://reviews.llvm.org/rL320786 and re-enables the optimization.

The redundant compare elimination assumes that we can replace signed comparison with unsigned comparison for the equality check. But due to the difference in the sign extension behavior we cannot change the opcode if the comparison is against an immediate and the most significant bit of the immediate is one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321147 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCMIPeephole.cpp
test/CodeGen/PowerPC/cmp_elimination.ll