[PATCH] D10964: [Codegen] Add intrinsics 'hsum*' and corresponding SDNodes for horizontal sum operation.
hfinkel@anl.gov via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 11:57:10 PDT 2015
hfinkel added inline comments.
================
Comment at: docs/LangRef.rst:10985
@@ +10984,3 @@
+of the vector operand, treating it as integers or floats. For both signed and unsigned result
+overflow, the behavior is undefined.
+
----------------
Unsigned overflow is also undefined? Is this really necessary? I doubt that the vectorizer will be able to prove no-unsigned-overflow in most cases, and we don't get it from C's semantics, and thus, would not be able to generate this intrinsic.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1065
@@ +1064,3 @@
+ Flags.setNoSignedWrap(Op->getOpcode() == ISD::HSUM);
+ Flags.setNoUnsignedWrap(Op->getOpcode() == ISD::HSUM);
+
----------------
If we can get rid of the undefined behavior for unsigned overflow; then remove this line.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:714
@@ +713,3 @@
+ Flags.setNoSignedWrap(N->getOpcode() == ISD::HSUM);
+ Flags.setNoUnsignedWrap(N->getOpcode() == ISD::HSUM);
+ Lo = DAG.getNode(N->getOpcode() == ISD::HSUM ? ISD::ADD : ISD::FADD, dl,
----------------
Same comment here too.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2960
@@ +2959,3 @@
+ Flags.setNoSignedWrap(N->getOpcode() == ISD::HSUM);
+ Flags.setNoUnsignedWrap(N->getOpcode() == ISD::HSUM);
+
----------------
Same here.
http://reviews.llvm.org/D10964
More information about the llvm-commits
mailing list