forked from OSchip/llvm-project
CombinerHelper - silence dead assignment warnings. NFCI.
Copy the NewAlignment value to Alignment first and then use that to update the stack frame object alignments. llvm-svn: 375019
This commit is contained in:
parent
f095b8c425
commit
e2163f96ab
|
@ -779,11 +779,11 @@ bool CombinerHelper::optimizeMemset(MachineInstr &MI, Register Dst, Register Val
|
||||||
Type *IRTy = getTypeForLLT(MemOps[0], C);
|
Type *IRTy = getTypeForLLT(MemOps[0], C);
|
||||||
unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
|
unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
|
||||||
if (NewAlign > Align) {
|
if (NewAlign > Align) {
|
||||||
|
Align = NewAlign;
|
||||||
unsigned FI = FIDef->getOperand(1).getIndex();
|
unsigned FI = FIDef->getOperand(1).getIndex();
|
||||||
// Give the stack frame object a larger alignment if needed.
|
// Give the stack frame object a larger alignment if needed.
|
||||||
if (MFI.getObjectAlignment(FI) < NewAlign)
|
if (MFI.getObjectAlignment(FI) < Align)
|
||||||
MFI.setObjectAlignment(FI, NewAlign);
|
MFI.setObjectAlignment(FI, Align);
|
||||||
Align = NewAlign;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,11 +907,11 @@ bool CombinerHelper::optimizeMemcpy(MachineInstr &MI, Register Dst,
|
||||||
NewAlign /= 2;
|
NewAlign /= 2;
|
||||||
|
|
||||||
if (NewAlign > Alignment) {
|
if (NewAlign > Alignment) {
|
||||||
|
Alignment = NewAlign;
|
||||||
unsigned FI = FIDef->getOperand(1).getIndex();
|
unsigned FI = FIDef->getOperand(1).getIndex();
|
||||||
// Give the stack frame object a larger alignment if needed.
|
// Give the stack frame object a larger alignment if needed.
|
||||||
if (MFI.getObjectAlignment(FI) < NewAlign)
|
if (MFI.getObjectAlignment(FI) < Alignment)
|
||||||
MFI.setObjectAlignment(FI, NewAlign);
|
MFI.setObjectAlignment(FI, Alignment);
|
||||||
Alignment = NewAlign;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1014,11 +1014,11 @@ bool CombinerHelper::optimizeMemmove(MachineInstr &MI, Register Dst,
|
||||||
NewAlign /= 2;
|
NewAlign /= 2;
|
||||||
|
|
||||||
if (NewAlign > Alignment) {
|
if (NewAlign > Alignment) {
|
||||||
|
Alignment = NewAlign;
|
||||||
unsigned FI = FIDef->getOperand(1).getIndex();
|
unsigned FI = FIDef->getOperand(1).getIndex();
|
||||||
// Give the stack frame object a larger alignment if needed.
|
// Give the stack frame object a larger alignment if needed.
|
||||||
if (MFI.getObjectAlignment(FI) < NewAlign)
|
if (MFI.getObjectAlignment(FI) < Alignment)
|
||||||
MFI.setObjectAlignment(FI, NewAlign);
|
MFI.setObjectAlignment(FI, Alignment);
|
||||||
Alignment = NewAlign;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue