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

Shahid Asghar-ahmad.Shahid at amd.com
Fri Jul 10 04:56:02 PDT 2015


ashahid added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2848
@@ -2826,1 +2847,3 @@
     break;
+  case ISD::FHADD:
+    Res = WidenVecOp_FHADD(N);
----------------
hfinkel wrote:
> Why is ISD::HADD not handled here?
> 
Probably my tests was not sufficient enough to ask me to handle ISD::HADD. I will see.

================
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);
+}
----------------
hfinkel wrote:
> 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.
> 
Yes it does introduce undefs.

Sorry that I could not get your suggestion regarding the extra SDAG?


Repository:
  rL LLVM

http://reviews.llvm.org/D10964







More information about the llvm-commits mailing list