Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HIP-Clang] propagate -mllvm options to opt and llc
Change the HIP Toolchain to pass the OPT_mllvm options into OPT and LLC stages. Added a lit test to verify the command args. Reviewers: yaxunl Differential Revision: https://reviews.llvm.org/D59316 llvm-svn: 356277
- Loading branch information
1 parent
e3d3e86
commit 04fddc9
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// REQUIRES: clang-driver | ||
// REQUIRES: x86-registered-target | ||
// REQUIRES: amdgpu-registered-target | ||
|
||
// RUN: %clang -### -target x86_64-linux-gnu \ | ||
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \ | ||
// RUN: -mllvm -amdgpu-function-calls=0 \ | ||
// RUN: %s 2>&1 | FileCheck %s | ||
|
||
// CHECK: [[CLANG:".*clang.*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa" | ||
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" | ||
// CHECK-SAME: {{.*}} "-target-cpu" "gfx803" | ||
// CHECK-SAME: {{.*}} "-mllvm" "-amdgpu-function-calls=0" {{.*}} | ||
|
||
// CHECK: [[OPT:".*opt"]] {{".*-gfx803-linked.*bc"}} "-mtriple=amdgcn-amd-amdhsa" | ||
// CHECK-SAME: "-mcpu=gfx803" "-amdgpu-function-calls=0" | ||
// CHECK-SAME: "-o" [[OPT_803_BC:".*-gfx803-optimized.*bc"]] | ||
|
||
// CHECK: [[LLC: ".*llc"]] [[OPT_803_BC]] | ||
// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa" "-filetype=obj" | ||
// CHECK-SAME: {{.*}} "-mcpu=gfx803" | ||
// CHECK-SAME: "-amdgpu-function-calls=0" "-o" {{".*-gfx803-.*o"}} | ||
|
||
// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa" | ||
// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" | ||
// CHECK-SAME: {{.*}} "-target-cpu" "gfx900" | ||
// CHECK-SAME: {{.*}} "-mllvm" "-amdgpu-function-calls=0" {{.*}} | ||
|
||
// CHECK: [[OPT]] {{".*-gfx900-linked.*bc"}} "-mtriple=amdgcn-amd-amdhsa" | ||
// CHECK-SAME: "-mcpu=gfx900" "-amdgpu-function-calls=0" | ||
// CHECK-SAME: "-o" [[OPT_900_BC:".*-gfx900-optimized.*bc"]] | ||
|
||
// CHECK: [[LLC]] [[OPT_900_BC]] | ||
// CHECK-SAME: "-mtriple=amdgcn-amd-amdhsa" "-filetype=obj" | ||
// CHECK-SAME: {{.*}} "-mcpu=gfx900" | ||
// CHECK-SAME: "-amdgpu-function-calls=0" "-o" {{".*-gfx900-.*o"}} |