2015-12-12 08:01:10 +08:00
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
2009-07-19 07:06:53 +08:00
|
|
|
|
|
|
|
define double @a(<1 x i64> %y) {
|
2017-05-24 01:51:22 +08:00
|
|
|
; CHECK-LABEL: @a(
|
|
|
|
; CHECK-NEXT: [[BC:%.*]] = bitcast <1 x i64> %y to <1 x double>
|
|
|
|
; CHECK-NEXT: [[C:%.*]] = extractelement <1 x double> [[BC]], i32 0
|
|
|
|
; CHECK-NEXT: ret double [[C]]
|
|
|
|
;
|
2009-07-19 07:06:53 +08:00
|
|
|
%c = bitcast <1 x i64> %y to double
|
2015-12-12 08:01:10 +08:00
|
|
|
ret double %c
|
2009-07-19 07:06:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @b(<1 x i64> %y) {
|
2017-05-24 01:51:22 +08:00
|
|
|
; CHECK-LABEL: @b(
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <1 x i64> %y, i32 0
|
|
|
|
; CHECK-NEXT: ret i64 [[TMP1]]
|
|
|
|
;
|
2009-07-19 07:06:53 +08:00
|
|
|
%c = bitcast <1 x i64> %y to i64
|
2015-12-12 08:01:10 +08:00
|
|
|
ret i64 %c
|
2009-07-19 07:06:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define <1 x i64> @c(double %y) {
|
2017-05-24 01:51:22 +08:00
|
|
|
; CHECK-LABEL: @c(
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast double %y to i64
|
|
|
|
; CHECK-NEXT: [[C:%.*]] = insertelement <1 x i64> undef, i64 [[TMP1]], i32 0
|
|
|
|
; CHECK-NEXT: ret <1 x i64> [[C]]
|
|
|
|
;
|
2009-07-19 07:06:53 +08:00
|
|
|
%c = bitcast double %y to <1 x i64>
|
|
|
|
ret <1 x i64> %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define <1 x i64> @d(i64 %y) {
|
2017-05-24 01:51:22 +08:00
|
|
|
; CHECK-LABEL: @d(
|
|
|
|
; CHECK-NEXT: [[C:%.*]] = insertelement <1 x i64> undef, i64 %y, i32 0
|
|
|
|
; CHECK-NEXT: ret <1 x i64> [[C]]
|
|
|
|
;
|
2009-07-19 07:06:53 +08:00
|
|
|
%c = bitcast i64 %y to <1 x i64>
|
|
|
|
ret <1 x i64> %c
|
|
|
|
}
|
|
|
|
|