cmp.ll 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck -check-prefix=CHECK -check-prefix=AVX1 %s
  2. ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=core-avx2 | FileCheck -check-prefix=CHECK -check-prefix=AVX2 %s
  3. ; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=knl | FileCheck -check-prefix=CHECK -check-prefix=AVX512 %s
  4. 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"
  5. target triple = "x86_64-apple-macosx10.8.0"
  6. define i32 @cmp(i32 %arg) {
  7. ; -- floats --
  8. ;AVX1: cost of 1 {{.*}} fcmp
  9. ;AVX2: cost of 1 {{.*}} fcmp
  10. %A = fcmp olt <2 x float> undef, undef
  11. ;AVX1: cost of 1 {{.*}} fcmp
  12. ;AVX2: cost of 1 {{.*}} fcmp
  13. %B = fcmp olt <4 x float> undef, undef
  14. ;AVX1: cost of 1 {{.*}} fcmp
  15. ;AVX2: cost of 1 {{.*}} fcmp
  16. %C = fcmp olt <8 x float> undef, undef
  17. ;AVX1: cost of 1 {{.*}} fcmp
  18. ;AVX2: cost of 1 {{.*}} fcmp
  19. %D = fcmp olt <2 x double> undef, undef
  20. ;AVX1: cost of 1 {{.*}} fcmp
  21. ;AVX2: cost of 1 {{.*}} fcmp
  22. %E = fcmp olt <4 x double> undef, undef
  23. ; AVX512: cost of 1 {{.*}} %E1 = fcmp
  24. %E1 = fcmp olt <16 x float> undef, undef
  25. ; AVX512: cost of 2 {{.*}} %E2 = fcmp
  26. %E2 = fcmp olt <16 x double> undef, undef
  27. ; -- integers --
  28. ;AVX1: cost of 1 {{.*}} icmp
  29. ;AVX2: cost of 1 {{.*}} icmp
  30. %F = icmp eq <16 x i8> undef, undef
  31. ;AVX1: cost of 1 {{.*}} icmp
  32. ;AVX2: cost of 1 {{.*}} icmp
  33. %G = icmp eq <8 x i16> undef, undef
  34. ;AVX1: cost of 1 {{.*}} icmp
  35. ;AVX2: cost of 1 {{.*}} icmp
  36. %H = icmp eq <4 x i32> undef, undef
  37. ;AVX1: cost of 1 {{.*}} icmp
  38. ;AVX2: cost of 1 {{.*}} icmp
  39. %I = icmp eq <2 x i64> undef, undef
  40. ;AVX1: cost of 4 {{.*}} icmp
  41. ;AVX2: cost of 1 {{.*}} icmp
  42. %J = icmp eq <4 x i64> undef, undef
  43. ;AVX1: cost of 4 {{.*}} icmp
  44. ;AVX2: cost of 1 {{.*}} icmp
  45. %K = icmp eq <8 x i32> undef, undef
  46. ;AVX1: cost of 4 {{.*}} icmp
  47. ;AVX2: cost of 1 {{.*}} icmp
  48. %L = icmp eq <16 x i16> undef, undef
  49. ;AVX1: cost of 4 {{.*}} icmp
  50. ;AVX2: cost of 1 {{.*}} icmp
  51. %M = icmp eq <32 x i8> undef, undef
  52. ; AVX512: cost of 1 {{.*}} %M1 = icmp
  53. %M1 = icmp eq <16 x i32> undef, undef
  54. ; AVX512: cost of 2 {{.*}} %M2 = icmp
  55. %M2 = icmp eq <16 x i64> undef, undef
  56. ;CHECK: cost of 0 {{.*}} ret
  57. ret i32 undef
  58. }