Revert "Fix another unused variable error."

This reverts commit 5b84ae7c48.
This commit is contained in:
Frederik Gossen 2021-11-16 11:58:02 +01:00
parent 669e57ebd1
commit 9a6817b7ed
1 changed files with 5 additions and 3 deletions

View File

@ -375,6 +375,9 @@ bool LoadStoreOpt::doSingleStoreMerge(SmallVectorImpl<GStore *> &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<GStore *> &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();