2020-03-30 23:58:54 +02:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
2019-04-17 06:52:47 +02:00
|
|
|
; RUN: opt < %s -instcombine -S -o - | FileCheck %s
|
|
|
|
|
|
|
|
define i32 @a(<4 x i64> %I) {
|
2020-03-30 23:58:54 +02:00
|
|
|
; CHECK-LABEL: @a(
|
2020-03-29 21:48:54 +02:00
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i64> [[I:%.*]] to <8 x i32>
|
|
|
|
; CHECK-NEXT: [[K:%.*]] = extractelement <8 x i32> [[TMP1]], i32 6
|
2020-03-30 23:58:54 +02:00
|
|
|
; CHECK-NEXT: ret i32 [[K]]
|
|
|
|
;
|
|
|
|
%J = trunc <4 x i64> %I to <4 x i32>
|
|
|
|
%K = extractelement <4 x i32> %J, i32 3
|
|
|
|
ret i32 %K
|
2019-04-17 06:52:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @b(<4 x float> %I) {
|
2020-03-30 23:58:54 +02:00
|
|
|
; CHECK-LABEL: @b(
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x float> [[I:%.*]], i32 3
|
|
|
|
; CHECK-NEXT: [[K:%.*]] = fptosi float [[TMP1]] to i32
|
|
|
|
; CHECK-NEXT: ret i32 [[K]]
|
|
|
|
;
|
|
|
|
%J = fptosi <4 x float> %I to <4 x i32>
|
|
|
|
%K = extractelement <4 x i32> %J, i32 3
|
|
|
|
ret i32 %K
|
2019-04-17 06:52:47 +02:00
|
|
|
}
|
|
|
|
|