mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
LoopVectorize: Don't store a reversed value in the vectorized value map
When we store values for reversed induction stores we must not store the reversed value in the vectorized value map. Another instruction might use this value. This fixes 3 test cases of PR16455. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185051 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1227,8 +1227,10 @@ void InnerLoopVectorizer::vectorizeMemoryInstruction(Instruction *Instr,
|
||||
if (SI) {
|
||||
assert(!Legal->isUniform(SI->getPointerOperand()) &&
|
||||
"We do not allow storing to uniform addresses");
|
||||
// We don't want to update the value in the map as it might be used in
|
||||
// another expression. So don't use a reference type for "StoredVal".
|
||||
VectorParts StoredVal = getVectorValue(SI->getValueOperand());
|
||||
|
||||
VectorParts &StoredVal = getVectorValue(SI->getValueOperand());
|
||||
for (unsigned Part = 0; Part < UF; ++Part) {
|
||||
// Calculate the pointer for the specific unroll-part.
|
||||
Value *PartPtr = Builder.CreateGEP(Ptr, Builder.getInt32(Part * VF));
|
||||
@@ -1246,6 +1248,7 @@ void InnerLoopVectorizer::vectorizeMemoryInstruction(Instruction *Instr,
|
||||
Value *VecPtr = Builder.CreateBitCast(PartPtr, DataTy->getPointerTo(AddressSpace));
|
||||
Builder.CreateStore(StoredVal[Part], VecPtr)->setAlignment(Alignment);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned Part = 0; Part < UF; ++Part) {
|
||||
|
Reference in New Issue
Block a user