This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix liveness tracking info after drop insertion
ClosedPublic

Authored by aheejin on Jun 16 2018, 2:51 AM.

Details

Summary

This fixes liveness tracking information after drop instruction
insertion in ExplicitLocals pass.

When a drop instruction is inserted to drop a dead register operand, the
original operand should be marked not dead anymore because it is now
used by the new drop instruction. And the operand to the new drop
instruction should be marked killed instead. This bug caused some
programs to fail when llc is run with -verify-machineinstrs option.

Diff Detail

Event Timeline

aheejin created this revision.Jun 16 2018, 2:51 AM
aheejin edited the summary of this revision. (Show Details)Jun 16 2018, 2:54 AM
aheejin added inline comments.Jun 16 2018, 3:05 AM
test/CodeGen/WebAssembly/explicit-locals.mir
15

The reason we need an empty BB here is, to reveal the bug, the block to which a drop will be inserted should have a predecessor.

dschuff accepted this revision.Jun 19 2018, 1:25 PM
This revision is now accepted and ready to land.Jun 19 2018, 1:25 PM
This revision was automatically updated to reflect the committed changes.