Skip to content

Commit 500f68f

Browse files
committed
Ensure we stop at BC emission when mixing amdgcnspirv and concrete, otherwise the toolchain gets confused.
1 parent 134cb88 commit 500f68f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,9 +3750,12 @@ class OffloadingActionBuilder final {
37503750
// compiler phases, including backend and assemble phases.
37513751
ActionList AL;
37523752
Action *BackendAction = nullptr;
3753-
if (ToolChains.front()->getTriple().isSPIRV()) {
3753+
if (ToolChains.front()->getTriple().isSPIRV() ||
3754+
(ToolChains.front()->getTriple().isAMDGCN() &&
3755+
GpuArchList[I] == StringRef("amdgcnspirv"))) {
37543756
// Emit LLVM bitcode for SPIR-V targets. SPIR-V device tool chain
3755-
// (HIPSPVToolChain) runs post-link LLVM IR passes.
3757+
// (HIPSPVToolChain or HIPAMDToolChain) runs post-link LLVM IR
3758+
// passes.
37563759
types::ID Output = Args.hasArg(options::OPT_S)
37573760
? types::TY_LLVM_IR
37583761
: types::TY_LLVM_BC;

0 commit comments

Comments
 (0)