SystemZTargetTransformInfo methods implemented:
int getArithmeticInstrCost() int getCastInstrCost() int getCmpSelInstrCost()
Common code changes:
getCmpSelInstrCost() has gotten an extra parameter to make it possible to pass the actual instruction if it exists. The motivation for this is that the actual cost on SystemZ for compare and select instructions depend on the scalar widths of the vector elements. The vector element compare instruction produces a bitmask for the elements, and the vector select operates with that bitmask. However, if the widths of the elements of the compare / select operands differ, the bitmask must be adjusted with pack or unpack instructions for instance. Therefore it is useful to look at the "other" instruction when evaluating cost for the compare or select instruction.
LoopVectorizer.cpp: Don't consider a vectorized cost for the compare if it is for the conditional back branch in the loop latch.
New ovlerloaded method getScalarizationOverhead() which was factored out of getArithmeticInstrCost(). This method is useful also in the SystemZ backend.
The fix in InstCombineVectorOps.cpp is "in progress", which is obviously needed in some cases. See https://llvm.org/bugs/show_bug.cgi?id=30630
This part has been approved by Hal Finkel on llvm-commits already (just the first part here that handles scalar/vector argument types).