Skip to content

Commit ba5170f

Browse files
authored
[InstCombine] Thwart complexity-based canonicalization in shl-add test (NFC) (#91413)
Fixed test for #88193
1 parent 409ff97 commit ba5170f

File tree

1 file changed

+4
-2
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+4
-2
lines changed

llvm/test/Transforms/InstCombine/lshr.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,14 @@ define i32 @shl_add_lshr(i32 %x, i32 %c, i32 %y) {
397397

398398
define i32 @shl_add_lshr_comm(i32 %x, i32 %c, i32 %y) {
399399
; CHECK-LABEL: @shl_add_lshr_comm(
400-
; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[Y:%.*]], [[C:%.*]]
400+
; CHECK-NEXT: [[Y2:%.*]] = mul i32 [[Y:%.*]], [[Y]]
401+
; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[Y2]], [[C:%.*]]
401402
; CHECK-NEXT: [[LSHR:%.*]] = add nuw i32 [[TMP1]], [[X:%.*]]
402403
; CHECK-NEXT: ret i32 [[LSHR]]
403404
;
404405
%shl = shl nuw i32 %x, %c
405-
%add = add nuw i32 %y, %shl
406+
%y2 = mul i32 %y, %y ; thwart complexity-based canonicalization
407+
%add = add nuw i32 %y2, %shl
406408
%lshr = lshr i32 %add, %c
407409
ret i32 %lshr
408410
}

0 commit comments

Comments
 (0)