summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llc
Commit message (Collapse)AuthorAgeFilesLines
...
* RegisterScavenging: Add ScavengerTest passMatthias Braun2017-06-021-0/+3
| | | | | | | | | This pass allows to run the register scavenging independently of PrologEpilogInserter to allow targeted testing. Also adds some basic register scavenging tests. llvm-svn: 304606
* [LegacyPassManager] Remove TargetMachine constructorsFrancis Visoiu Mistrih2017-05-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a new way to access the TargetMachine through TargetPassConfig, as a dependency. The patterns replaced here are: * Passes handling a null TargetMachine call `getAnalysisIfAvailable<TargetPassConfig>`. * Passes not handling a null TargetMachine `addRequired<TargetPassConfig>` and call `getAnalysis<TargetPassConfig>`. * MachineFunctionPasses now use MF.getTarget(). * Remove all the TargetMachine constructors. * Remove INITIALIZE_TM_PASS. This fixes a crash when running `llc -start-before prologepilog`. PEI needs StackProtector, which gets constructed without a TargetMachine by the pass manager. The StackProtector pass doesn't handle the case where there is no TargetMachine, so it segfaults. Related to PR30324. Differential Revision: https://reviews.llvm.org/D33222 llvm-svn: 303360
* [X86] Relocate code of replacement of subtarget unsupported masked memory ↵Ayman Musa2017-05-151-0/+1
| | | | | | | | | | | | | | intrinsics to run also on -O0 option. Currently, when masked load, store, gather or scatter intrinsics are used, we check in CodeGenPrepare pass if the subtarget support these intrinsics, if not we replace them with scalar code - this is a functional transformation not an optimization (not optional). CodeGenPrepare pass does not run when the optimization level is set to CodeGenOpt::None (-O0). Functional transformation should run with all optimization levels, so here I created a new pass which runs on all optimization levels and does no more than this transformation. Differential Revision: https://reviews.llvm.org/D32487 llvm-svn: 303050
* Add a late IR expansion pass for the experimental reduction intrinsics.Amara Emerson2017-05-101-0/+1
| | | | | | | | | This pass uses a new target hook to decide whether or not to expand a particular intrinsic to the shuffevector sequence. Differential Revision: https://reviews.llvm.org/D32245 llvm-svn: 302631
* Move Split DWARF handling to an MC option/command line argument rather than ↵David Blaikie2017-04-211-0/+6
| | | | | | | | | | | | | | | | | | | using metadata Since Split DWARF needs to name the actual .dwo file that is generated, it can't be known at the time the llvm::Module is produced as it may be merged with other Modules before the object is generated and that object may be generated with any name. By passing the Split DWARF file name when LLVM is producing object code the .dwo file name in the object file can match correctly. The support for Split DWARF for implicit modules remains the same - using metadata to store the dwo name and dwo id so that potentially multiple skeleton CUs referring to different dwo files can be generated from one llvm::Module. llvm-svn: 301062
* Revert "Feature generic option to setup start/stop-after/before"Quentin Colombet2017-04-011-10/+44
| | | | | | | | This reverts commit r299282. Didn't intend to commit this :( llvm-svn: 299288
* Feature generic option to setup start/stop-after/beforeQuentin Colombet2017-04-011-44/+10
| | | | | | | | | | | | | This patch refactors the code used in llc such that all the users of the addPassesToEmitFile API have access to a homogeneous way of handling start/stop-after/before options right out of the box. Previously each user would have needed to duplicate this logic and set up its own options. NFC llvm-svn: 299282
* [Assembler] Add test for !srcloc references in assembler diagsSanne Wouda2017-02-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: clang adds !srcloc metadata to inline assembly in LLVM bitcode generated for inline assembly in C. The value of this !srcloc is passed to the diagnostics handler if the inline assembly generates a diagnostic. clang is able to turn this cookie back to a location in the C source file. To test this functionality without a dependency, make llc print the !srcloc metadata if it is present. The added test uses this mechanism to test that the correct !srclocs are passed to the diag handler. Reviewers: rengolin, rnk, echristo, grosbach, mehdi_amini Reviewed By: mehdi_amini Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30167 llvm-svn: 296465
* [LLC] Add an inline assembly diagnostics handler.Sanne Wouda2017-02-031-0/+11
| | | | | | | | | | | | | | | | Summary: llc would hit a fatal error for errors in inline assembly. The diagnostics message is now printed. Reviewers: rengolin, MatzeB, javed.absar, anemet Reviewed By: anemet Subscribers: jyknight, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D29408 llvm-svn: 293999
* [llc] Add -pass-remarks-outputAdam Nemet2017-01-261-0/+21
| | | | | | | This is the opt/llc counterpart of -fsave-optimization-record to output optimization remarks in a YAML file. llvm-svn: 293121
* [llc] Add -pass-remarks-with-hotnessAdam Nemet2017-01-251-0/+7
| | | | | | Analogous to the code in opt, this enables hotness in opt-remarks. llvm-svn: 293113
* New OptimizationRemarkEmitter pass for MIRAdam Nemet2017-01-251-0/+4
| | | | | | | | | | | | | | | | | This allows MIR passes to emit optimization remarks with the same level of functionality that is available to IR passes. It also hooks up the greedy register allocator to report spills. This allows for interesting use cases like increasing interleaving on a loop until spilling of registers is observed. I still need to experiment whether reporting every spill scales but this demonstrates for now that the functionality works from llc using -pass-remarks*=<pass>. Differential Revision: https://reviews.llvm.org/D29004 llvm-svn: 293110
* llc: Update link componentsMatt Arsenault2017-01-171-0/+1
| | | | llvm-svn: 292198
* llc: Update LLVMBuildMatt Arsenault2017-01-171-1/+1
| | | | llvm-svn: 292196
* llc: Initialize more passesMatt Arsenault2017-01-171-0/+2
| | | | | | | Targets can add these. Initialize them so -print-before/-print-after etc. work. llvm-svn: 292195
* MC: support passing search paths to the IASSaleem Abdulrasool2017-01-051-0/+3
| | | | | | | This is needed to support inclusion in inline assembly via the `.include` directive. llvm-svn: 291085
* [llc] Fix -stop-after=consthoist initializing the pass.Davide Italiano2016-12-061-0/+1
| | | | llvm-svn: 288864
* [CMake] llc depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | llc.cpp has the following include chain: llvm/Analysis/TargetLibraryInfo.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llc needs to depend on intrinsics_gen. llvm-svn: 287422
* Revert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)"Mehdi Amini2016-10-011-1/+1
| | | | | | This reverts commit r283017. Creates an infinite loop somehow. llvm-svn: 283019
* Use StringRef instead of raw pointer in TargetRegistry API (NFC)Mehdi Amini2016-10-011-1/+1
| | | | llvm-svn: 283017
* llc: Add -start-before/-stop-before optionsMatthias Braun2016-09-231-21/+38
| | | | | | Differential Revision: https://reviews.llvm.org/D23089 llvm-svn: 282302
* Add a counter-function insertion passHal Finkel2016-09-011-0/+1
| | | | | | | | | | | | | | | | | | As discussed in https://reviews.llvm.org/D22666, our current mechanism to support -pg profiling, where we insert calls to mcount(), or some similar function, is fundamentally broken. We insert these calls in the frontend, which means they get duplicated when inlining, and so the accumulated execution counts for the inlined-into functions are wrong. Because we don't want the presence of these functions to affect optimizaton, they should be inserted in the backend. Here's a pass which would do just that. The knowledge of the name of the counting function lives in the frontend, so we're passing it here as a function attribute. Clang will be updated to use this mechanism. Differential Revision: https://reviews.llvm.org/D22825 llvm-svn: 280347
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | Re-apply this patch, hopefully I will get away without any warnings in the constructor now. This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279602
* MachineModuleInfo: Avoid dummy constructor, use INITIALIZE_TM_PASSMatthias Braun2016-08-241-1/+1
| | | | | | | | | | | Change this pass constructor to just accept a const TargetMachine * and use INITIALIZE_TM_PASS, that way we can get rid of the dummy constructor. The pass will still fail when calling the default constructor leading to TM == nullptr, this is no different than before but is more in line what other codegen passes are doing and avoids the dummy constructor. llvm-svn: 279598
* Revert r279564. It introduces undefined behavior (binding a reference to aRichard Smith2016-08-231-1/+2
| | | | | | | dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes -Werror builds (including several buildbots) to fail. llvm-svn: 279580
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | Re-apply this commit with the deletion of a MachineFunction delegated to a separate pass to avoid use after free when doing this directly in AsmPrinter. This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279564
* Revert "(HEAD -> master, origin/master, origin/HEAD) CodeGen: Remove ↵Matthias Braun2016-08-231-1/+2
| | | | | | | | | | MachineFunctionAnalysis => Enable (Machine)ModulePasses" Reverting while tracking down a use after free. This reverts commit r279502. llvm-svn: 279503
* CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePassesMatthias Braun2016-08-231-2/+1
| | | | | | | | | | | | | | | | | | | This patch removes the MachineFunctionAnalysis. Instead we keep a map from IR Function to MachineFunction in the MachineModuleInfo. This allows the insertion of ModulePasses into the codegen pipeline without breaking it because the MachineFunctionAnalysis gets dropped before a module pass. Peak memory should stay unchanged without a ModulePass in the codegen pipeline: Previously the MachineFunction was freed at the end of a codegen function pipeline because the MachineFunctionAnalysis was dropped; With this patch the MachineFunction is freed after the AsmPrinter has finished. Differential Revision: http://reviews.llvm.org/D23736 llvm-svn: 279502
* CommandFlags.h/llc: Move StopAfter/StartBefore options to llc.Matthias Braun2016-08-021-0/+8
| | | | | | | | | | | | | | | | | Move those two options to llc: The options in CommandFlags.h are shared by dsymutil, gold, llc, llvm-dwp, llvm-lto, llvm-mc, lto, opt. -stop-after/-start-after only affect codegen passes however only gold and llc actually create codegen passes and I believe these flags to be only useful for users of llc. For the other tools they are just highly confusing: -stop-after claims to "Stop compilation after a specific pass" which is not true in the context of the "opt" tool. Differential Revision: https://reviews.llvm.org/D23050 llvm-svn: 277551
* llc: Add support for -run-pass noneMatthias Braun2016-07-161-0/+3
| | | | | | | | | | This does not schedule any passes besides the ones necessary to construct and print the machine function. This is useful to test .mir file reading and printing. Differential Revision: http://reviews.llvm.org/D22432 llvm-svn: 275664
* llc: Move pass query/add code into an own function; NFCMatthias Braun2016-07-161-23/+30
| | | | llvm-svn: 275663
* [MIR] Print on the given output instead of stderr.Quentin Colombet2016-07-131-1/+1
| | | | | | | | | | | | Currently the MIR framework prints all its outputs (errors and actual representation) on stderr. This patch fixes that by printing the regular output in the output specified with -o. Differential Revision: http://reviews.llvm.org/D22251 llvm-svn: 275314
* Rename llc's -fpreserve-as-comments flag -preserve-as-comments.Nirav Dave2016-07-131-1/+1
| | | | llvm-svn: 275266
* [MC] Flip llc's assembly comment preservation flag to have consistentNirav Dave2016-07-121-3/+4
| | | | | | orientation with llvm-mc. llvm-svn: 275179
* Provide support for preserving assembly commentsNirav Dave2016-07-111-0/+5
| | | | | | | | | | | | | | | | | Preserve assembly comments from input in output assembly and flags to toggle property. This is on by default for inline assembly and off in llvm-mc. Parsed comments are emitted immediately before an EOL which generally places them on the expected line. Reviewers: rtrieu, dwmw2, rnk, majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20020 llvm-svn: 275058
* [PM] Port UnreachableBlockElim to the new Pass ManagerWei Mi2016-07-081-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D22124 llvm-svn: 274824
* [llc] Remove exit-on-error flag (PR27759)Diana Picus2016-06-231-12/+4
| | | | | | | | | | | | | This flag was introduced in r269655 with the new diagnostic handler for llc. Its purpose was to keep the old behavior for some of the tests that didn't recover well after an error. Those tests have been fixed, so now it's safe to remove the flag entirely. Fixes PR27759. Differential Revision: http://reviews.llvm.org/D21368 llvm-svn: 273554
* [llc] Do not create the pass config several times for run-pass.Quentin Colombet2016-06-101-6/+7
| | | | | | Thanks to Matthias Braun for spotting this. llvm-svn: 272358
* [llc] Add support for several run-pass options.Quentin Colombet2016-06-101-27/+50
| | | | | | | | | | | | | | | | | Previously we could run only one machine pass with the run-pass option. With that patch, we can now specify several passes with several run-pass options (or just one option with a list of comma separated passes) and llc will build the related pipeline. This is great to test the interaction of two passes that are not necessarily next to each other in the pipeline, or play with pass ordering. Now, we should be at parity with opt for the flexibility of running passes. Note: I also moved the run pass option from CommandFlags.h to llc.cpp because, really, this is needed only there! llvm-svn: 272356
* [llc] Remove exit-on-error flag from MIR tests (PR27770)Diana Picus2016-06-091-3/+1
| | | | | | | | | | | | | | | | This is made possible by removing an assert in llc that assumed MIRParser::parseLLVMModule would exit on error. MIRParser's documentation states that it returns null if a parsing error occurs, so there's no reason to assert. We can instead just fall through to where the check for a module is performed and exit if it is null. This commit is part of the clean-up after r269655. Fixes PR27770 Differential Revision: http://reviews.llvm.org/D20371 llvm-svn: 272254
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* Delete Reloc::Default.Rafael Espindola2016-05-181-1/+1
| | | | | | | | | | | | Having an enum member named Default is quite confusing: Is it distinct from the others? This patch removes that member and instead uses Optional<Reloc> in places where we have a user input that still hasn't been maped to the default value, which is now clear has no be one of the remaining 3 options. llvm-svn: 269988
* [llc] New diagnostic handlerRenato Golin2016-05-161-0/+29
| | | | | | | | | | | | | | | | | | | | | | Without a diagnostic handler installed, llc's behaviour is to exit on the first error that it encounters. This is very different from the behaviour of clang and other front ends, which try to gather as many errors as possible before exiting. This commit adds a diagnostic handler to llc, allowing it to find and report more than one error. The old behaviour is preserved under a flag (-exit-on-error). Some of the tests fail with the new diagnostic handler, so they have to use the new flag in order to run under the previous behaviour. Some of these are known bugs, others need further investigation. Ideally, we should fix the tests and remove the flag at some point in the future. Reapplied after fixing the LLDB build that was broken due to the new DiagnosticSeverity in LLVMContext.h, and fixed an UB in the new change. Patch by Diana Picus. llvm-svn: 269655
* Revert "[llc] New diagnostic handler"Renato Golin2016-05-141-30/+0
| | | | | | | | | | | | This reverts commit r269563. Even though now it passes all LLDB bots after a local fix, there's a new buildbot it fails with tests that we hadn't seen locally: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/15647 Adding those tests to the list to investigate. llvm-svn: 269568
* [llc] New diagnostic handlerRenato Golin2016-05-141-0/+30
| | | | | | | | | | | | | | | | | | | | | | Without a diagnostic handler installed, llc's behaviour is to exit on the first error that it encounters. This is very different from the behaviour of clang and other front ends, which try to gather as many errors as possible before exiting. This commit adds a diagnostic handler to llc, allowing it to find and report more than one error. The old behaviour is preserved under a flag (-exit-on-error). Some of the tests fail with the new diagnostic handler, so they have to use the new flag in order to run under the previous behaviour. Some of these are known bugs, others need further investigation. Ideally, we should fix the tests and remove the flag at some point in the future. Reapplied after fixing the LLDB build that was broken due to the new DiagnosticSeverity in LLVMContext.h. Patch by Diana Picus. llvm-svn: 269563
* Revert "[llc] New diagnostic handler"Renato Golin2016-05-131-30/+0
| | | | | | | | This reverts commit r269428, as it breaks the LLDB build. We need to understand how to change LLDB in the same way as LLC before landing this again. llvm-svn: 269432
* [llc] New diagnostic handlerRenato Golin2016-05-131-0/+30
| | | | | | | | | | | | | | | | | | | Without a diagnostic handler installed, llc's behaviour is to exit on the first error that it encounters. This is very different from the behaviour of clang and other front ends, which try to gather as many errors as possible before exiting. This commit adds a diagnostic handler to llc, allowing it to find and report more than one error. The old behaviour is preserved under a flag (-exit-on-error). Some of the tests fail with the new diagnostic handler, so they have to use the new flag in order to run under the previous behaviour. Some of these are known bugs, others need further investigation. Ideally, we should fix the tests and remove the flag at some point in the future. Patch by Diana Picus. llvm-svn: 269428
* llc: Print+Verify machine function after loading itMatthias Braun2016-05-101-0/+1
| | | | | | | | In -run-pass mode verify/print machine function immediately after loading the .mir file if -verify-machineinstr/-print-machineinstrs option is specified. llvm-svn: 269014
* CodeGen: Move TargetPassConfig from Passes.h to an own header; NFCMatthias Braun2016-05-101-0/+1
| | | | | | | | Many files include Passes.h but only a fraction needs to know about the TargetPassConfig class. Move it into an own header. Also rename Passes.cpp to TargetPassConfig.cpp while we are at it. llvm-svn: 269011
* Try to appease clang-x64-ninja-win7 bot.Matthias Braun2016-05-101-0/+1
| | | | | | | Looks like you need the complete definition of "X" when calling a "X &func()" declared function even when not using the result further. llvm-svn: 269006
OpenPOWER on IntegriCloud