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