[PATCH] D80996: [AMDGPU][OpenMP] Fix duplicate copies of arguments in commands

Pushpinder Singh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 18:14:07 PDT 2020


pdhaliwal abandoned this revision.
pdhaliwal marked an inline comment as done.
pdhaliwal added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/HIP.cpp:389
 
-  for (Arg *A : Args) {
-    DAL->append(A);
+  if (DeviceOffloadKind != Action::OFK_OpenMP) {
+    for (Arg *A : Args) {
----------------
sameerds wrote:
> pdhaliwal wrote:
> > arsenm wrote:
> > > Needs a comment? I don't understand why openmp is any different here
> > `HostTC.TranslateArgs` (HostTC = Generic_GCC, Line#383) returns `DAL` which  contains `Args` when offloadkind is OFK_OpenMP (for all other cases, it returns nullptr). Thus, Line#{390,391} is just duplicating the arguments which are propagating to the opt, llc, etc. commands.
> > Ref: https://clang.llvm.org/doxygen/Gnu_8cpp_source.html#l02966
> I think @arsenm was asking for a comment in the code itself.
> 
> Also, I am not sufficiently familiar with the design here, but why is the HIP driver checking for OpenMP offloading? Is the offloaded region treated as HIP code? It seems a bit strange that we are mixing two different things in the same driver.
@sameerds you are correct, openmp should not be mixing things in HIP driver. So, I am dropping this patch before it creates more confusion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80996





More information about the cfe-commits mailing list