From d498c8f2c8eb5598bf2e0c3ab30016734e490c6b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 25 Jan 2009 03:53:59 +0000 Subject: Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue. %reg1028 = EXTRACT_SUBREG %reg1027, 1 %reg1029 = MOV8rr %reg1028 %reg1029 = SHR8ri %reg1029, 7, %EFLAGS insert => %reg1030 = MOV8rr %reg1028 %reg1030 = ADD8rr %reg1028, %reg1029, %EFLAGS In this case, it might not be possible to coalesce the second MOV8rr instruction if the first one is coalesced. So it would be profitable to commute it: %reg1028 = EXTRACT_SUBREG %reg1027, 1 %reg1029 = MOV8rr %reg1028 %reg1029 = SHR8ri %reg1029, 7, %EFLAGS insert => %reg1030 = MOV8rr %reg1029 %reg1030 = ADD8rr %reg1029, %reg1028, %EFLAGS git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62954 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/pmul.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/CodeGen/X86/pmul.ll') diff --git a/test/CodeGen/X86/pmul.ll b/test/CodeGen/X86/pmul.ll index 5ee09326dd..b619411eaf 100644 --- a/test/CodeGen/X86/pmul.ll +++ b/test/CodeGen/X86/pmul.ll @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -stack-alignment=16 > %t ; RUN: grep pmul %t | count 12 -; RUN: grep mov %t | count 19 +; RUN: grep mov %t | count 15 define <4 x i32> @a(<4 x i32> %i) nounwind { %A = mul <4 x i32> %i, < i32 117, i32 117, i32 117, i32 117 > -- cgit v1.2.3