[PATCH] D121299: [NVPTX] Disable DWARF .file directory for PTX

Andrew Savonichev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 11:50:11 PDT 2022


asavonic added a comment.

In D121299#3405993 <https://reviews.llvm.org/D121299#3405993>, @MaskRay wrote:

> I just worry whether this patch may be busywork. It seems like a "UI" thing of llc anyway, not really affecting Clang.

Yes, this is only about llc command line interface for PTX.

> AIUI the complexity is to make `llc -mtriple=nvptx64-nvidia-cuda -dwarf-directory=0 a.ll` users convenient, but they can use `clang --target=nvptx64-nvidia-cuda -S a.ll` instead, to avoid setting `-dwarf-directory`.

Well, my motivation is to avoid adding this option to every llc LIT test that requires it (as part of D121727 <https://reviews.llvm.org/D121727>), and there is no way to use clang for them.
Also, I believe is that "by default" llc should output valid assembly for the target. If it doesn't, then it is inconvenient to use at best, or a source of errors for no good reason.

> What we need to do is make tradeoff between complexity and convenience. Omitting `-dwarf-directory=0` considering that (a) clang doesn't need the manual setting (b) the mechanism will need to be removed in the future makes me unsure we need to introduce the seemingly heavy infrastructure as implemented in this patch.

Clang driver is a separate subject. Many tests do not use clang driver, developers may not use it, and there are other frontends that all need to pass this option.

> If the patch is reworked to avoid `EnableDwarfFileDirectoryDefault`, I may concede.

I see a couple of options:

- revert this default back to `false`.
- add a check for `Triple = NVPTX` directly to llc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121299/new/

https://reviews.llvm.org/D121299



More information about the llvm-commits mailing list