[PATCH] D50572: DAG: Handle odd vector sizes in calling conv splitting
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 31 11:18:05 PDT 2018
nhaehnle added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:726
for (unsigned i = 0; i != NumIntermediates; ++i) {
- if (IntermediateVT.isVector())
- Ops[i] =
- DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, IntermediateVT, Val,
- DAG.getConstant(i * (NumElements / NumIntermediates), DL,
- TLI.getVectorIdxTy(DAG.getDataLayout())));
- else
+ unsigned SubVecIdx = i * (NumElements + 1) / NumIntermediates;
+
----------------
If I understand correctly what the code is trying to do, `i * IntermediateNumElts` would also work, right? That would be much clearer IMHO.
Also, this definition can be moved into the if case.
https://reviews.llvm.org/D50572
More information about the llvm-commits
mailing list