1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S -instcombine-infinite-loop-threshold=2 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 ; A copy of assume.ll, with undef at insertelement/shufflevector replaced with
9 declare void @llvm.assume(i1) #1
12 ; Does it ever make sense to peek through a bitcast of the icmp operand?
14 define i32 @PR40940(<4 x i8> %x) {
15 ; CHECK-LABEL: @PR40940(
16 ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i8> [[X:%.*]], <4 x i8> poison, <4 x i32> <i32 1, i32 1, i32 2, i32 3>
17 ; CHECK-NEXT: [[T2:%.*]] = bitcast <4 x i8> [[SHUF]] to i32
18 ; CHECK-NEXT: [[T3:%.*]] = icmp ult i32 [[T2]], 65536
19 ; CHECK-NEXT: call void @llvm.assume(i1 [[T3]])
20 ; CHECK-NEXT: ret i32 [[T2]]
22 %shuf = shufflevector <4 x i8> %x, <4 x i8> poison, <4 x i32> <i32 1, i32 1, i32 2, i32 3>
23 %t2 = bitcast <4 x i8> %shuf to i32
24 %t3 = icmp ult i32 %t2, 65536
25 call void @llvm.assume(i1 %t3)