See details about the Bug: https://github.com/llvm/llvm-project/issues/59503
I try to fix it, what do you think about this bugfix?
I don't have commit access.
Closes #59503.
Differential D146272
[MLIR] Lowering from GPU to LLVM fails when the same kernel is called multiple times Alon_Lau on Mar 16 2023, 8:22 PM. Authored by
Details See details about the Bug: https://github.com/llvm/llvm-project/issues/59503 Closes #59503.
Diff Detail Event TimelineComment Actions It seems that the build environment doesn't have llvm-readelf or it's not in the PATH when testing`flang`: Script: -- : 'RUN: at line 5'; rm -f /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o : 'RUN: at line 6'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/flang-new -fc1 -triple riscv64-unknown-linux-gnu -target-feature +d -target-feature +c -emit-obj /var/lib/buildkite-agent/builds/llvm-project/flang/test/Driver/code-gen-rv64.f90 -o /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o : 'RUN: at line 8'; llvm-readelf -h /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/flang/test/Driver/code-gen-rv64.f90 : 'RUN: at line 10'; rm -f /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o : 'RUN: at line 11'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/flang-new --target=riscv64-unknown-linux-gnu -c /var/lib/buildkite-agent/builds/llvm-project/flang/test/Driver/code-gen-rv64.f90 -o /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o : 'RUN: at line 12'; llvm-readelf -h /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/flang/test/Driver/code-gen-rv64.f90 -- Exit Code: 2 Command Output (stderr): -- /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.script: line 3: llvm-readelf: command not found FileCheck error: '<stdin>' is empty. FileCheck command line: /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/flang/test/Driver/code-gen-rv64.f90 Comment Actions flang tests dependencies don't include llvm-readelf: https://github.com/llvm/llvm-project/blob/43eb96cab8f734a740b86c553f48f96fa9d19edc/flang/test/CMakeLists.txt#L50. Comment Actions The llvm-readelf in flang/test/Driver/code-gen-rv64.f90 should be changed to llvm-readobj, according to this commit: https://github.com/llvm/llvm-project/commit/0b958fe41182c9040499e629e24cbdd250d73bf7. Comment Actions Please add a test. The IR in the bug is a good start for the test, but can be simplified further. Comment Actions The gpu testcase is based on the pass-pipeline of cubin,the current compiler is not supported. Comment Actions
I'm sorry, I don't quite follow this. We have the -test-gpu-to-cubin pass specifically for testing the lowering without having the target-specific compiler. It should be possible to run that, followed by gpu-to-llvm lowering and drop everything else. The gpu-to-llvm lowering would create the single constant, we can actually check that the single constant was created. I don't mind the integration test, but it should be an addition to a unit test. Comment Actions I have upated the testcase by using '--test-gpu-to-cubin', but the other two testcases failed. I don't have the flangFeatureList.so. I can't fix the error, and analyze it. |
There is no reason why this file should be suffixed with ".fir". Please rename.