aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2021-12-16 12:40:13 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2022-01-31 15:55:58 -0500
commit2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0 (patch)
tree8c0f41c0aef2e04422ac71c01a2224fd61dfcad1 /flang/lib/Frontend/CompilerInvocation.cpp
parent78fd413cf736953ac623cabf3d5f84c8219e31f8 (diff)
downloadllvm-2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0.zip
llvm-2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0.tar.gz
llvm-2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0.tar.bz2
[OpenMP] Introduce new flag to change offloading driver pipeline
This patch introduces the `-fopenmp-new-driver` option which instructs the compiler to use a new driver scheme for producing offloading code. In this scheme we create a complete offloading object file and then pass it as input to the host compilation phase. This will allow us to embed the object code in the backend phase. This is the start of a series of commits to rework the OpenMP offloading driver pipeline. The goal of this is to simplify the steps required for creating an offloading program. This patch changes the driver's configuration to simply pass the device file back to the host as an input so it can be embedded as an LLVM IR global during the backend, then simply passes that object file to the linker. This driver implementation will currently create the following phases, ``` $ clang input.c -fopenmp -fopenmp-targets=nvptx64 -fopenmp-new-driver -ccc-print-phases +- 0: input, "input.c", c, (host-openmp) +- 1: preprocessor, {0}, cpp-output, (host-openmp) +- 2: compiler, {1}, ir, (host-openmp) | | +- 3: input, "input.c", c, (device-openmp) | | +- 4: preprocessor, {3}, cpp-output, (device-openmp) | |- 5: compiler, {4}, ir, (device-openmp) | +- 6: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (nvptx64)" {5}, ir | +- 7: backend, {6}, assembler, (device-openmp) |- 8: assembler, {7}, object, (device-openmp) +- 9: offload, "host-openmp (x86_64-unknown-linux-gnu)" {2}, "device-openmp (nvptx64)" {8}, ir +- 10: backend, {9}, assembler, (host-openmp) +- 11: assembler, {10}, object, (host-openmp) 12: clang-linker-wrapper, {11}, image, (host-openmp) ``` Which will map to the following bindings ``` # "x86_64-unknown-linux-gnu" - "clang", inputs: ["input.c"], output: "/tmp/input-bae62e.bc" # "nvptx64" - "clang", inputs: ["input.c", "/tmp/input-bae62e.bc"], output: "/tmp/input-76784e.s" # "nvptx64" - "NVPTX::Assembler", inputs: ["/tmp/input-76784e.s"], output: "/tmp/input-8f29db.o" # "x86_64-unknown-linux-gnu" - "clang", inputs: ["/tmp/input-bae62e.bc", "/tmp/input-8f29db.o"], output: "/tmp/input-545450.o" # "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: ["/tmp/input-545450.o"], output: "a.out" ``` Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D116541
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions