HomePhabricator

[WebAssembly] Fix memory bug introduced in 52861809994c

Authored by tlively on Feb 19 2020, 3:01 PM.

Description

[WebAssembly] Fix memory bug introduced in 52861809994c

Summary:
The instruction at DefI can sometimes be destroyed by
rematerializeCheapDef, so it should not be used after calling that
function. The fix is to use Insert instead when examining additional
multivalue stackifications. Insert is the address of the new
defining instruction after all moves and rematerializations have taken
place.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74875