[PATCH] D10964: [Codegen] Add intrinsics 'hadd*' and corresponding SDNodes for horizontal sum operation.

hfinkel at anl.gov hfinkel at anl.gov
Thu Jul 9 19:35:46 PDT 2015


hfinkel added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2848
@@ -2826,1 +2847,3 @@
     break;
+  case ISD::FHADD:
+    Res = WidenVecOp_FHADD(N);
----------------
Why is ISD::HADD not handled here?


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2871
@@ +2870,3 @@
+  SDValue InOp = GetWidenedVector(N->getOperand(0));
+  return DAG.getNode(ISD::FHADD, SDLoc(N), N->getValueType(0), InOp);
+}
----------------
Why exactly does this do? Widening normally introduces undefs, but you can't add a bunch of undefs and get anything other than an undef out.

You might need the SDAG node to array an extra parameter indicating how many of the vector lanes are actually to be added to properly support widening.



Repository:
  rL LLVM

http://reviews.llvm.org/D10964







More information about the llvm-commits mailing list