From 9a6817b7edb44669cec14a3fbde8a93dfb217c1a Mon Sep 17 00:00:00 2001 From: Frederik Gossen Date: Tue, 16 Nov 2021 11:58:02 +0100 Subject: [PATCH] Revert "Fix another unused variable error." This reverts commit 5b84ae7c48083bd0f40199837990cf915a2053b8. --- llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp index 1ec3c26f6159..a8d0a8c4d82f 100644 --- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp @@ -375,6 +375,9 @@ bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl &Stores) { ConstantVals.emplace_back(MaybeCst->Value); } + Register WideReg; + auto *WideMMO = + MF->getMachineMemOperand(&FirstStore->getMMO(), 0, WideValueTy); if (ConstantVals.empty()) { // Mimic the SDAG behaviour here and don't try to do anything for unknown // values. In future, we should also support the cases of loads and @@ -392,12 +395,11 @@ bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl &Stores) { // wider one. WideConst.insertBits(ConstantVals[Idx], Idx * SmallTy.getSizeInBits()); } - Register WideReg = Builder.buildConstant(WideValueTy, WideConst).getReg(0); + WideReg = Builder.buildConstant(WideValueTy, WideConst).getReg(0); LLVM_DEBUG({ dbgs() << "Created merged store: " << *Builder.buildStore(WideReg, FirstStore->getPointerReg(), - *MF->getMachineMemOperand( - &FirstStore->getMMO(), 0, WideValueTy)); + *WideMMO); }); NumStoresMerged += Stores.size();