This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Explicitly fail trying to translate `gc.statepoint` and related intrinsics
ClosedPublic

Authored by zero9178 on Aug 30 2022, 2:08 PM.

Details

Summary

The provided testcase would previously fail with an assertion due to later down below trying to allocate registers for token return types and arguments. This is especially problematic as the process would then exit instead of falling back to using FastIsel.

This patch fixes that by simply explicitly failing translation if either of these intrinsics are encountered.

Fixes https://github.com/llvm/llvm-project/issues/57349


Another attempt of mine modified the code below to avoid allocating registers for token types. I felt like that approach was more fragile however and would essentially turn to dead code in a future where these intrinsics get a custom lowering.

Diff Detail

Event Timeline

zero9178 created this revision.Aug 30 2022, 2:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 2:08 PM
zero9178 requested review of this revision.Aug 30 2022, 2:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 2:08 PM

Can you add a check to llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll as well?

zero9178 updated this revision to Diff 456798.Aug 30 2022, 2:32 PM

Address review comments: Also add test to arm64-fallback.ll

paquette accepted this revision.Aug 30 2022, 3:33 PM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 30 2022, 3:33 PM