File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,21 @@ define i8 @lshr_add(i8 %x, i8 %y) {
389
389
ret i8 %sh1
390
390
}
391
391
392
+ define i8 @lshr_add_multiuse (i8 %x ) {
393
+ ; CHECK-LABEL: @lshr_add_multiuse(
394
+ ; CHECK-NEXT: [[SH0:%.*]] = lshr i8 [[X:%.*]], 3
395
+ ; CHECK-NEXT: [[R:%.*]] = add nuw nsw i8 [[SH0]], 42
396
+ ; CHECK-NEXT: call void @use(i8 [[SH0]])
397
+ ; CHECK-NEXT: [[SH1:%.*]] = lshr i8 [[R]], 2
398
+ ; CHECK-NEXT: ret i8 [[SH1]]
399
+ ;
400
+ %sh0 = lshr i8 %x , 3
401
+ %r = add i8 %sh0 , 42 ; constant operand on the 'add'
402
+ call void @use (i8 %sh0 )
403
+ %sh1 = lshr i8 %r , 2
404
+ ret i8 %sh1
405
+ }
406
+
392
407
define <2 x i8 > @lshr_add_nonuniform (<2 x i8 > %x , <2 x i8 > %y ) {
393
408
; CHECK-LABEL: @lshr_add_nonuniform(
394
409
; CHECK-NEXT: [[SH0:%.*]] = lshr <2 x i8> [[X:%.*]], <i8 3, i8 4>
You can’t perform that action at this time.
0 commit comments