This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][VP] Add splitting support for vp.reduction.*
ClosedPublic

Authored by victor-eds on Jan 17 2022, 5:47 AM.

Details

Summary

Split vp.reduction.* intrinsics by splitting the vector to reduce in
two halves, perform the reduction operation in each one of them and
accumulate the results of both operations.

Diff Detail

Event Timeline

victor-eds created this revision.Jan 17 2022, 5:47 AM
victor-eds requested review of this revision.Jan 17 2022, 5:47 AM
craig.topper added inline comments.Jan 17 2022, 9:29 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
822

const SDValue & can be SDValue. SDValue is cheap to copy.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2489

This isn't valid for SEQ_FADD or SEQ_FMUL. We can't evaluate the Lo and Hi split, that would break the sequentialness.

Fixing sequential FP reduction issues

Copy SDValue instead of passing reference

victor-eds marked 2 inline comments as done.Jan 17 2022, 9:37 AM

Done

Update tests

craig.topper accepted this revision.Jan 17 2022, 12:48 PM

LGTM other than that assertion request.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
2463

Should assert OpNo==1? The creation of the new nodes is only correct if it is.

This revision is now accepted and ready to land.Jan 17 2022, 12:48 PM

Add assertions in new function

This revision was landed with ongoing or failed builds.Jan 18 2022, 1:30 AM
This revision was automatically updated to reflect the committed changes.