[PATCH] D143854: [DirectX backend] remove string function attribute and unused module flags
Xiang Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 13 09:52:31 PST 2023
python3kgae marked 2 inline comments as done.
python3kgae added inline comments.
================
Comment at: llvm/lib/Target/DirectX/DXILPrepare.cpp:109
+static void cleanModuleFlags(Module &M) {
+ constexpr StringLiteral DeadKeys[] = {"frame-pointer"};
+ // Collect DeadKeys in ModuleFlags.
----------------
beanz wrote:
> I'm not sure I agree with the approach of having a list of keys to delete. That seems maintenance-intensive and error prone.
>
> Why not instead only maintain a list of valid string attributes for DXIL, and strip everything else?
Fixed.
================
Comment at: llvm/lib/Target/DirectX/DirectXTargetMachine.cpp:80
addPass(createDXILTranslateMetadataPass());
+ addPass(createDXILPrepareModulePass());
}
----------------
beanz wrote:
> I think this makes sense, but I also think the `DXILTranslateMetadataPass` should be deleting the function attributes that it is translating.
>
> Once we run the `DXILTranslateMetadataPass` any later passes that need information from that gets captured in the metadata should be reading it out of the preserved analysis. Having `DXILTranslateMetadataPass` delete the sources of where it read from will help us keep that working as expected.
That is a good idea.
Do you mind do that in a separate PR?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143854/new/
https://reviews.llvm.org/D143854
More information about the llvm-commits
mailing list