[flang-commits] [flang] [llvm] [OpenMPIRBuilder] Always inline device-outlined target regions (PR #211136)

Spencer Bryngelson via flang-commits flang-commits at lists.llvm.org
Wed Jul 22 06:04:22 PDT 2026


================
@@ -950,6 +955,13 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
     if (TargetFeaturesAttr.isStringAttribute())
       OutlinedFn->addFnAttr(TargetFeaturesAttr);
 
+    // On device, keep the outlined region in the kernel: left standalone it is
+    // register allocated without the kernel's occupancy target. The function is
+    // still emitted for entry points that take its address (generic mode).
+    if (DeviceAlwaysInlineOutlined && Config.isTargetDevice() &&
----------------
sbryngelson wrote:

Agreed, all the data is gfx90a and gfx942. I have no NVIDIA hardware to measure on. Moot if the PR is replaced by the narrower fix, but if it stays I will guard it on the triple rather than default the flag off.

https://github.com/llvm/llvm-project/pull/211136


More information about the flang-commits mailing list