aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/TargetSelect.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-01-11[ExecutionEngine] Re-enable FastISel for non-iOS arm targets.Lang Hames1-7/+0
Patch by Nicolas Capens. Thanks Nicolas! https://reviews.llvm.org/D65015
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-02-28[TLS] use emulated TLS if the target supports only this modeChih-Hung Hsieh1-0/+2
Emulated TLS is enabled by llc flag -emulated-tls, which is passed by clang driver. When llc is called explicitly or from other drivers like LTO, missing -emulated-tls flag would generate wrong TLS code for targets that supports only this mode. Now use useEmulatedTLS() instead of Options.EmulatedTLS to decide whether emulated TLS code should be generated. Unit tests are modified to run with and without the -emulated-tls flag. Differential Revision: https://reviews.llvm.org/D42999 llvm-svn: 326341
2017-10-20[ExecutionEngine] After a heroic dev-meeting hack session, the JIT supports TLS.Lang Hames1-1/+2
Turns on EmulatedTLS support by default in EngineBuilder. ;) llvm-svn: 316200
2017-08-03Delete Default and JITDefault code modelsRafael Espindola1-5/+4
IMHO it is an antipattern to have a enum value that is Default. At any given piece of code it is not clear if we have to handle Default or if has already been mapped to a concrete value. In this case in particular, only the target can do the mapping and it is nice to make sure it is always done. This deletes the two default enum values of CodeModel and uses an explicit Optional<CodeModel> when it is possible that it is unspecified. llvm-svn: 309911
2016-08-12Use the range variant of find/find_if instead of unpacking begin/endDavid Majnemer1-3/+2
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
2016-04-18[NFC] Header cleanupMehdi Amini1-2/+1
Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
2015-05-11Readdress r236990, use of static members on a non-static variable.David Blaikie1-8/+6
The TargetRegistry is just a namespace-like class, instantiated in one place to use a range-based for loop. Instead, expose access to the registry via a range-based 'targets()' function instead. This makes most uses a bit awkward/more verbose - but eventually we should just add a range-based find_if function which will streamline these functions. I'm happy to mkae them a bit awkward in the interim as encouragement to improve the algorithms in time. llvm-svn: 237059
2014-09-02Reinstate "Nuke the old JIT."Eric Christopher1-3/+2
Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
2014-08-07Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher1-2/+3
be deleted. This will be reapplied as soon as possible and before the 3.6 branch date at any rate. Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reverts commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 215154
2014-08-07Nuke the old JIT.Rafael Espindola1-3/+2
I am sure we will be finding bits and pieces of dead code for years to come, but this is a good start. Thanks to Lang Hames for making MCJIT a good replacement! llvm-svn: 215111
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-4/+4
instead of comparing to nullptr. llvm-svn: 206252
2013-08-29Clean up some usage of Triple. The base class has methods for determining ↵Cameron Esfahani1-1/+1
if the target is iOS and Linux. llvm-svn: 189604
2013-06-14Enable FastISel on ARM for Linux and NaCl, not MCJITJF Bastien1-0/+8
This is a resubmit of r182877, which was reverted because it broken MCJIT tests on ARM. The patch leaves MCJIT on ARM as it was before: only enabled for iOS. I've CC'ed people from the original review and revert. FastISel was only enabled for iOS ARM and Thumb2, this patch enables it for ARM (not Thumb2) on Linux and NaCl, but not MCJIT. Thumb2 support needs a bit more work, mainly around register class restrictions. The patch punts to SelectionDAG when doing TLS relocation on non-Darwin targets. I will fix this and other FastISel-to-SelectionDAG failures in a separate patch. The patch also forces FastISel to retain frame pointers: iOS always keeps them for backtracking (so emitted code won't change because of this), but Linux was getting much worse code that was incorrect when using big frames (such as test-suite's lencod). I'll also fix this in a later patch, it will probably require a peephole so that FastISel doesn't rematerialize frame pointers back-to-back. The test changes are straightforward, similar to: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130513/174279.html They also add a vararg test that got dropped in that change. I ran all of lnt test-suite on A15 hardware with --optimize-option=-O0 and all the tests pass. All the tests also pass on x86 make check-all. I also re-ran the check-all tests that failed on ARM, and they all seem to pass. llvm-svn: 183966
2013-01-16Introduce llvm::sys::getProcessTriple() function.Peter Collingbourne1-13/+2
In r143502, we renamed getHostTriple() to getDefaultTargetTriple() as part of work to allow the user to supply a different default target triple at configure time. This change also affected the JIT. However, it is inappropriate to use the default target triple in the JIT in most circumstances because this will not necessarily match the current architecture used by the process, leading to illegal instruction and other such errors at run time. Introduce the getProcessTriple() function for use in the JIT and its clients, and cause the JIT to use it. On architectures with a single bitness, the host and process triples are identical. On other architectures, the host triple represents the architecture of the host CPU, while the process triple represents the architecture used by the host CPU to interpret machine code within the current process. For example, when executing 32-bit code on a 64-bit Linux machine, the host triple may be 'x86_64-unknown-linux-gnu', while the process triple may be 'i386-unknown-linux-gnu'. This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple platforms. Differential Revision: http://llvm-reviews.chandlerc.com/D254 llvm-svn: 172627
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth1-1/+1
into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
2012-12-05Adjust JIT target triple on OS X to match the current architecture.Bob Wilson1-1/+11
For OS X builds, we generate one version of config.h but then build for multiple architectures. This means that the LLVM_HOSTTRIPLE setting may have the wrong architecture. Adjust it dynamically to match the current architecture. <rdar://problem/12715470> llvm-svn: 169405
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-2/+2
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-10-02Support for generating ELF objects on Windows.Andrew Kaylor1-1/+8
This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present. This patch also enables MCJIT tests on Windows using the new environment value. llvm-svn: 165030
2012-07-22ExecutionEngine/TargetSelect.cpp: Override default triple as LLVM_HOSTTRIPLE.NAKAMURA Takumi1-1/+1
In current implementation, JIT should run only on host. llvm-svn: 160610
2012-05-21Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually ↵Owen Anderson1-4/+0
used. Patch by Jose Fonseca. llvm-svn: 157191
2012-05-10ExecutionEngine: Check for NULL ErrorStr before using it.Jim Grosbach1-2/+3
Patch by Yury Mikhaylov <yury.mikhaylov@gmail.com>. llvm-svn: 156523
2012-03-23Make it feasible for clients using EngineBuilder to capture the ↵Owen Anderson1-7/+13
TargetMachine that is created as part of selecting the appropriate target. This is necessary if the client wants to be able to mutate TargetOptions (for example, fast FP math mode) after the initial creation of the ExecutionEngine. llvm-svn: 153342
2011-12-12ExecutionEngine: refactor interfaceDylan Noblesmith1-14/+8
The OptLevel is now redundant with the TargetMachine*. And selectTarget() isn't really JIT-specific and could probably get refactored into one of the lower level libraries. llvm-svn: 146355
2011-12-07EngineBuilder: support for custom TargetOptions. Fixes thePeter Collingbourne1-1/+1
ExceptionDemo example. llvm-svn: 146108
2011-12-02Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky1-0/+2
change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
2011-12-01ExecutionEngine: honor optimization levelDylan Noblesmith1-1/+2
It was getting ignored after r144788. Also fix an accidental implicit cast from the OptLevel enum to an optional bool argument. MSVC warned on this, but gcc didn't. llvm-svn: 145633
2011-11-01rename getHostTriple into getDefaultTargetTripleSebastian Pop1-1/+1
llvm-svn: 143502
2011-08-24Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng1-3/+3
These are strictly utilities for registering targets and components. llvm-svn: 138450
2011-07-20- Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng1-1/+3
- Introduce JITDefault code model. This tells targets to set different default code model for JIT. This eliminates the ugly hack in TargetMachine where code model is changed after construction. llvm-svn: 135580
2011-07-19Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng1-2/+3
(including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. llvm-svn: 135468
2011-06-30Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng1-3/+2
be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! llvm-svn: 134127
2011-06-29Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng1-1/+1
MCInstrItineraries) into MC. llvm-svn: 134049
2011-05-13ExecutionEngine: fix JIT/MCJIT selectTarget() duplication (v2)Dylan Noblesmith1-0/+91
This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. llvm-svn: 131316
2011-05-07Revert ExecutionEngine patches, they either failed to build or broke unit tests.Jakob Stoklund Olesen1-91/+0
Please ensure the build is clean and tests are passing when recommitting. llvm-svn: 131044
2011-05-06ExecutionEngine: add missing fileDylan Noblesmith1-0/+91
From revision 131025. llvm-svn: 131029