llvm-mirror/test/CodeGen/X86/global-fill.ll
Benjamin Kramer d3a7e1b8f1 [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
2015-06-17 23:55:17 +00:00

28 lines
794 B
LLVM

; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
@test1 = global [2 x i24] [i24 -1, i24 -1]
; CHECK-LABEL: test1:
; CHECK-NEXT: .long 16777215
; CHECK-NEXT: .long 16777215
@test2 = global [2 x i7] [i7 1, i7 1]
; CHECK-LABEL: test2:
; CHECK-NEXT: .space 2,1
@test3 = global [4 x i128] [i128 -1, i128 -1, i128 -1, i128 -1]
; CHECK-LABEL: test3:
; CHECK-NEXT: .space 64,255
@test4 = global [3 x i16] [i16 257, i16 257, i16 257]
; CHECK-LABEL: test4:
; CHECK-NEXT: .space 6,1
@test5 = global [2 x [2 x i16]] [[2 x i16] [i16 257, i16 257], [2 x i16] [i16 -1, i16 -1]]
; CHECK-LABEL: test5:
; CHECK-NEXT: .space 4,1
; CHECK-NEXT: .space 4,255
@test6 = global [2 x [2 x i16]] [[2 x i16] [i16 257, i16 257], [2 x i16] [i16 257, i16 257]]
; CHECK-LABEL: test6:
; CHECK-NEXT: .space 8,1