This is an archive of the discontinued LLVM Phabricator instance.

[DirectX backend] remove hlsl.* FnAttr after use.
Needs ReviewPublic

Authored by python3kgae on Feb 23 2023, 11:04 AM.

Details

Summary

Function attribute like hlsl.shader is not needed after DXILTranslateMetadata pass.
And it should be removed for DXIL.

So remove it once the information is collect.

Diff Detail

Event Timeline

python3kgae created this revision.Feb 23 2023, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 11:04 AM
python3kgae requested review of this revision.Feb 23 2023, 11:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 11:04 AM

Remove hlsl attr in DXILTranslateMetadata.

beanz added inline comments.Mar 6 2023, 1:53 PM
llvm/lib/Target/DirectX/DXILMetadata.cpp
99

I'm not sure I understand this refactoring... It looks like you're trying to avoid looking up the attribute more than once, but it means you're keeping track of the Attribute and passing it around through layers... I'm not convinced that is beneficial.

python3kgae added inline comments.Mar 6 2023, 1:58 PM
llvm/lib/Target/DirectX/DXILMetadata.cpp
99

How about send the Entry shader kind for library directly?
Then we can remove the if (ShaderKind == Triple::EnvironmentType::Library) and no extra Attribute needs to be sent down.

Avoid send EntryAttr as input parameter for EntryProps constructor.