[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-24 Thread Joseph Huber via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd50dacd7c3c2: [Clang] Only emit textual LLVM-IR in device only mode (authored by jhuber6). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-24 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141717/new/ https://reviews.llvm.org/D141717 ___

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 491866. jhuber6 added a comment. Exempting HIP using the old driver. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141717/new/ https://reviews.llvm.org/D141717 Files: clang/lib/Driver/Driver.cpp

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-24 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4074842 , @yaxunl wrote: > Can we keep the original behaviour for the old driver for HIP? Only enable > the change for the new driver. That's probably fair because AFAIK that will still use the

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Can we keep the original behaviour for the older driver for HIP? Only enable the change for the new driver. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141717/new/ https://reviews.llvm.org/D141717

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-23 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In D141717#4056971 , @yaxunl wrote: > The intention of -emit-llvm -S is usually to get LLVM assembly for all > targets for inspection or modification. HIP emits a bundled LLVM assembly in > textual format in this case. Users

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-23 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. Ping, is it possible to resolve this before the fork tomorrow? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141717/new/ https://reviews.llvm.org/D141717 ___ cfe-commits mailing

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-16 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4056971 , @yaxunl wrote: > The intention of -emit-llvm -S is usually to get LLVM assembly for all > targets for inspection or modification. HIP emits a bundled LLVM assembly in > textual format in this case. Users

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. The intention of -emit-llvm -S is usually to get LLVM assembly for all targets for inspection or modification. HIP emits a bundled LLVM assembly in textual format in this case. Users can modify it directly, or extract assembly for each device and bundle them together

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-16 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. I made the phases always go to `Assemble` but it didn't make a difference. We still get the textual IR here without the exception I added. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141717/new/

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4053164 , @tra wrote: >> So are you suggesting that we complete the whole pipeline? So -S -emit-llvm >> gives host IR, but the device will go all the way to object? > > That would match my expectations and would solve

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > So are you suggesting that we complete the whole pipeline? So -S -emit-llvm > gives host IR, but the device will go all the way to object? That would match my expectations and would solve the " it can't be handled by LTO or anything else." issue you've highlighted above.

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4052986 , @tra wrote: > In D141717#4052824 , @jhuber6 wrote: > >> For `-E` we don't embed anything, > > That was just an exaggerated example of top-level options affecting >

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D141717#4052824 , @jhuber6 wrote: > For `-E` we don't embed anything, That was just an exaggerated example of top-level options affecting sub-compilation output where you can't magically tweak it to produce the kind of output

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4052753 , @tra wrote: > In D141717#4052587 , @jhuber6 wrote: > >> Well you'll get textual output for the host output, but the device code >> embedded in the host module will

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D141717#4052587 , @jhuber6 wrote: > Well you'll get textual output for the host output, but the device code > embedded in the host module will be bitcode instead. So the final output from > the compiler is still textual IR. It

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment. In D141717#4052514 , @tra wrote: > Textual output for "-S -emit-llvm" is the canonical behavior, so I would > prefer it working that way in as many cases as possible and only override it > when necessary. > > Would it be

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Textual output for "-S -emit-llvm" is the canonical behavior, so I would prefer it working that way in as many cases as possible and only override it when necessary. Would it be possible to enforce binary IR generation in cases you need it? Or to prove that this is

[PATCH] D141717: [Clang] Only emit textual LLVM-IR in device only mode

2023-01-13 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: jdoerfert, tianshilei1992, tra, yaxunl, JonChesterfield. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, sstefan1, MaskRay. Herald added a project: clang. Currently, we embed