[PATCH] D10964: [Codegen] Add intrinsics 'hadd*' and corresponding SDNodes for horizontal sum operation.
Shahid
Asghar-ahmad.Shahid at amd.com
Sun Aug 2 10:11:30 PDT 2015
ashahid added a comment.
In http://reviews.llvm.org/D10964#216661, @RKSimon wrote:
> Apologies for joining this discussion so late.
>
> I'm worried that this intrinsic is over specific to the PSAD (sum_of) cases - I would have thought a pairwise style horizontal add would fit in much better with most target hardware and could still make locating PSAD style patterns pretty straightforward.
IMO, this intrinsic is generic in terms of the semantics of a horizontal sum and PSAD happens to use this semantic. Also for power of 2 operand cases, computation will be of O(ln) which is better than pairwise computation.
> Another alternative would be to instead of a new instrinsic/SDNode, you could focus on providing common infrastructure to detect general horizontal reduction/reassociation patterns - PR23116 and PR21975 would benefit from these.
At this point in time, I would like to deffer this possibility.
> Failing that, would you consider renaming the opcode ISD::SUM or similar to avoid ambiguity with SSE + NEON HADD instructions?
Sure.
Repository:
rL LLVM
http://reviews.llvm.org/D10964
More information about the llvm-commits
mailing list