bitcast-vec-uniform.ll 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ; RUN: opt < %s -instcombine -S | FileCheck %s
  2. ; CHECK-LABEL: @a(
  3. ; CHECK-NOT: bitcast
  4. ; CHECK: ret
  5. define <4 x i32> @a(<1 x i64> %y) {
  6. %c = bitcast <2 x i64> <i64 0, i64 0> to <4 x i32>
  7. ret <4 x i32> %c
  8. }
  9. ; CHECK-LABEL: @b(
  10. ; CHECK-NOT: bitcast
  11. ; CHECK: ret
  12. define <4 x i32> @b(<1 x i64> %y) {
  13. %c = bitcast <2 x i64> <i64 -1, i64 -1> to <4 x i32>
  14. ret <4 x i32> %c
  15. }
  16. ; CHECK-LABEL: @foo(
  17. ; CHECK-NOT: bitcast
  18. ; CHECK: ret
  19. ; from MultiSource/Benchmarks/Bullet
  20. define <2 x float> @foo() {
  21. %cast = bitcast i64 -1 to <2 x float>
  22. ret <2 x float> %cast
  23. }
  24. ; CHECK-LABEL: @foo2(
  25. ; CHECK-NOT: bitcast
  26. ; CHECK: ret
  27. define <2 x double> @foo2() {
  28. %cast = bitcast i128 -1 to <2 x double>
  29. ret <2 x double> %cast
  30. }
  31. ; CHECK-LABEL: @foo3(
  32. ; CHECK-NOT: bitcast
  33. ; CHECK: ret
  34. define <1 x float> @foo3() {
  35. %cast = bitcast i32 -1 to <1 x float>
  36. ret <1 x float> %cast
  37. }
  38. ; CHECK-LABEL: @foo4(
  39. ; CHECK-NOT: bitcast
  40. ; CHECK: ret
  41. define float @foo4() {
  42. %cast = bitcast <1 x i32 ><i32 -1> to float
  43. ret float %cast
  44. }
  45. ; CHECK-LABEL: @foo5(
  46. ; CHECK-NOT: bitcast
  47. ; CHECK: ret
  48. define double @foo5() {
  49. %cast = bitcast <2 x i32 ><i32 -1, i32 -1> to double
  50. ret double %cast
  51. }
  52. ; CHECK-LABEL: @foo6(
  53. ; CHECK-NOT: bitcast
  54. ; CHECK: ret
  55. define <2 x double> @foo6() {
  56. %cast = bitcast <4 x i32><i32 -1, i32 -1, i32 -1, i32 -1> to <2 x double>
  57. ret <2 x double> %cast
  58. }