[llvm] r375019 - CombinerHelper - silence dead assignment warnings. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 10:21:50 PDT 2019
Author: rksimon
Date: Wed Oct 16 10:21:50 2019
New Revision: 375019
URL: http://llvm.org/viewvc/llvm-project?rev=375019&view=rev
Log:
CombinerHelper - silence dead assignment warnings. NFCI.
Copy the NewAlignment value to Alignment first and then use that to update the stack frame object alignments.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp?rev=375019&r1=375018&r2=375019&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/CombinerHelper.cpp Wed Oct 16 10:21:50 2019
@@ -779,11 +779,11 @@ bool CombinerHelper::optimizeMemset(Mach
Type *IRTy = getTypeForLLT(MemOps[0], C);
unsigned NewAlign = (unsigned)DL.getABITypeAlignment(IRTy);
if (NewAlign > Align) {
+ Align = NewAlign;
unsigned FI = FIDef->getOperand(1).getIndex();
// Give the stack frame object a larger alignment if needed.
- if (MFI.getObjectAlignment(FI) < NewAlign)
- MFI.setObjectAlignment(FI, NewAlign);
- Align = NewAlign;
+ if (MFI.getObjectAlignment(FI) < Align)
+ MFI.setObjectAlignment(FI, Align);
}
}
@@ -907,11 +907,11 @@ bool CombinerHelper::optimizeMemcpy(Mach
NewAlign /= 2;
if (NewAlign > Alignment) {
+ Alignment = NewAlign;
unsigned FI = FIDef->getOperand(1).getIndex();
// Give the stack frame object a larger alignment if needed.
- if (MFI.getObjectAlignment(FI) < NewAlign)
- MFI.setObjectAlignment(FI, NewAlign);
- Alignment = NewAlign;
+ if (MFI.getObjectAlignment(FI) < Alignment)
+ MFI.setObjectAlignment(FI, Alignment);
}
}
@@ -1014,11 +1014,11 @@ bool CombinerHelper::optimizeMemmove(Mac
NewAlign /= 2;
if (NewAlign > Alignment) {
+ Alignment = NewAlign;
unsigned FI = FIDef->getOperand(1).getIndex();
// Give the stack frame object a larger alignment if needed.
- if (MFI.getObjectAlignment(FI) < NewAlign)
- MFI.setObjectAlignment(FI, NewAlign);
- Alignment = NewAlign;
+ if (MFI.getObjectAlignment(FI) < Alignment)
+ MFI.setObjectAlignment(FI, Alignment);
}
}
More information about the llvm-commits
mailing list