Skip to content

Commit 9572ff7

Browse files
dschuffmahesh-attarde
authored andcommitted
Revert "[WebAssembly] Remove FAKE_USEs before ExplicitLocals" (llvm#160553)
Reverts llvm#160228 See llvm#160228 (comment)
1 parent 0916e2d commit 9572ff7

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,6 @@ static MachineInstr *findStartOfTree(MachineOperand &MO,
216216
return Def;
217217
}
218218

219-
// FAKE_USEs are no-ops, so remove them here so that the values used by them
220-
// will be correctly dropped later.
221-
static void removeFakeUses(MachineFunction &MF) {
222-
SmallVector<MachineInstr *> ToDelete;
223-
for (auto &MBB : MF)
224-
for (auto &MI : MBB)
225-
if (MI.isFakeUse())
226-
ToDelete.push_back(&MI);
227-
for (auto *MI : ToDelete)
228-
MI->eraseFromParent();
229-
}
230-
231219
bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) {
232220
LLVM_DEBUG(dbgs() << "********** Make Locals Explicit **********\n"
233221
"********** Function: "
@@ -238,8 +226,6 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) {
238226
WebAssemblyFunctionInfo &MFI = *MF.getInfo<WebAssemblyFunctionInfo>();
239227
const auto *TII = MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
240228

241-
removeFakeUses(MF);
242-
243229
// Map non-stackified virtual registers to their local ids.
244230
DenseMap<unsigned, unsigned> Reg2Local;
245231

llvm/test/CodeGen/WebAssembly/fake-use.ll

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)