[llvm] r343939 - [DAGCombiner] shorten code for bitcast+fabs fold; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 7 08:18:30 PDT 2018


Author: spatel
Date: Sun Oct  7 08:18:30 2018
New Revision: 343939

URL: http://llvm.org/viewvc/llvm-project?rev=343939&view=rev
Log:
[DAGCombiner] shorten code for bitcast+fabs fold; NFC

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=343939&r1=343938&r2=343939&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Oct  7 08:18:30 2018
@@ -12162,11 +12162,8 @@ SDValue DAGCombiner::visitFABS(SDNode *N
   if (N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FCOPYSIGN)
     return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0.getOperand(0));
 
-  // Transform fabs(bitconvert(x)) -> bitconvert(x & ~sign) to avoid loading
-  // constant pool values.
-  if (!TLI.isFAbsFree(VT) &&
-      N0.getOpcode() == ISD::BITCAST &&
-      N0.getNode()->hasOneUse()) {
+  // fabs(bitcast(x)) -> bitcast(x & ~sign) to avoid constant pool loads.
+  if (!TLI.isFAbsFree(VT) && N0.getOpcode() == ISD::BITCAST && N0.hasOneUse()) {
     SDValue Int = N0.getOperand(0);
     EVT IntVT = Int.getValueType();
     if (IntVT.isInteger() && !IntVT.isVector()) {




More information about the llvm-commits mailing list