[InstCombine] add value names to test; NFC

That makes it easier to mix and match lines into other tests.

llvm-svn: 336289
This commit is contained in:
Sanjay Patel 2018-07-04 16:56:35 +00:00
parent 936c74ad0d
commit ad32d22e13
1 changed files with 17 additions and 17 deletions

View File

@ -1,24 +1,24 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -instcombine < %s | FileCheck %s
; TODO: The entire thing should be folded to and i16 %0, 255.
define i16 @foo(i16 ) {
define i16 @foo(i16 %x) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP1:%.*]] = and i16 [[TMP0:%.*]], 255
; CHECK-NEXT: [[TMP2:%.*]] = zext i16 [[TMP1]] to i32
; CHECK-NEXT: [[TMP3:%.*]] = icmp ult i32 [[TMP2]], 255
; CHECK-NEXT: [[TMP4:%.*]] = select i1 [[TMP3]], i32 [[TMP2]], i32 255
; CHECK-NEXT: [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
; CHECK-NEXT: [[TMP6:%.*]] = and i16 [[TMP5]], 255
; CHECK-NEXT: ret i16 [[TMP6]]
; CHECK-NEXT: [[T1:%.*]] = and i16 [[X:%.*]], 255
; CHECK-NEXT: [[T2:%.*]] = zext i16 [[T1]] to i32
; CHECK-NEXT: [[T3:%.*]] = icmp ult i32 [[T2]], 255
; CHECK-NEXT: [[T4:%.*]] = select i1 [[T3]], i32 [[T2]], i32 255
; CHECK-NEXT: [[T5:%.*]] = trunc i32 [[T4]] to i16
; CHECK-NEXT: [[T6:%.*]] = and i16 [[T5]], 255
; CHECK-NEXT: ret i16 [[T6]]
;
entry:
%1 = and i16 %0, 255
%2 = zext i16 %1 to i32
%3 = icmp ult i32 %2, 255
%4 = select i1 %3, i32 %2, i32 255
%5 = trunc i32 %4 to i16
%6 = and i16 %5, 255
ret i16 %6
%t1 = and i16 %x, 255
%t2 = zext i16 %t1 to i32
%t3 = icmp ult i32 %t2, 255
%t4 = select i1 %t3, i32 %t2, i32 255
%t5 = trunc i32 %t4 to i16
%t6 = and i16 %t5, 255
ret i16 %t6
}