[PATCH] Random Number Generator Refactoring (removing from Module)

JF Bastien jfb at chromium.org
Wed Aug 20 13:40:34 PDT 2014


This looks good to me if nobody else has objections. I would like you to consider my comment below, let me know what you think.

================
Comment at: include/llvm/IR/Module.h:266
@@ -263,1 +265,3 @@
+  /// versions when the pass does not change.
+  RandomNumberGenerator *createRNG(StringRef PassSalt) const;
 
----------------
I'm still wondering if it would be better for this API to take in a `const Pass *` and use `P->getName()` as the Pass salt. This makes it easier to use the RNG correctly, since Pass authors don't need to think about the Pass salt, the same way they don't need to think about the Module salt. LLVM's RegisterPass takes in a PassName argument, so all passes should already have a name (avoiding duplicate salt issues).

http://reviews.llvm.org/D4377






More information about the llvm-commits mailing list