[all-commits] [llvm/llvm-project] f698bf: [clang-repl] Fix PTX emission for CUDA inputs with...
Aaron Jomy via All-commits
all-commits at lists.llvm.org
Fri Oct 2 05:14:53 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f698bf310346a643113604245c6f1e87fae139f4
https://github.com/llvm/llvm-project/commit/f698bf310346a643113604245c6f1e87fae139f4
Author: Aaron Jomy <aaronjomyjoseph at gmail.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M clang/lib/Interpreter/DeviceOffload.cpp
A clang/test/Interpreter/CUDA/empty-device-module.cu
M clang/unittests/Interpreter/DeviceOffloadTest.cpp
Log Message:
-----------
[clang-repl] Fix PTX emission for CUDA inputs with no device code (#226977)
Previously, GeneratePTX() returned an error when PassManager::run()
returned false. That value reports whether any pass changed the module,
not whether emission succeeded. IIUC, addPassesToEmitFile() should be
the only failure point, which is already checked.
The check was harmless until e8b75c172810 ("[NVPTX] Add NewPM
boilerplate to NVPTXAssignValidGlobalNames"). Before it, that pass
returned true unconditionally (if the pass succeeded), so run() always
reported a change. Now a device module without a function definition,
produced in the case of host-only inputs, reports no change and fails
the check, falsely erroring out with `Failed to emit PTX code.` Due to
this, every host-only input to `clang-repl --cuda` is now rejected on
main. The host-supports-cuda lit probe consists mostly of such inputs,
so clang/test/Interpreter/CUDA reports UNSUPPORTED instead of failing.
I've also added a test with host-only inputs so a regression like this
could be caught.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list