[PATCH] D82280: Fix for NVPTX module asm regression

Julia Tatz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 15:39:12 PDT 2020


jdtatz added a comment.

Using the unit test

  target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
  target triple = "nvptx-nvidia-cuda"
  
  module asm ".global .b32 val;"
  
  define void @foo() {
    ret void
  }

with llvm-10 invalid ptx is generated

                                          // Start of file scope inline assembly
  .global .b32 val;
  
                                          // End of file scope inline assembly
  //
  // Generated by LLVM NVPTX Back-End
  //
  
  .version 3.2
  .target sm_20
  .address_size 32
  
                                          // Start of file scope inline assembly
  .global .b32 val;
  
                                          // End of file scope inline assembly
  	// .globl	foo             // -- Begin function foo
                                          // @foo
  .visible .func foo()
  {
  
  
  // %bb.0:
  	ret;
                                          // -- End function
  }

with this patch valid ptx is generated

  //
  // Generated by LLVM NVPTX Back-End
  //
  
  .version 3.2
  .target sm_20
  .address_size 32
  
                                          // Start of file scope inline assembly
  .global .b32 val;
  
                                          // End of file scope inline assembly
  	// .globl	foo             // -- Begin function foo
                                          // @foo
  .visible .func foo()
  {
  
  
  // %bb.0:
  	ret;
                                          // -- End function
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82280/new/

https://reviews.llvm.org/D82280





More information about the llvm-commits mailing list