From 92cc29ae2b5c2f0e0542e12b8747ce77f3dc7ebd Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 17 Feb 2020 09:19:26 -0800 Subject: [PATCH] Let HIP-Clang inline all functions by default (#1875) This is a quick workaround to match HCC behavior for performance since inlining usually results in more optimization opportunities therefore better performance. We will fine tuning inline threashold later. --- bin/hipcc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/hipcc b/bin/hipcc index 1bdb466c68..41f11a36b4 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -727,6 +727,10 @@ if ($HIP_PLATFORM eq "clang") { $HIPCXXFLAGS .= " -O3"; $HIPLDFLAGS .= " -O3"; } + if ($optArg ne "-O0") { + $HIPCXXFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; + $HIPLDFLAGS .= " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false"; + } $HIP_DEVLIB_FLAGS = " --hip-device-lib-path=$DEVICE_LIB_PATH"; $HIPCXXFLAGS .= " $HIP_DEVLIB_FLAGS"; if (not $isWindows) {