We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25063be commit fd53128Copy full SHA for fd53128
llvm/test/Transforms/InstCombine/shift-logic.ll
@@ -430,6 +430,21 @@ define i8 @shl_sub(i8 %x, i8 %y) {
430
ret i8 %sh1
431
}
432
433
+define i8 @shl_sub_multiuse(i8 %x) {
434
+; CHECK-LABEL: @shl_sub_multiuse(
435
+; CHECK-NEXT: [[SH0:%.*]] = shl i8 [[X:%.*]], 3
436
+; CHECK-NEXT: [[R:%.*]] = sub i8 [[SH0]], 42
437
+; CHECK-NEXT: call void @use(i8 [[SH0]])
438
+; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R]], 2
439
+; CHECK-NEXT: ret i8 [[SH1]]
440
+;
441
+ %sh0 = shl i8 %x, 3
442
+ %r = sub i8 %sh0, 42
443
+ call void @use(i8 %sh0)
444
+ %sh1 = shl i8 %r, 2
445
+ ret i8 %sh1
446
+}
447
+
448
; Make sure we don't commute operands for sub
449
define i8 @shl_sub_no_commute(i8 %x, i8 %y) {
450
; CHECK-LABEL: @shl_sub_no_commute(
0 commit comments