[PATCH] D71088: [DA] Improve dump to show source and sink of the dependence

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 8 04:33:59 PST 2019


dmgreen added a comment.

Nice. I always found this a bit awkward.



================
Comment at: llvm/lib/Analysis/DependenceAnalysis.cpp:198
             OS << "none!\n";
+          OS << "  Src:" << *SrcI << " --> Dst:" << *DstI << "\n";
         }
----------------
bmahjour wrote:
> fhahn wrote:
> > Printing that last seems a bit odd to me. How about moving it up and have something like `"da analyze - Src" << *SrcI << " --> Dst :" << *DstI`?
> I thought about putting it on the same line as "da analyze", but that would break every test case in da, and also makes the output a bit cluttered and hard to read (it would be hard to find the actual dependence info).
> 
> I could put it at the beginning and indent the "da analyze - " part. ie change the output from:
> 
> ```
> 'Dependence Analysis' for function 'foo':
> da analyze - none!
>   Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  store float %conv, float* %arrayidx, align 4
> da analyze - confused!
>   Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  call void @bar(float* %A)
> da analyze - confused!
>   Src:  call void @bar(float* %A) --> Dst:  call void @bar(float* %A)
> ```
> to
> ```
> 'Dependence Analysis' for function 'foo':
> Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  store float %conv, float* %arrayidx, align 4
>   da analyze - none!
> Src:  store float %conv, float* %arrayidx, align 4 --> Dst:  call void @bar(float* %A)
>   da analyze - confused!
> Src:  call void @bar(float* %A) --> Dst:  call void @bar(float* %A)
>   da analyze - confused!
> ```
> 
> Do people prefer that?
I would say the second probably makes more sense for people unfamiliar with the output before. It shows what it is analysing, then the result it came up with.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71088





More information about the llvm-commits mailing list