[llvm] r248415 - [x86] replace integer 'xor' ops with packed SSE FP 'xor' ops when operating on FP scalars
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 11:33:42 PDT 2015
Author: spatel
Date: Wed Sep 23 13:33:42 2015
New Revision: 248415
URL: http://llvm.org/viewvc/llvm-project?rev=248415&view=rev
Log:
[x86] replace integer 'xor' ops with packed SSE FP 'xor' ops when operating on FP scalars
Turn this:
movd %xmm0, %eax
movd %xmm1, %ecx
xorl %eax, %ecx
movd %ecx, %xmm0
into this:
xorps %xmm1, %xmm0
This is related to, but does not solve:
https://llvm.org/bugs/show_bug.cgi?id=22428
This is an extension of:
http://reviews.llvm.org/rL248395
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/fp-logic.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=248415&r1=248414&r2=248415&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Sep 23 13:33:42 2015
@@ -24787,6 +24787,9 @@ static SDValue PerformXorCombine(SDNode
if (SDValue RV = performIntegerAbsCombine(N, DAG))
return RV;
+ if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, Subtarget))
+ return FPLogic;
+
return SDValue();
}
Modified: llvm/trunk/test/CodeGen/X86/fp-logic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fp-logic.ll?rev=248415&r1=248414&r2=248415&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fp-logic.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fp-logic.ll Wed Sep 23 13:33:42 2015
@@ -183,10 +183,7 @@ define float @or(float %x, float %y) {
define float @xor(float %x, float %y) {
; CHECK-LABEL: xor:
; CHECK: # BB#0:
-; CHECK-NEXT: movd %xmm0, %eax
-; CHECK-NEXT: movd %xmm1, %ecx
-; CHECK-NEXT: xorl %eax, %ecx
-; CHECK-NEXT: movd %ecx, %xmm0
+; CHECK-NEXT: xorps %xmm1, %xmm0
; CHECK-NEXT: retq
%bc1 = bitcast float %x to i32
More information about the llvm-commits
mailing list