[PATCH] D45336: Apply accumulator to fadd/fmul experimental vector reductions (PR36734)

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 11:29:11 PDT 2018


aemerson added a comment.

Simon asked this on the PR, let's continue the discussion in one place:

> Do we really want to completely ignore an intrinsic argument depending on the fast flags? There might be valid reasons to want to include an accumulation value.

The raison d'ĂȘtre for the argument is for ordered reductions, and the intrinsics were designed to allow the expression of the reduction idiom only, in light of newer vector architectures where the previous representation was inadequate. The use of an accumulator argument for fast reductions wasn't necessary, so the semantics were supposed to be defined in the most minimal form. The accumulator can easily be expressed as a extractelement->op->insertelement sequence. The question here I think becomes our good old friend: what should the canonical form be?

The other issue is that while these intrinsics were experimental (it was on my todo list for later this year to change that), AArch64 has been using them with their original intended semantics for a while now. If we change that, IR generated from a released compiler will be miscompiled since it now becomes legal to fold away undef accumulator reductions to undef, unless we do some IR auto-upgrading based on the bitcode version.


Repository:
  rL LLVM

https://reviews.llvm.org/D45336





More information about the llvm-commits mailing list