[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)
commitefd5177d5e0f190902b9a0107a2cef2b805cafa5
tree9281af8b491b969ced7ed5908739c4b72005de44
parent3c0d385598c4bf2b77448e4cc2d5965f7a5885e0
[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

llvm-svn: 316417
llvm/lib/CodeGen/CodeGenPrepare.cpp