[PATCH] D58463: [CUDA]Delayed diagnostics for the asm instructions.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 11:37:02 PST 2019


tra added a comment.

> Hi Artem, I think we can just delay emission of this warning to solve this problem.

I'm not sure we can always tell whether the warning is real or if it's the consequence of failing to parse inline asm.

E.g.:

  namespace {
  __host__ __device__ a() {
    int prev;
    __asm__ __volatile__("mov %0, 0" : "=a" (prev)::);
    return prev;
  }
  
  __host__ __device__ b() {
    int prev;
    return prev;
  }
  
  } //namespace

Ideally we should always emit uninitialized diagnostics for `b`, but never for `a` in both host and device compilation modes.
I think we may want to propagate assignment from the inline asm statement -- we may not know the meaning of the constraint, but we do know which argument gets used/modified by the asm statement. Perhaps we can construct a fake GCCAsmStmt but bail out before we attempt to validate the asm string.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58463





More information about the llvm-commits mailing list