This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Directly diagnose return value use for FP atomics
ClosedPublic

Authored by arsenm on Jan 19 2022, 8:50 AM.

Details

Reviewers
rampitec
Group Reviewers
Restricted Project
Summary

Emit an error if the return value is used on subtargets that do not
support them. Previously we were falling back to the DAG on selection
failure, where it would emit this error and then fail again.

Diff Detail

Event Timeline

arsenm created this revision.Jan 19 2022, 8:50 AM
arsenm requested review of this revision.Jan 19 2022, 8:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2022, 8:50 AM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec added inline comments.
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.raw.buffer.atomic.fadd-with-ret.ll
8

Why there is a second message?

arsenm added inline comments.Jan 19 2022, 9:35 AM
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.raw.buffer.atomic.fadd-with-ret.ll
8

There are 2 cases here that fail, both should get an error

This revision is now accepted and ready to land.Jan 19 2022, 9:37 AM
foad added a comment.Jan 20 2022, 12:42 AM

Previously we were falling back to the DAG on selection
failure, where it would emit this error and then fail again.

Why is that a problem? Is this just a temporary thing, while you are testing with the fallback to dag enabled?

To put it another way, what's so special about this case that legalization has to fail harder than other cases?

Previously we were falling back to the DAG on selection
failure, where it would emit this error and then fail again.

Why is that a problem? Is this just a temporary thing, while you are testing with the fallback to dag enabled?

The permanent solution is to remove the DAG completely so this should have matching behavior

To put it another way, what's so special about this case that legalization has to fail harder than other cases?

It also saves compile time from compiling the function twice