This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Support ConstantAsMetadata in IRTranslator
ClosedPublic

Authored by zuban32 on Aug 19 2021, 7:44 AM.

Details

Summary

When using instructions which have a MetadataAsValue argument
(e.g. some target-specific intrinsics)
MD canonicalization strips internal MDNodes with a
single ConstantAsMetadata child. That prevented IRTranslator
from the proper translation of such a calls.

Diff Detail

Event Timeline

zuban32 created this revision.Aug 19 2021, 7:44 AM
zuban32 requested review of this revision.Aug 19 2021, 7:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2021, 7:44 AM

Can you add a testcase?

zuban32 added a comment.EditedAug 20 2021, 4:50 AM

Can you add a testcase?

That's the problem, I couldn't find an in-tree target matching the usecase i.e. having some instruction (likely an intrinsic) accepting metadata argument

zuban32 updated this revision to Diff 368778.Aug 25 2021, 4:48 PM

Fix clang-tidy warning

Gentle ping

This revision is now accepted and ready to land.Aug 26 2021, 8:42 AM

Can someone pls commit this? I don't have an access to do that myself

Can someone pls commit this? I don't have an access to do that myself

Ping

arsenm added a comment.Sep 2 2021, 5:31 PM

Can you add a testcase?

That's the problem, I couldn't find an in-tree target matching the usecase i.e. having some instruction (likely an intrinsic) accepting metadata argument

llvm.amdgcn.reloc.constant uses a metadata argument

zuban32 updated this revision to Diff 372840.Sep 15 2021, 4:58 PM

Rebased, added a test.

arsenm accepted this revision.Sep 15 2021, 5:03 PM

Someone pls commit this, I don't have an access