1 //===-- NoopInsertion.h - Noop Insertion ------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This pass adds fine-grained diversity by displacing code using randomly
11 // placed (optionally target supplied) Noop instructions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_NOOPINSERTION_H
16 #define LLVM_CODEGEN_NOOPINSERTION_H
18 #include "llvm/CodeGen/MachineFunctionPass.h"
23 class RandomNumberGenerator;
25 class NoopInsertion : public MachineFunctionPass {
32 bool runOnMachineFunction(MachineFunction &MF) override;
34 void getAnalysisUsage(AnalysisUsage &AU) const override;
36 std::unique_ptr<RandomNumberGenerator> RNG;
38 // Uniform real distribution from 0 to 100
39 std::uniform_real_distribution<double> Distribution =
40 std::uniform_real_distribution<double>(0, 100);
44 #endif // LLVM_CODEGEN_NOOPINSERTION_H