reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
; RUN: llc -march=hexagon -O3 -hexagon-small-data-threshold=0 < %s | FileCheck %s
; This lit test validates that storetrunc for a 64bit value picks a store
; absolute pattern instead of base + index store pattern. This will facilitate
; the constant extender optimization pass to move the immediate value to a register
; if there are more than two uses and replace all the uses of the constant.
; Generation of absolute pattern for a 64 bit truncated value also aviods an
; extra move.

@g0 = external global i8, align 8
@g1 = external global i16, align 8
@g2 = external global i32, align 8

; CHECK-LABEL: f0:
; CHECK: memd(##441656) = r{{[0-9]+}}
define void @f0(i64 %a0) #0 {
b0:
  store volatile i64 %a0, i64* inttoptr (i32 441656 to i64*)
  ret void
}

; CHECK-LABEL: f1:
; CHECK: memw(##441656) = r{{[0-9]+}}
define void @f1(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i32
  store volatile i32 %v0, i32* inttoptr (i32 441656 to i32*)
  ret void
}

; CHECK-LABEL: f2:
; CHECK: memh(##441656) = r{{[0-9]+}}
define void @f2(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i16
  store volatile i16 %v0, i16* inttoptr (i32 441656 to i16*)
  ret void
}

; CHECK-LABEL: f3:
; CHECK: memb(##441656) = r{{[0-9]+}}
define void @f3(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i8
  store volatile i8 %v0, i8* inttoptr (i32 441656 to i8*)
  ret void
}

; CHECK-LABEL: f4:
; CHECK: memw(##g2) = r{{[0-9]+}}
define void @f4(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i32
  store volatile i32 %v0, i32* @g2
  ret void
}

; CHECK-LABEL: f5:
; CHECK: memh(##g1) = r{{[0-9]+}}
define void @f5(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i16
  store volatile i16 %v0, i16* @g1
  ret void
}

; CHECK-LABEL: f6:
; CHECK: memb(##g0) = r{{[0-9]+}}
define void @f6(i64 %a0) #0 {
b0:
  %v0 = trunc i64 %a0 to i8
  store volatile i8 %v0, i8* @g0
  ret void
}

attributes #0 = { nounwind }