Skip to content

Commit 6f1d83f

Browse files
committed
added motivation to shift-binop.ll
1 parent e317ee2 commit 6f1d83f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/shift-binop.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
33

4+
;define i32 @src(i32 %x, i32 %shamt, i32 %c) {
5+
; %shl = shl nuw i32 %x, %shamt
6+
; %c2 = shl nuw i32 %c, %shamt
7+
; %max = call i32 @llvm.umin(i32 %shl, i32 %c2)
8+
; ret i32 %max
9+
;}
10+
11+
;define i32 @tgt(i32 %x, i32 %shamt, i32 %c) {
12+
; %max = call i32 @llvm.umin(i32 %x, i32 %c)
13+
; %shl = shl i32 %max, %shamt
14+
; ret i32 %shl
15+
;}
16+
417
define i8 @src1(i8 %arg0) {
518
; CHECK-LABEL: @src1(
619
; CHECK-NEXT: [[SHL:%.*]] = shl nuw i8 [[ARG0:%.*]], 1

0 commit comments

Comments
 (0)