1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-27 22:12:47 +01:00
llvm-mirror/lib/IR
Peter Collingbourne 837799f13b Prologue support
Patch by Ben Gamari!

This redefines the `prefix` attribute introduced previously and
introduces a `prologue` attribute.  There are a two primary usecases
that these attributes aim to serve,

  1. Function prologue sigils

  2. Function hot-patching: Enable the user to insert `nop` operations
     at the beginning of the function which can later be safely replaced
     with a call to some instrumentation facility

  3. Runtime metadata: Allow a compiler to insert data for use by the
     runtime during execution. GHC is one example of a compiler that
     needs this functionality for its tables-next-to-code functionality.

Previously `prefix` served cases (1) and (2) quite well by allowing the user
to introduce arbitrary data at the entrypoint but before the function
body. Case (3), however, was poorly handled by this approach as it
required that prefix data was valid executable code.

Here we redefine the notion of prefix data to instead be data which
occurs immediately before the function entrypoint (i.e. the symbol
address). Since prefix data now occurs before the function entrypoint,
there is no need for the data to be valid code.

The previous notion of prefix data now goes under the name "prologue
data" to emphasize its duality with the function epilogue.

The intention here is to handle cases (1) and (2) with prologue data and
case (3) with prefix data.

References
----------

This idea arose out of discussions[1] with Reid Kleckner in response to a
proposal to introduce the notion of symbol offsets to enable handling of
case (3).

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html

Test Plan: testsuite

Differential Revision: http://reviews.llvm.org/D6454

llvm-svn: 223189
2014-12-03 02:08:38 +00:00
..
AsmWriter.cpp Prologue support 2014-12-03 02:08:38 +00:00
AsmWriter.h IR: Implement uselistorder assembly directives 2014-08-19 21:30:15 +00:00
AttributeImpl.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Attributes.cpp Revert accidentally committed r217107 2014-09-03 23:38:05 +00:00
AutoUpgrade.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
BasicBlock.cpp Move helper for getting a terminating musttail call to BasicBlock 2014-08-12 00:05:15 +00:00
CMakeLists.txt [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
Comdat.cpp IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
ConstantFold.cpp Return undef on FP <-> Int conversions that overflow (PR21330). 2014-10-10 23:00:21 +00:00
ConstantFold.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
ConstantRange.cpp
Constants.cpp Revert "unique_ptrify LLVMContextImpl::CAZConstants" 2014-11-25 02:26:22 +00:00
ConstantsContext.h IR: De-duplicate code for replacing operands in place 2014-08-19 19:13:30 +00:00
Core.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
DataLayout.cpp Switch the default DataLayout to be little endian, and make the variable 2014-10-20 10:41:29 +00:00
DebugInfo.cpp Debug Info: revert r222195, r222210 and r222239. 2014-11-21 19:55:23 +00:00
DebugLoc.cpp Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
DiagnosticInfo.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
DiagnosticPrinter.cpp Fix typos in comments, NFC 2014-08-29 21:53:01 +00:00
DIBuilder.cpp Debug Info: revert r222195, r222210 and r222239. 2014-11-21 19:55:23 +00:00
Dominators.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
Function.cpp Prologue support 2014-12-03 02:08:38 +00:00
GCOV.cpp GCOV: Make sure that function idents in the .gcda and .gcno match 2014-11-06 06:55:02 +00:00
Globals.cpp Copy externally_initialized in GlobalVariable::copyAttributesFrom. 2014-11-10 18:41:59 +00:00
GVMaterializer.cpp [Layering] Move GVMaterializer.h into the IR library where its 2014-03-06 03:50:29 +00:00
InlineAsm.cpp [inline asm] Add a check in InlineAsm::ConstraintInfo::Parse to make sure '{' 2014-09-05 22:30:32 +00:00
Instruction.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
Instructions.cpp Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite 2014-11-25 08:20:27 +00:00
IntrinsicInst.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-09 06:08:46 +00:00
IRBuilder.cpp Revert "Masked Vector Load and Store Intrinsics." 2014-11-28 21:29:14 +00:00
IRPrintingPasses.cpp Fix some misplaced spaces around 'override' 2014-05-24 20:19:40 +00:00
LeakDetector.cpp [Modules] Move the LeakDetector header into the IR library where the 2014-03-04 12:46:06 +00:00
LeaksContext.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
LegacyPassManager.cpp Remove redundant calls to isMaterializable. 2014-11-01 16:46:18 +00:00
LLVMBuild.txt
LLVMContext.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
LLVMContextImpl.cpp Revert "unique_ptrify LLVMContextImpl::CAZConstants" 2014-11-25 02:26:22 +00:00
LLVMContextImpl.h Prologue support 2014-12-03 02:08:38 +00:00
Makefile
Mangler.cpp Silencing an "enumeral and non-enumeral type in conditional expression" warning; NFC. 2014-10-28 13:12:13 +00:00
MDBuilder.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00
Metadata.cpp IR: Sink MDNode::Hash down to GenericMDNode::Hash 2014-11-18 02:20:29 +00:00
Module.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
module.modulemap [modules] Add module maps for LLVM. These are not quite ready for prime-time 2014-05-21 02:46:14 +00:00
Pass.cpp Remove pimpl class from PassRegistry. 2014-06-12 16:06:51 +00:00
PassManager.cpp Remove unnecessary/redundant std::move 2014-07-16 17:09:21 +00:00
PassRegistry.cpp [PM] Remove an unused and rather expensive mapping from an analysis 2014-10-06 00:30:59 +00:00
Statepoint.cpp [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
SymbolTableListTraitsImpl.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Type.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
TypeFinder.cpp Prologue support 2014-12-03 02:08:38 +00:00
Use.cpp Fix a URL (NFC) 2014-08-21 21:09:24 +00:00
UseListOrder.cpp verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
User.cpp IR: Cleanup comments for Value, User, and MDNode 2014-10-15 20:28:31 +00:00
Value.cpp [InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence) 2014-11-21 23:36:44 +00:00
ValueSymbolTable.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
ValueTypes.cpp
Verifier.cpp [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics 2014-12-01 21:18:12 +00:00