[AsmPrinter] Make isRepeatedByteSequence smarter about odd integer types
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 17 Jun 2015 23:55:17 +0000 (23:55 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 17 Jun 2015 23:55:17 +0000 (23:55 +0000)
commit24e04b80a5bb043943d140f86c2f1ed88cc7982f
treece0d7c19de31c9f6ab2c13f9e1fb20bcc5831c8d
parentc5f2ede9f6e04c3eba1c6d09698f9a0bc662bf9e
[AsmPrinter] Make isRepeatedByteSequence smarter about odd integer types

- zext the value to alloc size first, then check if the value repeats
  with zero padding included. If so we can still emit a .space
- Do the checking with APInt.isSplat(8), which handles non-pow2 types
- Also handle large constants (bit width > 64)
- In a ConstantArray all elements have the same type, so it's sufficient
  to check the first constant recursively and then just compare if all
  following constants are the same by pointer compare

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239977 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
test/CodeGen/X86/global-fill.ll [new file with mode: 0644]