Skip to content

Commit d4a5844

Browse files
committed
[X86] Add additional add of mul test (NFC)
1 parent 2d4e856 commit d4a5844

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/CodeGen/X86/add-of-mul.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ define i32 @test_scalar(i32 %x) {
1313
ret i32 %add
1414
}
1515

16+
define i32 @test_scalar_commuted(i32 %x) {
17+
; CHECK-LABEL: test_scalar_commuted:
18+
; CHECK: # %bb.0:
19+
; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
20+
; CHECK-NEXT: leal (%rdi,%rdi,2), %eax
21+
; CHECK-NEXT: addl %edi, %eax
22+
; CHECK-NEXT: retq
23+
%mul = mul i32 %x, 3
24+
%add = add i32 %x, %mul
25+
ret i32 %add
26+
}
27+
1628
define <4 x i32> @test_vector(<4 x i32> %x) {
1729
; CHECK-LABEL: test_vector:
1830
; CHECK: # %bb.0:

0 commit comments

Comments
 (0)