forked from OSchip/llvm-project
parent
7bf08beb2e
commit
29fd313e9e
|
@ -202,9 +202,13 @@ namespace llvm {
|
|||
"setLength called with value of wrong type!");
|
||||
setOperand(3, L);
|
||||
}
|
||||
void setAlignment(unsigned A) {
|
||||
const Type *Int32Ty = getOperand(4)->getType();
|
||||
setOperand(4, ConstantInt::get(Int32Ty, A));
|
||||
|
||||
void setAlignment(Constant* A) {
|
||||
setOperand(4, A);
|
||||
}
|
||||
|
||||
const Type *getAlignmentType() const {
|
||||
return getOperand(4)->getType();
|
||||
}
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
|
|
|
@ -9694,7 +9694,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||
unsigned CopyAlign = MI->getAlignment();
|
||||
|
||||
if (CopyAlign < MinAlign) {
|
||||
MI->setAlignment(MinAlign);
|
||||
MI->setAlignment(Context->getConstantInt(MI->getAlignmentType(),
|
||||
MinAlign, false));
|
||||
return MI;
|
||||
}
|
||||
|
||||
|
@ -9768,7 +9769,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||
Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
|
||||
unsigned Alignment = GetOrEnforceKnownAlignment(MI->getDest());
|
||||
if (MI->getAlignment() < Alignment) {
|
||||
MI->setAlignment(Alignment);
|
||||
MI->setAlignment(Context->getConstantInt(MI->getAlignmentType(),
|
||||
Alignment, false));
|
||||
return MI;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue