Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,088 Lines • ▼ Show 20 Lines | case Instruction::GetElementPtr: { | ||||
buildTree_rec(Operands, Depth + 1, {TE, i}); | buildTree_rec(Operands, Depth + 1, {TE, i}); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
case Instruction::Store: { | case Instruction::Store: { | ||||
// Check if the stores are consecutive or if we need to swizzle them. | // Check if the stores are consecutive or if we need to swizzle them. | ||||
llvm::Type *ScalarTy = cast<StoreInst>(VL0)->getValueOperand()->getType(); | llvm::Type *ScalarTy = cast<StoreInst>(VL0)->getValueOperand()->getType(); | ||||
// Avoid types that are padded when being allocated as scalars, while | |||||
// being packed together in a vector (such as i1). | |||||
if (DL->getTypeSizeInBits(ScalarTy) != | |||||
DL->getTypeAllocSizeInBits(ScalarTy)) { | |||||
BS.cancelScheduling(VL, VL0); | |||||
newTreeEntry(VL, None /*not vectorized*/, S, UserTreeIdx, | |||||
ReuseShuffleIndicies); | |||||
LLVM_DEBUG(dbgs() << "SLP: Gathering stores of non-packed type.\n"); | |||||
return; | |||||
} | |||||
// Make sure all stores in the bundle are simple - we can't vectorize | // Make sure all stores in the bundle are simple - we can't vectorize | ||||
// atomic or volatile stores. | // atomic or volatile stores. | ||||
SmallVector<Value *, 4> PointerOps(VL.size()); | SmallVector<Value *, 4> PointerOps(VL.size()); | ||||
ValueList Operands(VL.size()); | ValueList Operands(VL.size()); | ||||
auto POIter = PointerOps.begin(); | auto POIter = PointerOps.begin(); | ||||
auto OIter = Operands.begin(); | auto OIter = Operands.begin(); | ||||
for (Value *V : VL) { | for (Value *V : VL) { | ||||
auto *SI = cast<StoreInst>(V); | auto *SI = cast<StoreInst>(V); | ||||
▲ Show 20 Lines • Show All 4,685 Lines • Show Last 20 Lines |