[PATCH] D82193: [OpenMPOpt] ICV macro definitions

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 21 09:32:26 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/test/Transforms/OpenMP/icv_tracking.ll:13
 
+; ICV_REMARKS: remark: <unknown>:0:0: OpenMP ICV nthreads Value: IMPLEMENTATION_DEFINED
+; ICV_REMARKS: remark: <unknown>:0:0: OpenMP ICV active_levels Value: 0
----------------
sstefan1 wrote:
> jdoerfert wrote:
> > sstefan1 wrote:
> > > jhuber6 wrote:
> > > > sstefan1 wrote:
> > > > > I wasn't sure how to add filenames here like in other remarks tests. Not sure we need them, but if someone knows how, please let me know.
> > > > It reads the debug information for the filename and line numbers. Something like this should let you set the filename.
> > > > 
> > > > ```
> > > > !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0 ")
> > > > !1 = !DIFile(filename: "filename.c", directory: "/tmp")
> > > > ```
> > > > 
> > > > Adding line numbers manually is a bit more complicated since it requires scoping information. There's usually a line like this
> > > > ```
> > > > !21 = !DILocation(line: 5, column: 10, scope: !14)
> > > > ```
> > > > And a corresponding usage assigning it to one of the instructions
> > > > ```
> > > >   %1 = tail call i32 @__kmpc_global_thread_num(%struct.ident_t* nonnull @0), !dbg !21
> > > > ```
> > > Thanks for answering. I guess I'm on my own if this is not completely generated by clang?
> > run clang with -g. Don't generate these on your own. 
> One more question. Does it make sense to have a separate file, eg. `icv_remarks.ll` (or use one of existing remarks tests) with only one simple function to test this? Debug info adds a lot of noise here. For exampe, for these limited number of tests we get 450+ additional lines. Furthermore, this test file will only grow in the future with the addition of other ICVs. This will probably also affect reviewing test changes. WDYT?
New file(s) is fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82193





More information about the llvm-commits mailing list