load_store.ll 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
  3. target triple = "x86_64-apple-macosx10.8.0"
  4. define i32 @stores(i32 %arg) {
  5. ;CHECK: cost of 1 {{.*}} store
  6. store i8 undef, i8* undef, align 4
  7. ;CHECK: cost of 1 {{.*}} store
  8. store i16 undef, i16* undef, align 4
  9. ;CHECK: cost of 1 {{.*}} store
  10. store i32 undef, i32* undef, align 4
  11. ;CHECK: cost of 1 {{.*}} store
  12. store i64 undef, i64* undef, align 4
  13. ;CHECK: cost of 2 {{.*}} store
  14. store i128 undef, i128* undef, align 4
  15. ;CHECK: cost of 1 {{.*}} store
  16. store <4 x i16> undef, <4 x i16>* undef, align 4
  17. ;CHECK: cost of 1 {{.*}} store
  18. store <4 x i32> undef, <4 x i32>* undef, align 4
  19. ;CHECK: cost of 2 {{.*}} store
  20. store <4 x i64> undef, <4 x i64>* undef, align 4
  21. ;CHECK: cost of 1 {{.*}} store
  22. store <8 x i16> undef, <8 x i16>* undef, align 4
  23. ;CHECK: cost of 2 {{.*}} store
  24. store <8 x i32> undef, <8 x i32>* undef, align 4
  25. ;CHECK: cost of 4 {{.*}} store
  26. store <8 x i64> undef, <8 x i64>* undef, align 4
  27. ret i32 undef
  28. }
  29. define i32 @loads(i32 %arg) {
  30. ;CHECK: cost of 1 {{.*}} load
  31. load i8, i8* undef, align 4
  32. ;CHECK: cost of 1 {{.*}} load
  33. load i16, i16* undef, align 4
  34. ;CHECK: cost of 1 {{.*}} load
  35. load i32, i32* undef, align 4
  36. ;CHECK: cost of 1 {{.*}} load
  37. load i64, i64* undef, align 4
  38. ;CHECK: cost of 2 {{.*}} load
  39. load i128, i128* undef, align 4
  40. ;CHECK: cost of 1 {{.*}} load
  41. load <2 x i32>, <2 x i32>* undef, align 4
  42. ;CHECK: cost of 1 {{.*}} load
  43. load <4 x i32>, <4 x i32>* undef, align 4
  44. ;CHECK: cost of 2 {{.*}} load
  45. load <8 x i32>, <8 x i32>* undef, align 4
  46. ;CHECK: cost of 1 {{.*}} load
  47. load <2 x i64>, <2 x i64>* undef, align 4
  48. ;CHECK: cost of 2 {{.*}} load
  49. load <4 x i64>, <4 x i64>* undef, align 4
  50. ;CHECK: cost of 4 {{.*}} load
  51. load <8 x i64>, <8 x i64>* undef, align 4
  52. ;CHECK: cost of 3 {{.*}} load
  53. load <3 x float>, <3 x float>* undef, align 4
  54. ;CHECK: cost of 3 {{.*}} load
  55. load <3 x double>, <3 x double>* undef, align 4
  56. ;CHECK: cost of 3 {{.*}} load
  57. load <3 x i32>, <3 x i32>* undef, align 4
  58. ;CHECK: cost of 3 {{.*}} load
  59. load <3 x i64>, <3 x i64>* undef, align 4
  60. ;CHECK: cost of 10 {{.*}} load
  61. load <5 x i32>, <5 x i32>* undef, align 4
  62. ;CHECK: cost of 10 {{.*}} load
  63. load <5 x i64>, <5 x i64>* undef, align 4
  64. ret i32 undef
  65. }