[WebAssembly] Disable the store-results optimization.

The WebAssemly spec removing the return value from store instructions, so
remove the associated optimization from LLVM.

This patch leaves the store instruction operands in place for now, so stores
now always write to "$drop"; these will be removed in a seperate patch.

llvm-svn: 279100
This commit is contained in:
Dan Gohman
2016-08-18 17:51:27 +00:00
parent e2f36bcb84
commit c9623db884
7 changed files with 70 additions and 154 deletions

View File

@@ -139,15 +139,6 @@ static bool ReplaceDominatedUses(MachineBasicBlock &MBB, MachineInstr &MI,
return Changed;
}
static bool optimizeStore(MachineBasicBlock &MBB, MachineInstr &MI,
const MachineRegisterInfo &MRI,
MachineDominatorTree &MDT,
LiveIntervals &LIS) {
unsigned ToReg = MI.getOperand(0).getReg();
unsigned FromReg = MI.getOperand(WebAssembly::StoreValueOperandNo).getReg();
return ReplaceDominatedUses(MBB, MI, FromReg, ToReg, MRI, MDT, LIS);
}
static bool optimizeCall(MachineBasicBlock &MBB, MachineInstr &MI,
const MachineRegisterInfo &MRI,
MachineDominatorTree &MDT,
@@ -202,17 +193,6 @@ bool WebAssemblyStoreResults::runOnMachineFunction(MachineFunction &MF) {
switch (MI.getOpcode()) {
default:
break;
case WebAssembly::STORE8_I32:
case WebAssembly::STORE16_I32:
case WebAssembly::STORE8_I64:
case WebAssembly::STORE16_I64:
case WebAssembly::STORE32_I64:
case WebAssembly::STORE_F32:
case WebAssembly::STORE_F64:
case WebAssembly::STORE_I32:
case WebAssembly::STORE_I64:
Changed |= optimizeStore(MBB, MI, MRI, MDT, LIS);
break;
case WebAssembly::CALL_I32:
case WebAssembly::CALL_I64:
Changed |= optimizeCall(MBB, MI, MRI, MDT, LIS, TLI, LibInfo);