]> granicus.if.org Git - llvm/commit
Re-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"
authorClement Courbet <courbet@google.com>
Wed, 25 Oct 2017 11:02:09 +0000 (11:02 +0000)
committerClement Courbet <courbet@google.com>
Wed, 25 Oct 2017 11:02:09 +0000 (11:02 +0000)
commit5b353cb3fb9f242e0debe6a50d0ce2a8b63b3146
treea8fe6612c64ff6aca3a58a969ef587b1179df854
parentdb07f4c8a7d27039cb9b8e6c850de11f91060412
Re-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"

Compute the actual decomposition only after deciding whether to expand
of not. Else, it's easy to make the compiler OOM with:
`memcpy(dst, src, 0xffffffffffffffff);`, which typically happens if
someone mistakenly passes a negative value. Add a test.

This reverts commit f8fc02fbd4ab33383c010d33675acf9763d0bd44.

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