Hi Nadav,Arnold,
This is a follow up patch after http://reviews.llvm.org/D3851 .
Patch adds support to vectorize intrinsics powi,cttz,ctlz in Loopvectorizer.
Please if you could review these 2 patches.
Thanks
Karthik Bhat
Differential D3937
Add support to vectorize ctlz,cttz and powi intrinsics in LoopVectorizer Authored by karthikthecool on May 28 2014, 5:57 AM.
Details
Hi Nadav,Arnold, Thanks
Diff Detail Event TimelineComment Actions With those changes this LGTM. Did you run performance tests? Did you see any impact on the test-suite? Thanks
Comment Actions Thanks Arnold for the review. Committed as r209873. | |||||||||||||||
This code is nearly identical to the code in the default statement below. I think this could be refactored into common code?
default: bool HasScalarOpd = hasVectorInstrinsicScalarOpd(ID, 1); for (unsigned Part = 0; Part < UF; ++Part) { SmallVector<Value *, 4> Args; for (unsigned i = 0, ie = CI->getNumArgOperands(); i != ie; ++i) { if (HasScalarOpd && i == 1) { // pushback scalar. continue; } VectorParts &Arg = getVectorValue(CI->getArgOperand(i)); Args.push_back(Arg[Part]); } Type *Tys[] = {CI->getType()}; if (VF > 1) Tys[0] = VectorType::get(CI->getType()->getScalarType(), VF); Function *F = Intrinsic::getDeclaration(M, ID, Tys); Entry[Part] = Builder.CreateCall(F, Args); } break; }