OSDN Git Service

[CGP, PowerPC] try to constant fold before creating loads for memcmp expansion
authorSanjay Patel <spatel@rotateright.com>
Mon, 19 Jun 2017 19:48:35 +0000 (19:48 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 19 Jun 2017 19:48:35 +0000 (19:48 +0000)
commit7a0e66cc56651377d3288a18b37071ae03a0ba2c
tree9ba6dad163043075471663169da2bdce7675a81e
parent3fe8da4e8c808d5dabe7d7f67b7a7c3cbbcbd094
[CGP, PowerPC] try to constant fold before creating loads for memcmp expansion

This is the last step needed to avoid regressions for x86 before we flip the switch to allow
expansion of the smallest set of memcpy() via CGP. The DAG version checks for constant strings,
so we need to do that here too.

FWIW, the 2 constant test is not handled by LibCallSimplifier::optimizeMemCmp() because that
code is limited to 8-bit constant arrays. LibCallSimplifier will also fail to optimize some 1
constant tests because its alignment requirements are too strict (shouldn't require alignment
for a constant operand).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305734 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll