Skip to content

Commit

Permalink
Let HIP-Clang inline all functions by default (ROCm#1875)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yxsamliu authored Feb 17, 2020
1 parent 8c5e5e4 commit 92cc29a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/hipcc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 92cc29a

Please sign in to comment.