On Thu, Mar 16, 2017, at 08:58 PM, SANJAY SRIVALLABH SINGAPURAM wrote:
> Hello Tobias,
>
> I shifted to using the Julia no-debug build.
OK. If it is easy, would be great if you could upstream a fix for the
debug version as well. (The one that ignores the intrinsics).
> findReferencesInBlock
> couldn't
> find any debug information but generated a new error.
>
> $ opt kernel_gemm-before.ll -O3 -polly -S -o output.ll
> DICompileUnit not listed in
llvm.dbg.cu
> !6 = distinct !DICompileUnit(language: DW_LANG_C89, file: !3, producer:
> "julia", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug,
> enums: !5)
> finalizeKernelFunction:BuildFailed
> 10
> i64 %1
> 20
> i64 %0
>
> The following changes removed all debug info and generated the kernel.
>
> <polly_src>/lib/CodeGen/PPCGCodeGeneration.cpp
> @@ -1590,7 +1599,10 @@ std::string GPUNodeBuilder::createKernelASM() {
> *+#include "llvm/IR/DebugInfo.h" // Can I do without this ?*
Looks good, but maybe better at the top of the file?
> std::string GPUNodeBuilder::finalizeKernelFunction() {
> +
> *+ llvm::StripDebugInfo((*GPUModule));*
>
> <llvm_src>/lib/Support/TargetRegistry.cpp
> @@ -63,6 +63,7 @@ const Target *TargetRegistry::lookupTarget(const
> std::string &ArchName,
> const Target *TargetRegistry::lookupTarget(const std::string &TT,
> std::string &Error) {
> // Provide special warning when no targets are initialized.
> + llvm::errs() << "Target Triple:" << TT << '\n';
>
> julia> @time kernel_gemm( 1, 0, s_c, s_a, s_b );
> Target Triple:nvptx64-nvidia-cuda
> No available targets are compatible with this triple. *## Does this mean
> it
> didn't generate the kernel ?*
No. Most likely you do not have the NVPTX backend compiled into Julia.
> 10
> i64 %1
> 20
> i64 %0
> LLVM ERROR: Program used external function 'polly_getKernel' which could
> not be resolved!
OK. Seems that GPURuntime is not properly linked. Can you try to just
LD_PRELOAD it and see if that at least works?
> Adding the rpath to the linker options didn't alleviate the problem,
> <julia_src>/src/Makefile
> @@ -57,7 +57,7 @@
> -LLVMLINK += -lPolly -lPollyISL
> +LLVMLINK += -lPolly -lPollyISL -lPollyPPCG
> -Wl,-rpath=/home/sanjay/Software/polly_julia/llvm_build/lib -lGPURuntime
>
> It was strange to see that the kernel string was actually missing in
> kernel_gemm-after.ll and was present output.ll generated as follows,
> $ ./llvm_build/bin/opt kernel_gemm-before.ll -O3 -polly -S -o output.ll
> Target Triple:x86_64-unknown-linux-gnu
> Target Triple:nvptx64-nvidia-cuda *## No issues with this target
> triple.
> !!*
> 10
> i64 %1
> 20
> i64 %0
>
> I've attached kernel_gemm-before.ll, output.ll and kernel_gemm-after.ll.
Best,
Tobias
> Email had 3 attachments:
> + kernel_gemm-before.ll
> 10k (application/octet-stream)
> + kernel_gemm-after.ll
> 36k (application/octet-stream)
> + output.ll
> 36k (application/octet-stream)