1 //===-- llvm-stress.cpp - Generate random LL files to stress-test LLVM ----===//
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 program is a utility that generates random .ll files to stress-test
11 // different components in LLVM.
13 //===----------------------------------------------------------------------===//
14 #include "llvm/LLVMContext.h"
15 #include "llvm/Module.h"
16 #include "llvm/PassManager.h"
17 #include "llvm/Constants.h"
18 #include "llvm/Instruction.h"
19 #include "llvm/CallGraphSCCPass.h"
20 #include "llvm/Assembly/PrintModulePass.h"
21 #include "llvm/Analysis/Verifier.h"
22 #include "llvm/Support/PassNameParser.h"
23 #include "llvm/Support/Debug.h"
24 #include "llvm/Support/ManagedStatic.h"
25 #include "llvm/Support/PluginLoader.h"
26 #include "llvm/Support/PrettyStackTrace.h"
27 #include "llvm/Support/ToolOutputFile.h"
35 static cl::opt<unsigned> SeedCL("seed",
36 cl::desc("Seed used for randomness"), cl::init(0));
37 static cl::opt<unsigned> SizeCL("size",
38 cl::desc("The estimated size of the generated function (# of instrs)"),
40 static cl::opt<std::string>
41 OutputFilename("o", cl::desc("Override output filename"),
42 cl::value_desc("filename"));
44 static cl::opt<bool> GenHalfFloat("generate-half-float",
45 cl::desc("Generate half-length floating-point values"), cl::init(false));
46 static cl::opt<bool> GenX86FP80("generate-x86-fp80",
47 cl::desc("Generate 80-bit X86 floating-point values"), cl::init(false));
48 static cl::opt<bool> GenFP128("generate-fp128",
49 cl::desc("Generate 128-bit floating-point values"), cl::init(false));
50 static cl::opt<bool> GenPPCFP128("generate-ppc-fp128",
51 cl::desc("Generate 128-bit PPC floating-point values"), cl::init(false));
52 static cl::opt<bool> GenX86MMX("generate-x86-mmx",
53 cl::desc("Generate X86 MMX floating-point values"), cl::init(false));
55 /// A utility class to provide a pseudo-random number generator which is
56 /// the same across all platforms. This is somewhat close to the libc
57 /// implementation. Note: This is not a cryptographically secure pseudorandom
62 Random(unsigned _seed):Seed(_seed) {}
64 /// Return a random integer, up to a
65 /// maximum of 2**19 - 1.
67 uint32_t Val = Seed + 0x000b07a1;
68 Seed = (Val * 0x3c7c0ac1);
69 // Only lowest 19 bits are random-ish.
70 return Seed & 0x7ffff;
73 /// Return a random 32 bit integer.
75 uint32_t Val = Rand();
77 return Val | (Rand() << 16);
80 /// Return a random 64 bit integer.
82 uint64_t Val = Rand32();
83 return Val | (uint64_t(Rand32()) << 32);
89 /// Generate an empty function with a default argument list.
90 Function *GenEmptyFunction(Module *M) {
92 std::vector<Type*> ArgsTy;
93 // Define a few arguments
94 LLVMContext &Context = M->getContext();
95 ArgsTy.push_back(PointerType::get(IntegerType::getInt8Ty(Context), 0));
96 ArgsTy.push_back(PointerType::get(IntegerType::getInt32Ty(Context), 0));
97 ArgsTy.push_back(PointerType::get(IntegerType::getInt64Ty(Context), 0));
98 ArgsTy.push_back(IntegerType::getInt32Ty(Context));
99 ArgsTy.push_back(IntegerType::getInt64Ty(Context));
100 ArgsTy.push_back(IntegerType::getInt8Ty(Context));
102 FunctionType *FuncTy = FunctionType::get(Type::getVoidTy(Context), ArgsTy, 0);
103 // Pick a unique name to describe the input parameters
104 std::stringstream ss;
105 ss<<"autogen_SD"<<SeedCL;
106 Function *Func = Function::Create(FuncTy, GlobalValue::ExternalLinkage,
109 Func->setCallingConv(CallingConv::C);
113 /// A base class, implementing utilities needed for
114 /// modifying and adding new random instructions.
116 /// Used to store the randomly generated values.
117 typedef std::vector<Value*> PieceTable;
121 Modifier(BasicBlock *Block, PieceTable *PT, Random *R):
122 BB(Block),PT(PT),Ran(R),Context(BB->getContext()) {}
123 /// Add a new instruction.
124 virtual void Act() = 0;
125 /// Add N new instructions,
126 virtual void ActN(unsigned n) {
127 for (unsigned i=0; i<n; ++i)
132 /// Return a random value from the list of known values.
133 Value *getRandomVal() {
135 return PT->at(Ran->Rand() % PT->size());
138 Constant *getRandomConstant(Type *Tp) {
139 if (Tp->isIntegerTy()) {
141 return ConstantInt::getAllOnesValue(Tp);
142 return ConstantInt::getNullValue(Tp);
143 } else if (Tp->isFloatingPointTy()) {
145 return ConstantFP::getAllOnesValue(Tp);
146 return ConstantFP::getNullValue(Tp);
148 return UndefValue::get(Tp);
151 /// Return a random value with a known type.
152 Value *getRandomValue(Type *Tp) {
153 unsigned index = Ran->Rand();
154 for (unsigned i=0; i<PT->size(); ++i) {
155 Value *V = PT->at((index + i) % PT->size());
156 if (V->getType() == Tp)
160 // If the requested type was not found, generate a constant value.
161 if (Tp->isIntegerTy()) {
163 return ConstantInt::getAllOnesValue(Tp);
164 return ConstantInt::getNullValue(Tp);
165 } else if (Tp->isFloatingPointTy()) {
167 return ConstantFP::getAllOnesValue(Tp);
168 return ConstantFP::getNullValue(Tp);
169 } else if (Tp->isVectorTy()) {
170 VectorType *VTp = cast<VectorType>(Tp);
172 std::vector<Constant*> TempValues;
173 TempValues.reserve(VTp->getNumElements());
174 for (unsigned i = 0; i < VTp->getNumElements(); ++i)
175 TempValues.push_back(getRandomConstant(VTp->getScalarType()));
177 ArrayRef<Constant*> VectorValue(TempValues);
178 return ConstantVector::get(VectorValue);
181 return UndefValue::get(Tp);
184 /// Return a random value of any pointer type.
185 Value *getRandomPointerValue() {
186 unsigned index = Ran->Rand();
187 for (unsigned i=0; i<PT->size(); ++i) {
188 Value *V = PT->at((index + i) % PT->size());
189 if (V->getType()->isPointerTy())
192 return UndefValue::get(pickPointerType());
195 /// Return a random value of any vector type.
196 Value *getRandomVectorValue() {
197 unsigned index = Ran->Rand();
198 for (unsigned i=0; i<PT->size(); ++i) {
199 Value *V = PT->at((index + i) % PT->size());
200 if (V->getType()->isVectorTy())
203 return UndefValue::get(pickVectorType());
206 /// Pick a random type.
208 return (Ran->Rand() & 1 ? pickVectorType() : pickScalarType());
211 /// Pick a random pointer type.
212 Type *pickPointerType() {
213 Type *Ty = pickType();
214 return PointerType::get(Ty, 0);
217 /// Pick a random vector type.
218 Type *pickVectorType(unsigned len = (unsigned)-1) {
219 // Pick a random vector width in the range 2**0 to 2**4.
220 // by adding two randoms we are generating a normal-like distribution
222 unsigned width = 1<<((Ran->Rand() % 3) + (Ran->Rand() % 3));
225 // Vectors of x86mmx are illegal; keep trying till we get something else.
227 Ty = pickScalarType();
228 } while (Ty->isX86_MMXTy());
230 if (len != (unsigned)-1)
232 return VectorType::get(Ty, width);
235 /// Pick a random scalar type.
236 Type *pickScalarType() {
239 switch (Ran->Rand() % 30) {
240 case 0: t = Type::getInt1Ty(Context); break;
241 case 1: t = Type::getInt8Ty(Context); break;
242 case 2: t = Type::getInt16Ty(Context); break;
244 case 5: t = Type::getFloatTy(Context); break;
246 case 8: t = Type::getDoubleTy(Context); break;
248 case 11: t = Type::getInt32Ty(Context); break;
250 case 14: t = Type::getInt64Ty(Context); break;
252 case 17: if (GenHalfFloat) t = Type::getHalfTy(Context); break;
254 case 20: if (GenX86FP80) t = Type::getX86_FP80Ty(Context); break;
256 case 23: if (GenFP128) t = Type::getFP128Ty(Context); break;
258 case 26: if (GenPPCFP128) t = Type::getPPC_FP128Ty(Context); break;
260 case 29: if (GenX86MMX) t = Type::getX86_MMXTy(Context); break;
261 default: llvm_unreachable("Invalid scalar value");
268 /// Basic block to populate
272 /// Random number generator
275 LLVMContext &Context;
278 struct LoadModifier: public Modifier {
279 LoadModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
281 // Try to use predefined pointers. If non exist, use undef pointer value;
282 Value *Ptr = getRandomPointerValue();
283 Value *V = new LoadInst(Ptr, "L", BB->getTerminator());
288 struct StoreModifier: public Modifier {
289 StoreModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
291 // Try to use predefined pointers. If non exist, use undef pointer value;
292 Value *Ptr = getRandomPointerValue();
293 Type *Tp = Ptr->getType();
294 Value *Val = getRandomValue(Tp->getContainedType(0));
295 Type *ValTy = Val->getType();
297 // Do not store vectors of i1s because they are unsupported
299 if (ValTy->isVectorTy() && ValTy->getScalarSizeInBits() == 1)
302 new StoreInst(Val, Ptr, BB->getTerminator());
306 struct BinModifier: public Modifier {
307 BinModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
310 Value *Val0 = getRandomVal();
311 Value *Val1 = getRandomValue(Val0->getType());
313 // Don't handle pointer types.
314 if (Val0->getType()->isPointerTy() ||
315 Val1->getType()->isPointerTy())
318 // Don't handle i1 types.
319 if (Val0->getType()->getScalarSizeInBits() == 1)
323 bool isFloat = Val0->getType()->getScalarType()->isFloatingPointTy();
324 Instruction* Term = BB->getTerminator();
325 unsigned R = Ran->Rand() % (isFloat ? 7 : 13);
326 Instruction::BinaryOps Op;
329 default: llvm_unreachable("Invalid BinOp");
330 case 0:{Op = (isFloat?Instruction::FAdd : Instruction::Add); break; }
331 case 1:{Op = (isFloat?Instruction::FSub : Instruction::Sub); break; }
332 case 2:{Op = (isFloat?Instruction::FMul : Instruction::Mul); break; }
333 case 3:{Op = (isFloat?Instruction::FDiv : Instruction::SDiv); break; }
334 case 4:{Op = (isFloat?Instruction::FDiv : Instruction::UDiv); break; }
335 case 5:{Op = (isFloat?Instruction::FRem : Instruction::SRem); break; }
336 case 6:{Op = (isFloat?Instruction::FRem : Instruction::URem); break; }
337 case 7: {Op = Instruction::Shl; break; }
338 case 8: {Op = Instruction::LShr; break; }
339 case 9: {Op = Instruction::AShr; break; }
340 case 10:{Op = Instruction::And; break; }
341 case 11:{Op = Instruction::Or; break; }
342 case 12:{Op = Instruction::Xor; break; }
345 PT->push_back(BinaryOperator::Create(Op, Val0, Val1, "B", Term));
349 /// Generate constant values.
350 struct ConstModifier: public Modifier {
351 ConstModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
353 Type *Ty = pickType();
355 if (Ty->isVectorTy()) {
356 switch (Ran->Rand() % 2) {
357 case 0: if (Ty->getScalarType()->isIntegerTy())
358 return PT->push_back(ConstantVector::getAllOnesValue(Ty));
359 case 1: if (Ty->getScalarType()->isIntegerTy())
360 return PT->push_back(ConstantVector::getNullValue(Ty));
364 if (Ty->isFloatingPointTy()) {
365 // Generate 128 random bits, the size of the (currently)
366 // largest floating-point types.
367 uint64_t RandomBits[2];
368 for (unsigned i = 0; i < 2; ++i)
369 RandomBits[i] = Ran->Rand64();
371 APInt RandomInt(Ty->getPrimitiveSizeInBits(), makeArrayRef(RandomBits));
373 bool isIEEE = !Ty->isX86_FP80Ty() && !Ty->isPPC_FP128Ty();
374 APFloat RandomFloat(RandomInt, isIEEE);
377 return PT->push_back(ConstantFP::getNullValue(Ty));
378 return PT->push_back(ConstantFP::get(Ty->getContext(), RandomFloat));
381 if (Ty->isIntegerTy()) {
382 switch (Ran->Rand() % 7) {
383 case 0: if (Ty->isIntegerTy())
384 return PT->push_back(ConstantInt::get(Ty,
385 APInt::getAllOnesValue(Ty->getPrimitiveSizeInBits())));
386 case 1: if (Ty->isIntegerTy())
387 return PT->push_back(ConstantInt::get(Ty,
388 APInt::getNullValue(Ty->getPrimitiveSizeInBits())));
389 case 2: case 3: case 4: case 5:
390 case 6: if (Ty->isIntegerTy())
391 PT->push_back(ConstantInt::get(Ty, Ran->Rand()));
398 struct AllocaModifier: public Modifier {
399 AllocaModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R){}
402 Type *Tp = pickType();
403 PT->push_back(new AllocaInst(Tp, "A", BB->getFirstNonPHI()));
407 struct ExtractElementModifier: public Modifier {
408 ExtractElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
409 Modifier(BB, PT, R) {}
412 Value *Val0 = getRandomVectorValue();
413 Value *V = ExtractElementInst::Create(Val0,
414 ConstantInt::get(Type::getInt32Ty(BB->getContext()),
415 Ran->Rand() % cast<VectorType>(Val0->getType())->getNumElements()),
416 "E", BB->getTerminator());
417 return PT->push_back(V);
421 struct ShuffModifier: public Modifier {
422 ShuffModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
425 Value *Val0 = getRandomVectorValue();
426 Value *Val1 = getRandomValue(Val0->getType());
428 unsigned Width = cast<VectorType>(Val0->getType())->getNumElements();
429 std::vector<Constant*> Idxs;
431 Type *I32 = Type::getInt32Ty(BB->getContext());
432 for (unsigned i=0; i<Width; ++i) {
433 Constant *CI = ConstantInt::get(I32, Ran->Rand() % (Width*2));
434 // Pick some undef values.
435 if (!(Ran->Rand() % 5))
436 CI = UndefValue::get(I32);
440 Constant *Mask = ConstantVector::get(Idxs);
442 Value *V = new ShuffleVectorInst(Val0, Val1, Mask, "Shuff",
443 BB->getTerminator());
448 struct InsertElementModifier: public Modifier {
449 InsertElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
450 Modifier(BB, PT, R) {}
453 Value *Val0 = getRandomVectorValue();
454 Value *Val1 = getRandomValue(Val0->getType()->getScalarType());
456 Value *V = InsertElementInst::Create(Val0, Val1,
457 ConstantInt::get(Type::getInt32Ty(BB->getContext()),
458 Ran->Rand() % cast<VectorType>(Val0->getType())->getNumElements()),
459 "I", BB->getTerminator());
460 return PT->push_back(V);
465 struct CastModifier: public Modifier {
466 CastModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
469 Value *V = getRandomVal();
470 Type *VTy = V->getType();
471 Type *DestTy = pickScalarType();
473 // Handle vector casts vectors.
474 if (VTy->isVectorTy()) {
475 VectorType *VecTy = cast<VectorType>(VTy);
476 DestTy = pickVectorType(VecTy->getNumElements());
480 if (VTy == DestTy) return;
483 if (VTy->isPointerTy()) {
484 if (!DestTy->isPointerTy())
485 DestTy = PointerType::get(DestTy, 0);
486 return PT->push_back(
487 new BitCastInst(V, DestTy, "PC", BB->getTerminator()));
490 // Generate lots of bitcasts.
491 if ((Ran->Rand() & 1) &&
492 VTy->getPrimitiveSizeInBits() == DestTy->getPrimitiveSizeInBits()) {
493 return PT->push_back(
494 new BitCastInst(V, DestTy, "BC", BB->getTerminator()));
497 // Both types are integers:
498 if (VTy->getScalarType()->isIntegerTy() &&
499 DestTy->getScalarType()->isIntegerTy()) {
500 if (VTy->getScalarType()->getPrimitiveSizeInBits() >
501 DestTy->getScalarType()->getPrimitiveSizeInBits()) {
502 return PT->push_back(
503 new TruncInst(V, DestTy, "Tr", BB->getTerminator()));
506 return PT->push_back(
507 new ZExtInst(V, DestTy, "ZE", BB->getTerminator()));
508 return PT->push_back(new SExtInst(V, DestTy, "Se", BB->getTerminator()));
513 if (VTy->getScalarType()->isFloatingPointTy() &&
514 DestTy->getScalarType()->isIntegerTy()) {
516 return PT->push_back(
517 new FPToSIInst(V, DestTy, "FC", BB->getTerminator()));
518 return PT->push_back(new FPToUIInst(V, DestTy, "FC", BB->getTerminator()));
522 if (VTy->getScalarType()->isIntegerTy() &&
523 DestTy->getScalarType()->isFloatingPointTy()) {
525 return PT->push_back(
526 new SIToFPInst(V, DestTy, "FC", BB->getTerminator()));
527 return PT->push_back(new UIToFPInst(V, DestTy, "FC", BB->getTerminator()));
532 if (VTy->getScalarType()->isFloatingPointTy() &&
533 DestTy->getScalarType()->isFloatingPointTy()) {
534 if (VTy->getScalarType()->getPrimitiveSizeInBits() >
535 DestTy->getScalarType()->getPrimitiveSizeInBits()) {
536 return PT->push_back(
537 new FPTruncInst(V, DestTy, "Tr", BB->getTerminator()));
539 return PT->push_back(
540 new FPExtInst(V, DestTy, "ZE", BB->getTerminator()));
547 struct SelectModifier: public Modifier {
548 SelectModifier(BasicBlock *BB, PieceTable *PT, Random *R):
549 Modifier(BB, PT, R) {}
552 // Try a bunch of different select configuration until a valid one is found.
553 Value *Val0 = getRandomVal();
554 Value *Val1 = getRandomValue(Val0->getType());
556 Type *CondTy = Type::getInt1Ty(Context);
558 // If the value type is a vector, and we allow vector select, then in 50%
559 // of the cases generate a vector select.
560 if (Val0->getType()->isVectorTy() && (Ran->Rand() % 1)) {
561 unsigned NumElem = cast<VectorType>(Val0->getType())->getNumElements();
562 CondTy = VectorType::get(CondTy, NumElem);
565 Value *Cond = getRandomValue(CondTy);
566 Value *V = SelectInst::Create(Cond, Val0, Val1, "Sl", BB->getTerminator());
567 return PT->push_back(V);
572 struct CmpModifier: public Modifier {
573 CmpModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
576 Value *Val0 = getRandomVal();
577 Value *Val1 = getRandomValue(Val0->getType());
579 if (Val0->getType()->isPointerTy()) return;
580 bool fp = Val0->getType()->getScalarType()->isFloatingPointTy();
585 (CmpInst::LAST_FCMP_PREDICATE - CmpInst::FIRST_FCMP_PREDICATE) +
586 CmpInst::FIRST_FCMP_PREDICATE;
589 (CmpInst::LAST_ICMP_PREDICATE - CmpInst::FIRST_ICMP_PREDICATE) +
590 CmpInst::FIRST_ICMP_PREDICATE;
593 Value *V = CmpInst::Create(fp ? Instruction::FCmp : Instruction::ICmp,
594 op, Val0, Val1, "Cmp", BB->getTerminator());
595 return PT->push_back(V);
599 void FillFunction(Function *F) {
600 // Create a legal entry block.
601 BasicBlock *BB = BasicBlock::Create(F->getContext(), "BB", F);
602 ReturnInst::Create(F->getContext(), BB);
604 // Create the value table.
605 Modifier::PieceTable PT;
606 // Pick an initial seed value
609 // Consider arguments as legal values.
610 for (Function::arg_iterator it = F->arg_begin(), e = F->arg_end();
614 // List of modifiers which add new random instructions.
615 std::vector<Modifier*> Modifiers;
616 std::auto_ptr<Modifier> LM(new LoadModifier(BB, &PT, &R));
617 std::auto_ptr<Modifier> SM(new StoreModifier(BB, &PT, &R));
618 std::auto_ptr<Modifier> EE(new ExtractElementModifier(BB, &PT, &R));
619 std::auto_ptr<Modifier> SHM(new ShuffModifier(BB, &PT, &R));
620 std::auto_ptr<Modifier> IE(new InsertElementModifier(BB, &PT, &R));
621 std::auto_ptr<Modifier> BM(new BinModifier(BB, &PT, &R));
622 std::auto_ptr<Modifier> CM(new CastModifier(BB, &PT, &R));
623 std::auto_ptr<Modifier> SLM(new SelectModifier(BB, &PT, &R));
624 std::auto_ptr<Modifier> PM(new CmpModifier(BB, &PT, &R));
625 Modifiers.push_back(LM.get());
626 Modifiers.push_back(SM.get());
627 Modifiers.push_back(EE.get());
628 Modifiers.push_back(SHM.get());
629 Modifiers.push_back(IE.get());
630 Modifiers.push_back(BM.get());
631 Modifiers.push_back(CM.get());
632 Modifiers.push_back(SLM.get());
633 Modifiers.push_back(PM.get());
635 // Generate the random instructions
636 AllocaModifier AM(BB, &PT, &R); AM.ActN(5); // Throw in a few allocas
637 ConstModifier COM(BB, &PT, &R); COM.ActN(40); // Throw in a few constants
639 for (unsigned i=0; i< SizeCL / Modifiers.size(); ++i)
640 for (std::vector<Modifier*>::iterator it = Modifiers.begin(),
641 e = Modifiers.end(); it != e; ++it) {
645 SM->ActN(5); // Throw in a few stores.
648 void IntroduceControlFlow(Function *F) {
649 std::set<Instruction*> BoolInst;
650 for (BasicBlock::iterator it = F->begin()->begin(),
651 e = F->begin()->end(); it != e; ++it) {
652 if (it->getType() == IntegerType::getInt1Ty(F->getContext()))
656 for (std::set<Instruction*>::iterator it = BoolInst.begin(),
657 e = BoolInst.end(); it != e; ++it) {
658 Instruction *Instr = *it;
659 BasicBlock *Curr = Instr->getParent();
660 BasicBlock::iterator Loc= Instr;
661 BasicBlock *Next = Curr->splitBasicBlock(Loc, "CF");
662 Instr->moveBefore(Curr->getTerminator());
663 if (Curr != &F->getEntryBlock()) {
664 BranchInst::Create(Curr, Next, Instr, Curr->getTerminator());
665 Curr->getTerminator()->eraseFromParent();
670 int main(int argc, char **argv) {
671 // Init LLVM, call llvm_shutdown() on exit, parse args, etc.
672 llvm::PrettyStackTraceProgram X(argc, argv);
673 cl::ParseCommandLineOptions(argc, argv, "llvm codegen stress-tester\n");
676 std::auto_ptr<Module> M(new Module("/tmp/autogen.bc", getGlobalContext()));
677 Function *F = GenEmptyFunction(M.get());
679 IntroduceControlFlow(F);
681 // Figure out what stream we are supposed to write to...
682 OwningPtr<tool_output_file> Out;
683 // Default to standard output.
684 if (OutputFilename.empty())
685 OutputFilename = "-";
687 std::string ErrorInfo;
688 Out.reset(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
689 raw_fd_ostream::F_Binary));
690 if (!ErrorInfo.empty()) {
691 errs() << ErrorInfo << '\n';
696 Passes.add(createVerifierPass());
697 Passes.add(createPrintModulePass(&Out->os()));
698 Passes.run(*M.get());