[llvm] 6976a0e - RegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 9 12:10:42 PST 2019
Author: Simon Pilgrim
Date: 2019-11-09T20:10:12Z
New Revision: 6976a0e826623b0490280b546ed9c5c2ba7ece26
URL: https://github.com/llvm/llvm-project/commit/6976a0e826623b0490280b546ed9c5c2ba7ece26
DIFF: https://github.com/llvm/llvm-project/commit/6976a0e826623b0490280b546ed9c5c2ba7ece26.diff
LOG: RegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI.
Added:
Modified:
llvm/lib/CodeGen/RegisterCoalescer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index faca645c9e8b..c44a302c4996 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -3115,7 +3115,8 @@ void JoinVals::eraseInstrs(SmallPtrSetImpl<MachineInstr*> &ErasedInstrs,
LiveInterval *LI) {
for (unsigned i = 0, e = LR.getNumValNums(); i != e; ++i) {
// Get the def location before markUnused() below invalidates it.
- SlotIndex Def = LR.getValNumInfo(i)->def;
+ VNInfo *VNI = LR.getValNumInfo(i);
+ SlotIndex Def = VNI->def;
switch (Vals[i].Resolution) {
case CR_Keep: {
// If an IMPLICIT_DEF value is pruned, it doesn't serve a purpose any
@@ -3131,8 +3132,6 @@ void JoinVals::eraseInstrs(SmallPtrSetImpl<MachineInstr*> &ErasedInstrs,
// In such cases, removing this def from the main range must be
// complemented by extending the main range to account for the liveness
// of the other subrange.
- VNInfo *VNI = LR.getValNumInfo(i);
- SlotIndex Def = VNI->def;
// The new end point of the main range segment to be extended.
SlotIndex NewEnd;
if (LI != nullptr) {
More information about the llvm-commits
mailing list