[PATCH] D45743: [Polly] Print executed statement instances at runtime.

Tobias Grosser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 00:44:08 PDT 2018


grosser added inline comments.


================
Comment at: include/polly/CodeGen/RuntimeDebugBuilder.h:36
+                                         llvm::StringRef Str) {
+    return Builder.CreateGlobalStringPtr(Str, "", 4);
+  }
----------------
Meinersbur wrote:
> philip.pfaffe wrote:
> > Why AddressSpace=4?
> I don't know, this is refactored from the existing RuntimeDebugBuilderCode, and is the reason why I refactored it out instead of calling `CreateGlobalStringPtr` directly.
> 
> I assume this puts string constants into the `.rodata` segment, but I didn't care enough to look it up.
This is the CUDA constant address space:

https://llvm.org/docs/NVPTXUsage.html#address-spaces

Probably comes historically when used for CUDA debugging. It also seems to work for CPUs and is used as an indicator to separate between strings and pointers (strings are printed as strings, pointers as integers).

As this is just a refactoring, we should likely document that we use address-space 4 as indicator for strings (rather than integers). It seems there is no easy way to do this differentiation, but if there is one one we should improve this in a followup patch.


Repository:
  rPLO Polly

https://reviews.llvm.org/D45743





More information about the llvm-commits mailing list