[PATCH] D26420: Encode duplication factor from loop vectorization and loop unrolling to discriminator.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 3 18:53:49 PST 2016


hfinkel added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:1684
+
+/*
+ unsigned D = getDiscriminator();
----------------
Please move the comments that explain the encoding to above `DILocation::getBaseDiscriminator` and write some text to explain what is going on.


================
Comment at: lib/Transforms/Utils/AddDiscriminators.cpp:197
       // it in 1 byte ULEB128 representation.
-      unsigned Discriminator = (R.second ? ++LDM[L] : LDM[L]) & 0x7f;
+      unsigned Discriminator = ((R.second ? ++LDM[L] : LDM[L]) << 1) & 0x7f;
       I.setDebugLoc(DIL->cloneWithDiscriminator(Discriminator));
----------------
Please add a utility function for the encoding.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:216
 
+extern cl::opt<bool> EncodeDuplicationInDiscriminators;
+
----------------
Based on one of the other threads, I suppose we're going to add some command-line flag to enable/disable this? That being the case, we'll read this setting from some function attribute string instead of using  a cl::opt.


https://reviews.llvm.org/D26420





More information about the llvm-commits mailing list