[PATCH] D107647: [PowerPC] MMA - Add __builtin_vsx_build_pair and __builtin_mma_build_acc builtins
Nemanja Ivanovic via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 22 16:08:02 PDT 2021
nemanjai accepted this revision.
nemanjai added a comment.
LGTM other than the code can be simplified as suggested.
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:15888-15895
+ SmallVector<Value *, 4> RevOps;
+ unsigned NumVecs =
+ (BuiltinID == PPC::BI__builtin_mma_build_acc) ? 4 : 2;
+ for (unsigned i = NumVecs; i > 0; --i)
+ RevOps.push_back(Ops[i]);
+ for (unsigned i = 1; i <= NumVecs; ++i)
+ Ops[i] = RevOps[i - 1];
----------------
This entire block seems to simply be `std::reverse(Ops.begin() + 1, Ops.end())`
Also, please add a note that the very first operand is the pointer to the pair/accumulator that is actually being built.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107647/new/
https://reviews.llvm.org/D107647
More information about the cfe-commits
mailing list