1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instsimplify -S | FileCheck %s
4 ; If computeKnownBits can do a simple look-through for extractelement
5 ; then instsimplify will know that %elt1 is non-negative at icmp.
6 define i1 @computeKnownBits_look_through_extractelt(<2 x i8> %vecin) {
7 ; CHECK-LABEL: @computeKnownBits_look_through_extractelt(
8 ; CHECK-NEXT: ret i1 false
10 %vec = zext <2 x i8> %vecin to <2 x i32>
11 %elt1 = extractelement <2 x i32> %vec, i32 1
12 %bool = icmp slt i32 %elt1, 0
16 ; If computeNumSignBits can do a simple look-through for extractelement
17 ; then instsimplify will remove the ashr.
18 define i32 @computeNumSignBits_look_through_extractelt(<2 x i1> %vecin) {
19 ; CHECK-LABEL: @computeNumSignBits_look_through_extractelt(
20 ; CHECK-NEXT: [[VEC:%.*]] = sext <2 x i1> [[VEC:%.*]]in to <2 x i32>
21 ; CHECK-NEXT: [[ELT0:%.*]] = extractelement <2 x i32> [[VEC]], i32 0
22 ; CHECK-NEXT: ret i32 [[ELT0]]
24 %vec = sext <2 x i1> %vecin to <2 x i32>
25 %elt0 = extractelement <2 x i32> %vec, i32 0
26 %ashr = ashr i32 %elt0, 5