blob: 115316efea05b8e2294ba57bdfbcf940673b01dd [file]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -passes=instcombine < %s | FileCheck %s
; Make sure we don't pull shufflevector through an intrinsic that returns a struct.
define { <4 x i32>, <4 x i1> } @sadd_ov_shuffle_ops(<4 x i32> %x) {
; CHECK-LABEL: define { <4 x i32>, <4 x i1> } @sadd_ov_shuffle_ops(
; CHECK-SAME: <4 x i32> [[X:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <4 x i32> [[X]], <4 x i32> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[OV:%.*]] = call { <4 x i32>, <4 x i1> } @llvm.sadd.with.overflow.v4i32(<4 x i32> [[SPLAT]], <4 x i32> splat (i32 1))
; CHECK-NEXT: ret { <4 x i32>, <4 x i1> } [[OV]]
;
entry:
%splat = shufflevector <4 x i32> %x, <4 x i32> poison, <4 x i32> zeroinitializer
%ov = call { <4 x i32>, <4 x i1> } @llvm.sadd.with.overflow.v4i32(<4 x i32> %splat, <4 x i32> splat (i32 1))
ret { <4 x i32>, <4 x i1> } %ov
}
define { <4 x float>, <4 x i32> } @frexp_ov_shuffle_ops(<4 x float> %x) {
; CHECK-LABEL: define { <4 x float>, <4 x i32> } @frexp_ov_shuffle_ops(
; CHECK-SAME: <4 x float> [[X:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <4 x float> [[X]], <4 x float> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[OV:%.*]] = call { <4 x float>, <4 x i32> } @llvm.frexp.v4f32.v4i32(<4 x float> [[SPLAT]])
; CHECK-NEXT: ret { <4 x float>, <4 x i32> } [[OV]]
;
entry:
%splat = shufflevector <4 x float> %x, <4 x float> poison, <4 x i32> zeroinitializer
%ov = call { <4 x float>, <4 x i32> } @llvm.frexp(<4 x float> %splat)
ret { <4 x float>, <4 x i32> } %ov
}