[llvm] 4cc26a4 - [X86][SSE] Use shouldUseHorizontalOp helper to determine whether to use (F)HADD. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 04:13:54 PDT 2020


Author: Simon Pilgrim
Date: 2020-07-10T12:13:34+01:00
New Revision: 4cc26a44ca8b29abf9e73a1048e8a36ac87b1fa1

URL: https://github.com/llvm/llvm-project/commit/4cc26a44ca8b29abf9e73a1048e8a36ac87b1fa1
DIFF: https://github.com/llvm/llvm-project/commit/4cc26a44ca8b29abf9e73a1048e8a36ac87b1fa1.diff

LOG: [X86][SSE] Use shouldUseHorizontalOp helper to determine whether to use (F)HADD. NFCI.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 4d3b0eda58f2..695b6ef35f11 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -39301,8 +39301,7 @@ static SDValue combineReductionToHorizontal(SDNode *ExtElt, SelectionDAG &DAG,
   }
 
   // Only use (F)HADD opcodes if they aren't microcoded or minimizes codesize.
-  bool OptForSize = DAG.shouldOptForSize();
-  if (!Subtarget.hasFastHorizontalOps() && !OptForSize)
+  if (!shouldUseHorizontalOp(true, DAG, Subtarget))
     return SDValue();
 
   unsigned HorizOpcode = Opc == ISD::ADD ? X86ISD::HADD : X86ISD::FHADD;


        


More information about the llvm-commits mailing list