[PATCH] D143854: [DirectX backend] remove string function attribute and unused module flags

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 08:29:42 PST 2023


beanz 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.
----------------
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?


================
Comment at: llvm/lib/Target/DirectX/DirectXTargetMachine.cpp:80
     addPass(createDXILTranslateMetadataPass());
+    addPass(createDXILPrepareModulePass());
   }
----------------
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.


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