blob: a17573d2f61b2abd52a0375d2dd7ffcc8009189a [file] [log] [blame]
Simon Pilgrim9961c552019-01-13 21:21:46 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE2
3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE,SSE41
4; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE,SSE42
5; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1
6; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2
7; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX,AVX512,AVX512F
8; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX,AVX512,AVX512BW
9
10declare i32 @llvm.ssub.sat.i32 (i32, i32)
11declare i64 @llvm.ssub.sat.i64 (i64, i64)
12declare <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16>, <8 x i16>)
13
14; fold (ssub_sat c, 0) -> x
15define i32 @combine_zero_i32(i32 %a0) {
16; CHECK-LABEL: combine_zero_i32:
17; CHECK: # %bb.0:
Simon Pilgrim897d4c62019-01-13 21:50:24 +000018; CHECK-NEXT: movl %edi, %eax
Simon Pilgrim9961c552019-01-13 21:21:46 +000019; CHECK-NEXT: retq
20 %1 = call i32 @llvm.ssub.sat.i32(i32 %a0, i32 0);
21 ret i32 %1
22}
23
24define <8 x i16> @combine_zero_v8i16(<8 x i16> %a0) {
Simon Pilgrim897d4c62019-01-13 21:50:24 +000025; CHECK-LABEL: combine_zero_v8i16:
26; CHECK: # %bb.0:
27; CHECK-NEXT: retq
Simon Pilgrim9961c552019-01-13 21:21:46 +000028 %1 = call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> %a0, <8 x i16> zeroinitializer);
29 ret <8 x i16> %1
30}