File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,36 @@ define i8 @shl_add(i8 %x, i8 %y) {
346
346
ret i8 %sh1
347
347
}
348
348
349
+ define i8 @shl_add_multiuse (i8 %x ) {
350
+ ; CHECK-LABEL: @shl_add_multiuse(
351
+ ; CHECK-NEXT: [[SH0:%.*]] = shl i8 [[X:%.*]], 3
352
+ ; CHECK-NEXT: [[R:%.*]] = add i8 [[SH0]], -42
353
+ ; CHECK-NEXT: call void @use(i8 [[SH0]])
354
+ ; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R]], 2
355
+ ; CHECK-NEXT: ret i8 [[SH1]]
356
+ ;
357
+ %sh0 = shl i8 %x , 3
358
+ %r = add i8 %sh0 , -42
359
+ call void @use (i8 %sh0 )
360
+ %sh1 = shl i8 %r , 2
361
+ ret i8 %sh1
362
+ }
363
+
364
+ define i8 @shl_add_multiuse_nonconstant (i8 %x , i8 %y ) {
365
+ ; CHECK-LABEL: @shl_add_multiuse_nonconstant(
366
+ ; CHECK-NEXT: [[SH0:%.*]] = shl i8 [[X:%.*]], 3
367
+ ; CHECK-NEXT: [[R:%.*]] = add i8 [[SH0]], [[Y:%.*]]
368
+ ; CHECK-NEXT: call void @use(i8 [[SH0]])
369
+ ; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R]], 2
370
+ ; CHECK-NEXT: ret i8 [[SH1]]
371
+ ;
372
+ %sh0 = shl i8 %x , 3
373
+ %r = add i8 %sh0 , %y
374
+ call void @use (i8 %sh0 )
375
+ %sh1 = shl i8 %r , 2
376
+ ret i8 %sh1
377
+ }
378
+
349
379
define <2 x i8 > @shl_add_nonuniform (<2 x i8 > %x , <2 x i8 > %y ) {
350
380
; CHECK-LABEL: @shl_add_nonuniform(
351
381
; CHECK-NEXT: [[TMP1:%.*]] = shl <2 x i8> [[X:%.*]], <i8 5, i8 4>
You can’t perform that action at this time.
0 commit comments