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

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 14:17:45 PST 2019


bmahjour added inline comments.


================
Comment at: llvm/lib/Analysis/DependenceAnalysis.cpp:198
             OS << "none!\n";
+          OS << "  Src:" << *SrcI << " --> Dst:" << *DstI << "\n";
         }
----------------
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?


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