[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)
commitc6e8bfc41dafcb3c886991210a6681fb5337be94
tree2d33a56618bdf258d946b1a873c21a6d6fbdb39e
parent29c5edcdec764fbf67ae852bddcbd57c35e99769
[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

llvm-svn: 239977
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/test/CodeGen/X86/global-fill.ll [new file with mode: 0644]