Lines Matching refs:BD

48     BugDriver &BD;  member in __anonbf95298b0111::ReduceMiscompilingPasses
50 ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} in ReduceMiscompilingPasses()
71 if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, in doTest()
75 BD.setPassesToRun(Suffix); in doTest()
76 BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); in doTest()
77 exit(BD.debugOptimizerCrash()); in doTest()
81 bool Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", in doTest()
88 errs() << BD.getToolName() << ": I'm confused: the test fails when " in doTest()
109 if (BD.runPasses(BD.getProgram(), Prefix, BitcodeResult, false/*delete*/, in doTest()
113 BD.setPassesToRun(Prefix); in doTest()
114 BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); in doTest()
115 exit(BD.debugOptimizerCrash()); in doTest()
119 Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", false, &Error); in doTest()
133 parseInputFile(BitcodeResult, BD.getContext()); in doTest()
135 errs() << BD.getToolName() << ": Error reading bitcode file '" in doTest()
150 BD.swapProgramIn(PrefixOutput.release())); in doTest()
151 if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, in doTest()
155 BD.setPassesToRun(Suffix); in doTest()
156 BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); in doTest()
157 exit(BD.debugOptimizerCrash()); in doTest()
161 Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", in doTest()
173 delete BD.swapProgramIn(OriginalInput.release()); in doTest()
179 BugDriver &BD; member in __anonbf95298b0211::ReduceMiscompilingFunctions
188 : BD(bd), TestFn(F) {} in ReduceMiscompilingFunctions()
220 static std::unique_ptr<Module> testMergedProgram(const BugDriver &BD, in testMergedProgram() argument
229 Broken = BD.diffProgram(M1.get(), "", "", false, &Error); in testMergedProgram()
246 << (BD.getPassesToRun().size() == 1 ? "" : "es") << ":"; in TestFuncs()
258 Module *Clone = CloneModule(BD.getProgram(), VMap).release(); in TestFuncs()
259 Module *Orig = BD.swapProgramIn(Clone); in TestFuncs()
269 std::unique_ptr<Module> ToNotOptimize = CloneModule(BD.getProgram(), VMap); in TestFuncs()
274 TestFn(BD, std::move(ToOptimize), std::move(ToNotOptimize), Error); in TestFuncs()
276 delete BD.swapProgramIn(Orig); in TestFuncs()
297 static bool ExtractLoops(BugDriver &BD, in ExtractLoops() argument
307 std::unique_ptr<Module> ToNotOptimize = CloneModule(BD.getProgram(), VMap); in ExtractLoops()
312 BD.extractLoop(ToOptimize); in ExtractLoops()
327 AbstractInterpreter *AI = BD.switchToSafeInterpreter(); in ExtractLoops()
330 testMergedProgram(BD, std::move(ToOptimizeLoopExtracted), in ExtractLoops()
336 Module *Old = BD.swapProgramIn(New.release()); in ExtractLoops()
342 BD.switchToInterpreter(AI); in ExtractLoops()
349 BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-tno.bc", in ExtractLoops()
351 BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to.bc", in ExtractLoops()
353 BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to-le.bc", in ExtractLoops()
362 BD.switchToInterpreter(AI); in ExtractLoops()
373 Failure = TestFn(BD, std::move(ToOptimizeLoopExtracted), in ExtractLoops()
403 BD.setNewProgram(ToNotOptimize.release()); in ExtractLoops()
433 BD.setNewProgram(ToNotOptimize.release()); in ExtractLoops()
440 BugDriver &BD; member in __anonbf95298b0311::ReduceMiscompiledBlocks
449 : BD(bd), TestFn(F), FunctionsBeingTested(Fns) {} in ReduceMiscompiledBlocks()
495 Module *Clone = CloneModule(BD.getProgram(), VMap).release(); in TestFuncs()
496 Module *Orig = BD.swapProgramIn(Clone); in TestFuncs()
509 std::unique_ptr<Module> ToNotOptimize = CloneModule(BD.getProgram(), VMap); in TestFuncs()
516 BD.extractMappedBlocksFromModule(BBsOnClone, ToOptimize.get())) { in TestFuncs()
517 bool Ret = TestFn(BD, std::move(New), std::move(ToNotOptimize), Error); in TestFuncs()
518 delete BD.swapProgramIn(Orig); in TestFuncs()
521 delete BD.swapProgramIn(Orig); in TestFuncs()
528 static bool ExtractBlocks(BugDriver &BD, in ExtractBlocks() argument
547 bool Ret = ReduceMiscompiledBlocks(BD, TestFn, MiscompiledFunctions) in ExtractBlocks()
554 ReduceMiscompiledBlocks(BD, TestFn, in ExtractBlocks()
563 Module *ProgClone = CloneModule(BD.getProgram(), VMap).release(); in ExtractBlocks()
568 BD.extractMappedBlocksFromModule(Blocks, ToExtract); in ExtractBlocks()
591 BD.setNewProgram(ProgClone); in ExtractBlocks()
609 DebugAMiscompilation(BugDriver &BD, in DebugAMiscompilation() argument
618 Module *Prog = BD.getProgram(); in DebugAMiscompilation()
625 ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, in DebugAMiscompilation()
641 bool Ret = ExtractLoops(BD, TestFn, MiscompiledFunctions, Error); in DebugAMiscompilation()
647 DisambiguateGlobalSymbols(BD.getProgram()); in DebugAMiscompilation()
651 ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, in DebugAMiscompilation()
665 bool Ret = ExtractBlocks(BD, TestFn, MiscompiledFunctions, Error); in DebugAMiscompilation()
671 DisambiguateGlobalSymbols(BD.getProgram()); in DebugAMiscompilation()
674 ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, in DebugAMiscompilation()
694 static bool TestOptimizer(BugDriver &BD, std::unique_ptr<Module> Test, in TestOptimizer() argument
700 BD.runPassesOn(Test.get(), BD.getPassesToRun()); in TestOptimizer()
704 delete BD.swapProgramIn(Test.get()); in TestOptimizer()
705 BD.EmitProgressBitcode(Test.get(), "pass-error", false); in TestOptimizer()
706 return BD.debugOptimizerCrash(); in TestOptimizer()
713 BD, std::move(Optimized), std::move(Safe), Error, Broken); in TestOptimizer()
717 delete BD.swapProgramIn(New.release()); in TestOptimizer()
765 static void CleanupAndPrepareModules(BugDriver &BD, in CleanupAndPrepareModules() argument
769 Test = BD.performFinalCleanups(Test.get()); in CleanupAndPrepareModules()
772 if (!BD.isExecutingJIT()) return; in CleanupAndPrepareModules()
929 static bool TestCodeGenerator(BugDriver &BD, std::unique_ptr<Module> Test, in TestCodeGenerator() argument
932 CleanupAndPrepareModules(BD, Test, Safe.get()); in TestCodeGenerator()
939 errs() << BD.getToolName() << "Error making unique filename: " in TestCodeGenerator()
943 if (BD.writeProgramToFile(TestModuleBC.str(), TestModuleFD, Test.get())) { in TestCodeGenerator()
957 errs() << BD.getToolName() << "Error making unique filename: " in TestCodeGenerator()
962 if (BD.writeProgramToFile(SafeModuleBC.str(), SafeModuleFD, Safe.get())) { in TestCodeGenerator()
970 std::string SharedObject = BD.compileSharedObject(SafeModuleBC.str(), Error); in TestCodeGenerator()
978 bool Result = BD.diffProgram(BD.getProgram(), TestModuleBC.str(), in TestCodeGenerator()