From b198bc9ab73bdb0c810c0f958df1483e45c40e83 Mon Sep 17 00:00:00 2001 From: Janeczko Jakub <105227351+qbojj@users.noreply.github.com> Date: Sat, 17 Feb 2024 10:26:55 +0100 Subject: [PATCH] Remove unused RNG element from MBAAdd.cpp --- lib/MBAAdd.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/MBAAdd.cpp b/lib/MBAAdd.cpp index d91cf54e..6f085871 100644 --- a/lib/MBAAdd.cpp +++ b/lib/MBAAdd.cpp @@ -40,18 +40,7 @@ STATISTIC(SubstCount, "The # of substituted instructions"); //----------------------------------------------------------------------------- bool MBAAdd::runOnBasicBlock(BasicBlock &BB) { bool Changed = false; - - // Get a (rather naive) random number generator that will be used to decide - // whether to replace the current instruction or not. - // FIXME We should be using 'Module::createRNG' here instead. However, that - // method requires a pointer to 'Pass' on input and passes - // for the new pass manager _do_not_ inherit from llvm::Pass. In other words, - // 'createRNG' cannot be used here and there's no other way of obtaining - // llvm::RandomNumberGenerator. Last checked for LLVM 8. - std::mt19937_64 RNG; - RNG.seed(1234); - std::uniform_real_distribution Dist(0., 1.); - + // Loop over all instructions in the block. Replacing instructions requires // iterators, hence a for-range loop wouldn't be suitable for (auto Inst = BB.begin(), IE = BB.end(); Inst != IE; ++Inst) {