[PATCH] D67841: [SLP] avoid reduction transform on patterns that the backend can load-combine
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 13:39:55 PDT 2019
ABataev added inline comments.
================
Comment at: llvm/lib/Analysis/TargetTransformInfo.cpp:633
+ // Check if we can match this instruction as part of a larger pattern.
+ Optional<int> LoadCombineCost = getLoadCombineCost(Opcode, Ty, Args);
+ if (LoadCombineCost)
----------------
Ooops, sorry, my fault, pointed to the wrong function. Better to modify a function in `include/llvm/CodeGen/BasicTTIImpl.h`, `BasicTTIImplBase::getArithmeticInstrCost`, if this is common limitation.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6500
+ TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None,
+ TargetTransformInfo::OP_None, { FirstReducedVal });
break;
----------------
I don't think it is a good idea to break the contract of the function. Better to pass the arguments of the instruction, just like requested by the function.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67841/new/
https://reviews.llvm.org/D67841
More information about the llvm-commits
mailing list