[llvm] r248409 - [x86] replace integer 'or' ops with packed SSE FP 'or' ops when operating on FP scalars

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 11:19:07 PDT 2015


Author: spatel
Date: Wed Sep 23 13:19:07 2015
New Revision: 248409

URL: http://llvm.org/viewvc/llvm-project?rev=248409&view=rev
Log:
[x86] replace integer 'or' ops with packed SSE FP 'or' ops when operating on FP scalars

Turn this:

movd %xmm0, %eax
movd %xmm1, %ecx
orl %eax, %ecx
movd %ecx, %xmm0

into this:

orps %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=248409&r1=248408&r2=248409&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Sep 23 13:19:07 2015
@@ -24542,6 +24542,9 @@ static SDValue PerformOrCombine(SDNode *
   if (SDValue R = CMPEQCombine(N, DAG, DCI, Subtarget))
     return R;
 
+  if (SDValue FPLogic = convertIntLogicToFPLogic(N, DAG, Subtarget))
+    return FPLogic;
+
   SDValue N0 = N->getOperand(0);
   SDValue N1 = N->getOperand(1);
   EVT VT = N->getValueType(0);

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=248409&r1=248408&r2=248409&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fp-logic.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fp-logic.ll Wed Sep 23 13:19:07 2015
@@ -170,10 +170,7 @@ define float @f10(float %x, float %y) {
 define float @or(float %x, float %y) {
 ; CHECK-LABEL: or:
 ; CHECK:       # BB#0:
-; CHECK-NEXT:    movd %xmm0, %eax
-; CHECK-NEXT:    movd %xmm1, %ecx
-; CHECK-NEXT:    orl %eax, %ecx
-; CHECK-NEXT:    movd %ecx, %xmm0
+; CHECK-NEXT:    orps %xmm1, %xmm0
 ; CHECK-NEXT:    retq
 
   %bc1 = bitcast float %x to i32




More information about the llvm-commits mailing list