OSDN Git Service

[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)
authorClement Courbet <courbet@google.com>
Tue, 24 Oct 2017 08:05:07 +0000 (08:05 +0000)
committerClement Courbet <courbet@google.com>
Tue, 24 Oct 2017 08:05:07 +0000 (08:05 +0000)
commitda5585dcb14d735b1363063b1255a03e2582a484
tree781d8bc939713c8ea03ed97f72686734eca761e7
parent98150369032943ac04d6f1df4a3ed4b2787b0d01
[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)

Refactor ExpandMemcmp:

 - Stop duplicating the logic for computation of the sequence of loads to
   generate (thsi was done in three different places), this is now done
   only once in MemCmpExpansion::MemCmpExpansion().

 - Add a FIXME to expose a bug with the computation of the number of loads
   when not all sizes are loadable. For example, on X86-32 + SSE, possible
   loads are {16,4,2,1} bytes. The current code considers that all loads
   starting at MaxLoadSize are possible. This is not an issue right now as
   vector loads are not enabled, so I'm not fixing the issue here to keep
   the change as small as possible. I'm going to address this in a
   subsequent revision, where I enable vector loads.

See https://bugs.llvm.org/show_bug.cgi?id=34887

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

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