This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix use-after-free in SIOptimizeExecMasking
ClosedPublic

Authored by nhaehnle on Oct 6 2016, 1:42 AM.

Details

Summary

There was a bug with sequences like

s_mov_b64 s[0:1], exec
s_and_b64 s[2:3]<def>, s[0:1], s[2:3]<kill>
...
s_mov_b64_term exec, s[2:3]

because s[2:3] was defined and used in the same instruction, ending up with
SaveExecInst inside OtherUseInsts.

Note that the test case also exposes an unrelated bug.

Event Timeline

nhaehnle updated this revision to Diff 73739.Oct 6 2016, 1:42 AM
nhaehnle retitled this revision from to AMDGPU: Fix use-after-free in SIOptimizeExecMasking.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
arsenm accepted this revision.Oct 6 2016, 2:37 AM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 6 2016, 2:37 AM
This revision was automatically updated to reflect the committed changes.