This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow MIMG with no uses in adjustWritemask in isel
ClosedPublic

Authored by dstuttard on Mar 5 2019, 6:41 AM.

Details

Summary

If an MIMG instruction has managed to get through to adjustWritemask in isel but
has no uses (and doesn't enable TFC) then prevent an assertion by not attempting
to adjust the writemask.

The instruction will be removed anyway.

Change-Id: I9a5dba6bafe1f35ac99c1b73df390936e2ac27a7

Diff Detail

Repository
rL LLVM

Event Timeline

dstuttard created this revision.Mar 5 2019, 6:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 5 2019, 6:41 AM
arsenm added inline comments.Mar 5 2019, 8:11 AM
test/CodeGen/AMDGPU/img-nouse-adjust.ll
14–15 ↗(On Diff #189314)

The trap should be removed and the unreachable replaced with return

dstuttard marked an inline comment as done.Mar 6 2019, 4:53 AM
dstuttard added inline comments.
test/CodeGen/AMDGPU/img-nouse-adjust.ll
14–15 ↗(On Diff #189314)

The problem doesn't happen if you remove the trap.

arsenm added inline comments.Mar 6 2019, 6:57 AM
test/CodeGen/AMDGPU/img-nouse-adjust.ll
14–15 ↗(On Diff #189314)

A fake side effect asm call would probably work and be less likely to break for unrelated reasons

dstuttard updated this revision to Diff 189716.Mar 7 2019, 7:30 AM

Modified test in line with review comments

dstuttard marked 2 inline comments as done.Mar 7 2019, 7:31 AM
dstuttard added inline comments.
test/CodeGen/AMDGPU/img-nouse-adjust.ll
14–15 ↗(On Diff #189314)

Yes, that worked - thanks.

dstuttard marked an inline comment as done.Mar 18 2019, 3:24 AM

ping

arsenm accepted this revision.Mar 18 2019, 7:21 AM

LGTM

This revision is now accepted and ready to land.Mar 18 2019, 7:21 AM
This revision was automatically updated to reflect the committed changes.