summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT
Commit message (Collapse)AuthorAgeFilesLines
...
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-024-13/+13
| | | | | | | | | | | | | | | | | | | | | 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
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170902
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-035-37/+41
| | | | | | | | | | | | | | | | | 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
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-151-1/+5
| | | | | | permissions after an object has been loaded. llvm-svn: 168114
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-011-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-151-6/+8
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* Remove buggy classof().Sean Silva2012-10-111-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This classof() is effectively saying that a MachineCodeEmitter "is-a" JITEmitter, but JITEmitter is in fact a descendant of MachineCodeEmitter, so this is not semantically correct. Consequently, none of the assertions that rely on these classof() actualy check anything. Remove the RTTI (which didn't actually check anything) and use static_cast<> instead. Post-Mortem Bug Analysis ======================== Cause of the bug ---------------- r55022 appears to be the source of the classof() and assertions removed by this commit. It aimed at removing some dynamic_cast<> that were solely in the assertions. A typical diff hunk from that commit looked like: - assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?"); - JITEmitter *JE = static_cast<JITEmitter*>(getCodeEmitter()); + assert(isa<JITEmitter>(MCE) && "Unexpected MCE?"); + JITEmitter *JE = cast<JITEmitter>(getCodeEmitter()); Hence, the source of the bug then seems to be an attempt to replace dynamic_cast<> with LLVM-style RTTI without properly setting up the class hierarchy for LLVM-style RTTI. The bug therefore appears to be simply a "thinko". What initially indicated the presence of the bug ------------------------------------------------ After implementing automatic upcasting for isa<>, classof() functions of the form static bool classof(const Foo *) { return true; } were removed, since they only serve the purpose of optimizing statically-OK upcasts. A subsequent recompilation triggered a build failure on the isa<> tests within the removed asserts, since the automatic upcasting (correctly) failed to substitute this classof(). Key to pinning down the root cause of the bug --------------------------------------------- After being alerted to the presence of the bug, some thought about the semantics which were being asserted by the buggy classof() revealed that it was incorrect. How the bug could have been prevented ------------------------------------- This bug could have been prevented by better documentation for how to set up LLVM-style RTTI. This should be solved by the recently added documentation HowToSetUpLLVMStyleRTTI. However, this bug suggests that the documentation should clearly explain the contract that classof() must fulfill. The HowToSetUpLLVMStyleRTTI already explains this contract, but it is a little tucked away. A future patch will expand that explanation and make it more prominent. There does not appear to be a simple way to have the compiler prevent this bug, since fundamentally it boiled down to a spurious classof() where the programmer made an erroneous statement about the conversion. This suggests that perhaps the interface to LLVM-style RTTI of classof() is not the best. There is already some evidence for this, since in a number of places Clang has classof() forward to classofKind(Kind K) which evaluates the cast in terms of just the Kind. This could probably be generalized to simply a `static const Kind MyKind;` field in leaf classes and `static const Kind firstMyKind, lastMyKind;` for non-leaf classes, and have the rest of the work be done inside Casting.h, assuming that the Kind enum is laid out in a preorder traversal of the inheritance tree. llvm-svn: 165764
* Revert 165732 for further review.Micah Villmow2012-10-111-8/+6
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-111-6/+8
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Move TargetData to DataLayout.Micah Villmow2012-10-084-20/+20
| | | | llvm-svn: 165402
* Add a getName function to MachineFunction. Use it in places that previously ↵Craig Topper2012-08-221-2/+2
| | | | | | did getFunction()->getName(). Remove includes of Function.h that are no longer needed. llvm-svn: 162347
* Fixed a problem in the JIT memory allocator whereSean Callanan2012-08-151-0/+3
| | | | | | | | | | allocations of executable memory would not be padded to account for the size of the allocation header. This resulted in undersized allocations, meaning that when the allocation was written to later the next allocation's header would be corrupted. llvm-svn: 161984
* JIT::runFunction(): add a fast path for functions with a single argument ↵Nuno Lopes2012-08-021-2/+7
| | | | | | that is a pointer. llvm-svn: 161171
* You cannot call removeModule on a JIT with no modules. Patch by VerenaChad Rosier2012-07-251-1/+1
| | | | | | Beckham <verena@codeplay.com>. Reviewed by Jim Grosbach. llvm-svn: 160753
* Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp andBill Wendling2012-06-281-2/+2
| | | | | | | | | include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h. The reasoning is because the DebugInfo module is simply an interface to the debug info MDNodes and has nothing to do with analysis. llvm-svn: 159312
* Disable the right instance of TheJIT, this one is only used in asserts.Benjamin Kramer2012-06-161-8/+8
| | | | llvm-svn: 158610
* Guard private fields that are unused in Release builds with #ifndef NDEBUG.Benjamin Kramer2012-06-161-1/+6
| | | | llvm-svn: 158608
* Fix some formatting, grammar and style issues and add a couple of missing ↵Eli Bendersky2012-04-291-1/+1
| | | | | | comments. llvm-svn: 155793
* Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.Danil Malyshev2012-03-285-167/+179
| | | | llvm-svn: 153607
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-225-179/+166
| | | | | | | | | | | | | | | (and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. llvm-svn: 153241
* Based on this discussion: ↵Danil Malyshev2012-03-215-166/+179
| | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html 1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager 2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager. llvm-svn: 153205
* Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted ↵Eli Bendersky2012-03-132-193/+0
| | | | | | | | | | | code in LLVM. Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code. In addition, unit tests for the profiling interfaces were added. This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach llvm-svn: 152620
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-072-6/+5
| | | | llvm-svn: 149967
* Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which isAkira Hatanaka2012-02-031-0/+3
| | | | | | | | needed to emit a 64-bit gp-relative relocation entry. Make changes necessary for emitting jump tables which have entries with directive .gpdword. This patch does not implement the parts needed for direct object emission or JIT. llvm-svn: 149668
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148578
* MCJIT support for non-function sections.Jim Grosbach2012-01-161-0/+44
| | | | | | | | | | | | | | | | Move to a by-section allocation and relocation scheme. This allows better support for sections which do not contain externally visible symbols. Flesh out the relocation address vs. local storage address separation a bit more as well. Remote process JITs use this to tell the relocation resolution code where the code will live when it executes. The startFunctionBody/endFunctionBody interfaces to the JIT and the memory manager are deprecated. They'll stick around for as long as the old JIT does, but the MCJIT doesn't use them anymore. llvm-svn: 148258
* Remove the old ELF writer.Rafael Espindola2012-01-054-355/+3
| | | | llvm-svn: 147615
* A small re-factored JIT/MCJIT::getPointerToNamedFunction(), so it could be ↵Danil Malyshev2012-01-051-2/+2
| | | | | | called with the base class. llvm-svn: 147610
* LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar2011-12-121-1/+0
| | | | llvm-svn: 146409
* ExecutionEngine: refactor interfaceDylan Noblesmith2011-12-122-6/+3
| | | | | | | | 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
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-1/+1
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky2011-12-022-5/+11
| | | | | | | | | | | | 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
* ExecutionEngine: honor optimization levelDylan Noblesmith2011-12-011-3/+3
| | | | | | | | | | 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
* build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar2011-11-291-10/+0
| | | | llvm-svn: 145420
* Remove all remaining uses of Value::getNameStr().Benjamin Kramer2011-11-151-1/+1
| | | | llvm-svn: 144648
* build: Attempt to rectify inconsistencies between CMake and LLVMBuild ↵Daniel Dunbar2011-11-122-2/+3
| | | | | | | | versions of explicit dependencies. - The hope is that we have a tool/test to verify these are accurate (and tight) soon. llvm-svn: 144444
* build: Add initial cut at LLVMBuild.txt files.Daniel Dunbar2011-11-031-0/+23
| | | | llvm-svn: 143634
* Adding dependencies to allow -DBUILD_SHARED_LIBS=true to complete.Joe Abbey2011-10-191-0/+1
| | | | llvm-svn: 142464
* EE: Provide the symbol "lseek64" explicitly with <unistd.h> on Linux glibc.NAKAMURA Takumi2011-08-141-0/+1
| | | | | | With libcxx, it seems <unistd.h> would not be provided. Thanks to Ryuta Suzuki. llvm-svn: 137567
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-121-0/+1
| | | | | | when building with assertions disabled. llvm-svn: 137460
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. llvm-svn: 136433
* - Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng2011-07-201-1/+1
| | | | | | | | - 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
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-191-1/+2
| | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. llvm-svn: 135468
* Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions forEvan Cheng2011-07-182-8/+6
| | | | | | better location welcome). llvm-svn: 135438
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-182-6/+6
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-2/+1
| | | | llvm-svn: 135265
* ExecutionEngine: move createJIT() definition (v2)Dylan Noblesmith2011-05-131-19/+0
| | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. llvm-svn: 131320
* ExecutionEngine: push TargetMachine creation into clients (v2)Dylan Noblesmith2011-05-132-20/+8
| | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. llvm-svn: 131317
* ExecutionEngine: fix JIT/MCJIT selectTarget() duplication (v2)Dylan Noblesmith2011-05-134-102/+9
| | | | | | | This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. llvm-svn: 131316
* Revert ExecutionEngine patches, they either failed to build or broke unit tests.Jakob Stoklund Olesen2011-05-074-5/+129
| | | | | | Please ensure the build is clean and tests are passing when recommitting. llvm-svn: 131044
OpenPOWER on IntegriCloud