[PATCH] D8943: Calculate vectorization factor using the narrowest type instead of widest type
hfinkel@anl.gov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 27 21:51:24 PDT 2015
hfinkel added inline comments.
================
Comment at: lib/Target/X86/X86TargetTransformInfo.cpp:903-905
@@ -902,4 +902,5 @@
std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, SrcVTy);
+ auto VT = TLI->getValueType(DL, SrcVTy);
int Cost = 0;
- if (LT.second != TLI->getValueType(DL, SrcVTy).getSimpleVT() &&
+ if (VT.isSimple() && LT.second != VT.getSimpleVT() &&
LT.second.getVectorNumElements() == NumElem)
----------------
In that case, please do commit it.
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:5166
@@ +5165,3 @@
+ auto TypeSize =
+ (unsigned)DL.getTypeSizeInBits(Inst->getType()->getScalarType());
+ RegUsage += std::max<unsigned>(1, VFs[j] * TypeSize / WidestRegister);
----------------
Does this do the right thing for stores? For stores, you want the type of the stored value, right?
http://reviews.llvm.org/D8943
More information about the llvm-commits
mailing list