mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
When we promote a load of an argument make sure to take the alignment
of the previous load - it's usually important. For example, we don't want to blindly turn an unaligned load into an aligned one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -687,7 +687,11 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
|
|||||||
Ops.clear();
|
Ops.clear();
|
||||||
AA.copyValue(OrigLoad->getOperand(0), V);
|
AA.copyValue(OrigLoad->getOperand(0), V);
|
||||||
}
|
}
|
||||||
Args.push_back(new LoadInst(V, V->getName()+".val", Call));
|
// Since we're replacing a load make sure we take the alignment
|
||||||
|
// of the previous load.
|
||||||
|
LoadInst *newLoad = new LoadInst(V, V->getName()+".val", Call);
|
||||||
|
newLoad->setAlignment(OrigLoad->getAlignment());
|
||||||
|
Args.push_back(newLoad);
|
||||||
AA.copyValue(OrigLoad, Args.back());
|
AA.copyValue(OrigLoad, Args.back());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user