Lines Matching defs:IR
10 // vectorizer optimization pass over the given IR code. Then mimics lli on both
31 #include "llvm/IR/IRPrintingPasses.h"
32 #include "llvm/IR/LLVMContext.h"
33 #include "llvm/IR/LegacyPassManager.h"
34 #include "llvm/IR/LegacyPassNameParser.h"
35 #include "llvm/IR/Module.h"
36 #include "llvm/IR/Verifier.h"
95 // Mimics the opt tool to run an optimization pass over the provided IR
96 static std::string OptLLVM(const std::string &IR, CodeGenOpt::Level OLvl) {
100 std::unique_ptr<Module> M = parseIR(MemoryBufferRef(IR, "IR"), Err, Context);
102 ErrorAndExit("Could not parse IR");
135 // Add a pass that writes the optimized IR to an output stream
153 // Takes a string of IR and compiles it using LLVM's JIT Engine
154 static void CreateAndRunJITFunc(const std::string &IR, CodeGenOpt::Level OLvl) {
157 std::unique_ptr<Module> M = parseIR(MemoryBufferRef(IR, "IR"), Err, Context);
159 ErrorAndExit("Could not parse IR");
211 // Mimics the lli tool to JIT the LLVM IR code and execute it
212 void clang_fuzzer::HandleLLVM(const std::string &IR,
222 // First we optimize the IR by running a loop vectorizer pass
223 std::string OptIR = OptLLVM(IR, OLvl);
226 CreateAndRunJITFunc(IR, CodeGenOpt::None);