<div dir="ltr">Please include some details about the reason for a revert in the commit message - helps folks figure out if this revert will address any local issues they're seeing and maybe if someone else attempts a similar change in the future it'll provide breadcrumbs about what pitfalls to be aware of.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 16, 2021 at 2:59 AM Frederik Gossen via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Frederik Gossen<br>
Date: 2021-11-16T11:58:02+01:00<br>
New Revision: 9a6817b7edb44669cec14a3fbde8a93dfb217c1a<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/9a6817b7edb44669cec14a3fbde8a93dfb217c1a" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/9a6817b7edb44669cec14a3fbde8a93dfb217c1a</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/9a6817b7edb44669cec14a3fbde8a93dfb217c1a.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/9a6817b7edb44669cec14a3fbde8a93dfb217c1a.diff</a><br>
<br>
LOG: Revert "Fix another unused variable error."<br>
<br>
This reverts commit 5b84ae7c48083bd0f40199837990cf915a2053b8.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp<br>
index 1ec3c26f6159..a8d0a8c4d82f 100644<br>
--- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp<br>
+++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp<br>
@@ -375,6 +375,9 @@ bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl<GStore *> &Stores) {<br>
     ConstantVals.emplace_back(MaybeCst->Value);<br>
   }<br>
<br>
+  Register WideReg;<br>
+  auto *WideMMO =<br>
+      MF->getMachineMemOperand(&FirstStore->getMMO(), 0, WideValueTy);<br>
   if (ConstantVals.empty()) {<br>
     // Mimic the SDAG behaviour here and don't try to do anything for unknown<br>
     // values. In future, we should also support the cases of loads and<br>
@@ -392,12 +395,11 @@ bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl<GStore *> &Stores) {<br>
     // wider one.<br>
     WideConst.insertBits(ConstantVals[Idx], Idx * SmallTy.getSizeInBits());<br>
   }<br>
-  Register WideReg = Builder.buildConstant(WideValueTy, WideConst).getReg(0);<br>
+  WideReg = Builder.buildConstant(WideValueTy, WideConst).getReg(0);<br>
   LLVM_DEBUG({<br>
     dbgs() << "Created merged store: "<br>
            << *Builder.buildStore(WideReg, FirstStore->getPointerReg(),<br>
-                                  *MF->getMachineMemOperand(<br>
-                                      &FirstStore->getMMO(), 0, WideValueTy));<br>
+                                  *WideMMO);<br>
   });<br>
   NumStoresMerged += Stores.size();<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>