[SDAG] Handle non-integer preferred memset types for non-constant values
[oota-llvm.git] / test / CodeGen / PowerPC / memset-nc.ll
1 ; RUN: llc < %s | FileCheck %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3 target triple = "powerpc64-bgq-linux"
4
5 ; Function Attrs: nounwind
6 define void @test_qpx() unnamed_addr #0 align 2 {
7 entry:
8   %0 = load i32, i32* undef, align 4
9   %1 = trunc i32 %0 to i8
10   call void @llvm.memset.p0i8.i64(i8* null, i8 %1, i64 64, i32 32, i1 false)
11   ret void
12
13 ; CHECK-LABEL: @test_qpx
14 ; CHECK: qvstfdx
15 ; CHECK: qvstfdx
16 ; CHECK: blr
17 }
18
19 ; Function Attrs: nounwind
20 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #1
21
22 ; Function Attrs: nounwind
23 define void @test_vsx() unnamed_addr #2 align 2 {
24 entry:
25   %0 = load i32, i32* undef, align 4
26   %1 = trunc i32 %0 to i8
27   call void @llvm.memset.p0i8.i64(i8* null, i8 %1, i64 32, i32 1, i1 false)
28   ret void
29
30 ; CHECK-LABEL: @test_vsx
31 ; CHECK: stxvw4x
32 ; CHECK: stxvw4x
33 ; CHECK: blr
34 }
35
36 attributes #0 = { nounwind "target-cpu"="a2q" }
37 attributes #1 = { nounwind }
38 attributes #2 = { nounwind "target-cpu"="pwr7" }
39