Lines Matching +full:disable +full:- +full:timing +full:- +full:generator

1 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This is the llc code generator driver. It provides a convenient
10 // command-line interface for generating an assembly file or a relocatable file,
13 //===----------------------------------------------------------------------===//
65 // General options for llc. Other pass-specific options are specified
66 // within the corresponding llc passes, and target-specific options
67 // and back-end code generation options are specified with the target machine.
70 InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
79 SplitDwarfOutputFile("split-dwarf-output",
84 TimeCompilations("time-compilations", cl::Hidden, cl::init(1u),
86 cl::desc("Repeat compilation N times for timing"));
88 static cl::opt<bool> TimeTrace("time-trace", cl::desc("Record time trace"));
91 "time-trace-granularity",
97 TimeTraceFile("time-trace-file",
102 BinutilsVersion("binutils-version", cl::Hidden,
105 "If -no-integrated-as is specified, the generated "
111 PreserveComments("preserve-as-comments", cl::Hidden,
118 cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
119 "(default = '-O2')"),
126 "split-dwarf-file",
130 static cl::opt<bool> NoVerify("disable-verify", cl::Hidden,
133 static cl::opt<bool> DisableSimplifyLibCalls("disable-simplify-libcalls",
134 cl::desc("Disable simplify-libcalls"));
136 static cl::opt<bool> ShowMCEncoding("show-mc-encoding", cl::Hidden,
140 DwarfDirectory("dwarf-directory", cl::Hidden,
144 static cl::opt<bool> AsmVerbose("asm-verbose",
149 CompileTwice("compile-twice", cl::Hidden,
150 cl::desc("Run everything twice, re-using the same pass "
155 "discard-value-names",
162 "pass-remarks-with-hotness",
168 "pass-remarks-hotness-threshold",
175 RemarksFilename("pass-remarks-output",
180 RemarksPasses("pass-remarks-filter",
186 "pass-remarks-format",
191 "enable-new-pm", cl::desc("Enable the new pass manager"), cl::init(false));
201 "available before a certain pass, add 'require<foo-analysis>'."));
203 cl::desc("Alias for -passes"));
206 "try-experimental-debuginfo-iterators",
224 StringRef(Val).split(PassNames, ',', -1, false); in operator =()
234 "run-pass",
236 cl::value_desc("pass-name"), cl::location(RunPassOpt));
243 if (Filename == "-") in reportError()
263 if (InputFilename == "-") in GetOutputStream()
264 OutputFilename = "-"; in GetOutputStream()
286 OutputFilename = "-"; in GetOutputStream()
317 // main - Entry point for the llc compiler.
325 // Initialize targets first, so that --version shows registered targets. in main()
331 // Initialize codegen and IR passes used by llc so that the -print-after, in main()
332 // -print-before, and -stop-after options work. in main()
354 // Register the Target and CPU printer for --version. in main()
356 // Register the target printer for --version. in main()
362 errs() << "The `llc -run-pass=...` syntax for the new pass manager is " in main()
363 "not supported, please use `llc -passes=<pipeline>` (or the `-p` " in main()
368 // RemoveDIs debug-info transition: tests may request that we /try/ to use the in main()
369 // new debug-info format. in main()
371 // Turn the new debug-info format on. in main()
408 for (unsigned I = TimeCompilations; I; --I) in main()
413 RemarksFile->keep(); in main()
423 const PassInfo *PI = PR->getPassInfo(PassName); in addPass()
426 << "run-pass " << PassName << " is not registered.\n"; in addPass()
431 if (PI->getNormalCtor()) in addPass()
432 P = PI->getNormalCtor()(); in addPass()
435 << "cannot create pass: " << PI->getPassName() << "\n"; in addPass()
438 std::string Banner = std::string("After ") + std::string(P->getPassName()); in addPass()
472 // Parse 'none' or '$major.$minor'. Disallow -binutils-version=0 because we in compileModule()
481 << "invalid -binutils-version, accepting 'none' or major.minor\n"; in compileModule()
491 reportError("-mxcoff-roptr option is only supported on AIX", in compileModule()
495 // without using data sections, it is less effective to use read-only in compileModule()
496 // pointers. Using read-only pointers may cause other RO variables in the in compileModule()
497 // same csect to become RW when the linker acts upon `-bforceimprw`; in compileModule()
499 // presence of ReadOnlyPointers. We respect the setting of data-sections in compileModule()
503 reportError("-mxcoff-roptr option must be used with -data-sections", in compileModule()
519 // -dwarf-directory is not set explicitly. Some assemblers in compileModule()
537 StringRef OldDLStr) -> std::optional<std::string> { in compileModule()
555 Target = std::unique_ptr<TargetMachine>(TheTarget->createTargetMachine( in compileModule()
559 return Target->createDataLayout().getStringRepresentation(); in compileModule()
566 M = MIR->parseIRModule(SetDataLayout); in compileModule()
576 M->setTargetTriple(Triple::normalize(TargetTriple)); in compileModule()
578 std::optional<CodeModel::Model> CM_IR = M->getCodeModel(); in compileModule()
580 Target->setCodeModel(*CM_IR); in compileModule()
582 Target->setLargeDataThreshold(*LDT); in compileModule()
598 Target = std::unique_ptr<TargetMachine>(TheTarget->createTargetMachine( in compileModule()
610 Target->Options.FloatABIType = codegen::getFloatABIForCalls(); in compileModule()
614 GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0]); in compileModule()
618 Target->Options.ObjectFilenameForDebug = Out->outputFilename(); in compileModule()
630 TargetLibraryInfoImpl TLII(Triple(M->getTargetTriple())); in compileModule()
632 // The -disable-simplify-libcalls flag actually disables all builtin optzns. in compileModule()
648 << ": warning: ignoring -mc-relax-all because filetype != obj"; in compileModule()
662 raw_pwrite_stream *OS = &Out->os(); in compileModule()
669 !Out->os().supportsSeeking()) || in compileModule()
685 << "run-pass is for .mir file only.\n"; in compileModule()
693 << "run-pass cannot be used with " in compileModule()
711 } else if (Target->addPassesToEmitFile( in compileModule()
712 PM, *OS, DwoOut ? &DwoOut->os() : nullptr, in compileModule()
718 ->Initialize(MMIWP->getMMI().getContext(), *Target); in compileModule()
721 if (MIR->parseMachineFunctions(*M, MMIWP->getMMI())) in compileModule()
742 if (Context.getDiagHandlerPtr()->HasErrors) in compileModule()
753 "To generate the one-run comparison binary, just run without\n" in compileModule()
754 "the compile-twice option\n"; in compileModule()
755 Out->os() << Buffer; in compileModule()
756 Out->keep(); in compileModule()
762 Out->os() << Buffer; in compileModule()
767 Out->keep(); in compileModule()
769 DwoOut->keep(); in compileModule()