mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
LoopVectorize: Allow vectorization of loops with lifetime markers
Patch by Marc Jessome! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1775,6 +1775,8 @@ getIntrinsicIDForCall(CallInst *CI, const TargetLibraryInfo *TLI) {
|
||||
case Intrinsic::pow:
|
||||
case Intrinsic::fma:
|
||||
case Intrinsic::fmuladd:
|
||||
case Intrinsic::lifetime_start:
|
||||
case Intrinsic::lifetime_end:
|
||||
return II->getIntrinsicID();
|
||||
default:
|
||||
return Intrinsic::not_intrinsic;
|
||||
@ -2491,15 +2493,23 @@ InnerLoopVectorizer::vectorizeBlockInLoop(LoopVectorizationLegality *Legal,
|
||||
CallInst *CI = cast<CallInst>(it);
|
||||
Intrinsic::ID ID = getIntrinsicIDForCall(CI, TLI);
|
||||
assert(ID && "Not an intrinsic call!");
|
||||
for (unsigned Part = 0; Part < UF; ++Part) {
|
||||
SmallVector<Value*, 4> Args;
|
||||
for (unsigned i = 0, ie = CI->getNumArgOperands(); i != ie; ++i) {
|
||||
VectorParts &Arg = getVectorValue(CI->getArgOperand(i));
|
||||
Args.push_back(Arg[Part]);
|
||||
switch (ID) {
|
||||
case Intrinsic::lifetime_end:
|
||||
case Intrinsic::lifetime_start:
|
||||
scalarizeInstruction(it);
|
||||
break;
|
||||
default:
|
||||
for (unsigned Part = 0; Part < UF; ++Part) {
|
||||
SmallVector<Value *, 4> Args;
|
||||
for (unsigned i = 0, ie = CI->getNumArgOperands(); i != ie; ++i) {
|
||||
VectorParts &Arg = getVectorValue(CI->getArgOperand(i));
|
||||
Args.push_back(Arg[Part]);
|
||||
}
|
||||
Type *Tys[] = { VectorType::get(CI->getType()->getScalarType(), VF) };
|
||||
Function *F = Intrinsic::getDeclaration(M, ID, Tys);
|
||||
Entry[Part] = Builder.CreateCall(F, Args);
|
||||
}
|
||||
Type *Tys[] = { VectorType::get(CI->getType()->getScalarType(), VF) };
|
||||
Function *F = Intrinsic::getDeclaration(M, ID, Tys);
|
||||
Entry[Part] = Builder.CreateCall(F, Args);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user