[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
Fri Sep 27 08:47:12 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)
----------------
spatel wrote:
> ABataev wrote:
> > 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.
> AFAICT, if we change the concept/model base classes, that will only be called after any target-specific override, so we would need to change all of the override implementations to access the new code. Adding code to the concrete class allows us to add the target-independent customization for a load-combine before the target does its usual logic.
> 
> Can you point to an example of what you'd like to see and/or show it exactly?
Yes, this is what I was afraid of. In general, it would be good to put it to the base class, but if you think that this not possible without code duplication in derived classes, better to leave it as is. Other opinions?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67841/new/

https://reviews.llvm.org/D67841





More information about the llvm-commits mailing list