summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAge
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189315 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/MachO: Add a bunch of defines.Charles Davis2013-08-27
| | | | | | | | Right now we have two headers for the Mach-O format. I'd like to get rid of one. Since the other object formats are all in Support, I chose to keep the Mach-O header in Support, and discard the other one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189314 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new API lto_codegen_compile_parallel().Shuxin Yang2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API is proposed by Nick Kledzik. The semantic is: -------------------------------------------------------------------------- Generate code for merged module into an array of native object files. On success returns a pointer to an array of NativeObjectFile. The count parameter returns the number of elements in the array. Each element is a pointer/length for a generated mach-o/ELF buffer. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details). extern const struct NativeObjectFile* lto_codegen_compile_parallel(lto_code_gen_t cg, size_t *count); --------------------------------------------------------------------------- This API is currently only called on OSX platform. Linux or other Unixes using GNU gold are not supposed to call this function, because on these systems, object files are fed back to linker via disk file instead of memory buffer. In this commit, lto_codegen_compile_parallel() simply calls lto_codegen_compile() to return a single object file. In the near future, this function is the entry point for compilation with partition. Linker can blindly call this function even if partition is turned off; in this case, compiler will return only one object file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189297 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-26
| | | | | | | | | | | | | | | | | | | DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Check for realpath availability in CMakeAlexey Samsonov2013-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189249 91177308-0d34-0410-b5e6-96231b3b80d8
* SelectionDAG: Use correct pointer size when lowering function arguments v2Tom Stellard2013-08-26
| | | | | | | | | | | | | | | | This adds minimal support to the SelectionDAG for handling address spaces with different pointer sizes. The SelectionDAG should now correctly lower pointer function arguments to the correct size as well as generate the correct code when lowering getelementptr. This patch also updates the R600 DataLayout to use 32-bit pointers for the local address space. v2: - Add more helper functions to TargetLoweringBase - Use CHECK-LABEL for tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189221 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix #include guard.Jakub Staszak2013-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189199 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] fix compile with -WerrorSaleem Abdulrasool2013-08-24
| | | | | | | error: commas at the end of enumerator lists are a C++11 extension [-Werror,-Wc++11-extensions] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189183 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] add missing enumeration valuesSaleem Abdulrasool2013-08-24
| | | | | | | | | This adds additional missing Windows subsystem identifiers to the IMAGE_SUBSYSTEM enumeration. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189180 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a function object to compare the first or second component of a std::pair.Benjamin Kramer2013-08-24
| | | | | | Replace instances of this scattered around the code base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189169 91177308-0d34-0410-b5e6-96231b3b80d8
* Added const qualifier to StringRef::edit_distance member functionDmitri Gribenko2013-08-24
| | | | | | | Patch by Ismail Pazarbasi. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189162 91177308-0d34-0410-b5e6-96231b3b80d8
* PrintVRegOrUnitAndrew Trick2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189124 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a convenient PSetIterator for visiting pressure sets affected by a register.Andrew Trick2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189121 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds cyclic critical path computation and heuristics, temporarily disabled.Andrew Trick2013-08-23
| | | | | | | | | | | Estimate the cyclic critical path within a single block loop. If the acyclic critical path is longer, then the loop will exhaust OOO resources after some number of iterations. If lag between the acyclic critical path and cyclic critical path is longer the the time it takes to issue those loop iterations, then aggressively schedule for latency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189120 91177308-0d34-0410-b5e6-96231b3b80d8
* MI Sched: record local vreg uses.Andrew Trick2013-08-23
| | | | | | | | | This will be used to compute the cyclic critical path and to update precomputed per-node pressure differences. In the longer term, it could also be used to speed up LiveInterval update by avoiding visiting all global vreg users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189118 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field.Andrew Trick2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189117 91177308-0d34-0410-b5e6-96231b3b80d8
* mi-sched: Don't call MBB.size() in initSUnits. The driver already has instr ↵Andrew Trick2013-08-23
| | | | | | | | | count. This fixes a pathological compile time problem with very large blocks and lots of scheduling boundaries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189116 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips][msa] Few MSA Builtins have side-effects. Added IntrNoMem to those ↵Daniel Sanders2013-08-23
| | | | | | that don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189106 91177308-0d34-0410-b5e6-96231b3b80d8
* Add function attribute 'optnone'.Andrea Di Biagio2013-08-23
| | | | | | | | | | This function attribute indicates that the function is not optimized by any optimization or code generator passes with the exception of interprocedural optimization passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189101 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn MipsOptimizeMathLibCalls into a target-independent scalar transformRichard Sandiford2013-08-23
| | | | | | | | | | | ...so that it can be used for z too. Most of the code is the same. The only real change is to use TargetTransformInfo to test when a sqrt instruction is available. The pass is opt-in because at the moment it only handles sqrt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189097 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an OtherPreserved field to the CalleeSaved TableGen class.Jakob Stoklund Olesen2013-08-23
| | | | | | | | | | This field specifies registers that are preserved across function calls, but that should not be included in the generates SaveList array. This can be used ot generate regmasks for architectures that save registers through other means, like SPARC's register windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189084 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new helper method to Value to strip in-bounds constant offsets ofChandler Carruth2013-08-22
| | | | | | | | | | | pointers, but accumulate the offset into an APInt in the process of stripping it. This is a pretty handy thing to have, such as when trying to determine if two pointers are at some constant relative offset. I'll be committing a patch shortly to use it for exactly that purpose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189000 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the doxygen formatting of the comments on the strip* methods onChandler Carruth2013-08-22
| | | | | | | | Value. These methods probably don't belong here, and I'm discussing moving the lot of them to a better home, but for now I'm about to extend their functionality and wanted to tidy them up first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188997 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM: use TableGen patterns to select CMOV operations.Tim Northover2013-08-22
| | | | | | | | | | | | Back in the mists of time (2008), it seems TableGen couldn't handle the patterns necessary to match ARM's CMOV node that we convert select operations to, so we wrote a lot of fairly hairy C++ to do it for us. TableGen can deal with it now: there were a few minor differences to CodeGen (see tests), but nothing obviously worse that I could see, so we should probably address anything that *does* come up in a localised manner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188995 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT/Triple: Helper to determine if we are targeting the Windows CRTDavid Majnemer2013-08-21
| | | | | | | | | | | | | | | | Summary: This support will be utilized in things like clang to help check printf format specifiers that are only valid when using the VSCRT. Reviewers: rnk, asl, chandlerc Reviewed By: chandlerc CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1455 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188935 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic unit tests for PointerUnionDavid Blaikie2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188933 91177308-0d34-0410-b5e6-96231b3b80d8
* MCFunction.h: Prune \returns to fix a warning in r188881. [-Wdocumentation]NAKAMURA Takumi2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188897 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add YAML MCModule representation to enable MC CFG testing.Ahmed Bougacha2013-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like yaml ObjectFiles, this will be very useful for testing the MC CFG implementation (mostly MCObjectDisassembler), by matching the output with YAML, and for potential users of the MC CFG, by using it as an input. There isn't much to the actual format, it is just a serialization of the MCModule class. Of note: - Basic block references (pred/succ, ..) are represented by the BB's start address. - Just as in the MC CFG, instructions are MCInsts with a size. - Operands have a prefix representing the type (only register and immediate supported here). - Instruction opcodes are represented by their names; enum values aren't stable, enum names mostly are: usually, a change to a name would need lots of changes in the backend anyway. Same with registers. All in all, an example is better than 1000 words, here goes: A simple binary: Disassembly of section __TEXT,__text: _main: 100000f9c: 48 8b 46 08 movq 8(%rsi), %rax 100000fa0: 0f be 00 movsbl (%rax), %eax 100000fa3: 3b 04 25 48 00 00 00 cmpl 72, %eax 100000faa: 0f 8c 07 00 00 00 jl 7 <.Lend> 100000fb0: 2b 04 25 48 00 00 00 subl 72, %eax .Lend: 100000fb7: c3 ret And the (pretty verbose) generated YAML: --- Atoms: - StartAddress: 0x0000000100000F9C Size: 20 Type: Text Content: - Inst: MOV64rm Size: 4 Ops: [ RRAX, RRSI, I1, R, I8, R ] - Inst: MOVSX32rm8 Size: 3 Ops: [ REAX, RRAX, I1, R, I0, R ] - Inst: CMP32rm Size: 7 Ops: [ REAX, R, I1, R, I72, R ] - Inst: JL_4 Size: 6 Ops: [ I7 ] - StartAddress: 0x0000000100000FB0 Size: 7 Type: Text Content: - Inst: SUB32rm Size: 7 Ops: [ REAX, REAX, R, I1, R, I72, R ] - StartAddress: 0x0000000100000FB7 Size: 1 Type: Text Content: - Inst: RET Size: 1 Ops: [ ] Functions: - Name: __text BasicBlocks: - Address: 0x0000000100000F9C Preds: [ ] Succs: [ 0x0000000100000FB7, 0x0000000100000FB0 ] <snip> ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188890 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Support disassembly at arbitrary addresses in MCObjectDisassembler.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188889 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add an MCObjectSymbolizer in the MCObjectDisassembler.Ahmed Bougacha2013-08-21
| | | | | | Used to detect calls to function symbol stubs (future commit). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188887 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add MCObjectDisassembler Mach-O implementation.Ahmed Bougacha2013-08-21
| | | | | | | | | | Supports: - entrypoint, using LC_MAIN. - static ctors/dtors, using __mod_{init,exit}_func - translation between effective and object load address, using dyld's VM address slide. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188886 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Mach-O entry_point_command declaration.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188885 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add "dynamic disassembly" support to MCObjectDisassembler.Ahmed Bougacha2013-08-21
| | | | | | | | It can now disassemble code in situations where the effective load address is different than the load address declared in the object file. This happens for PIC, hence "dynamic". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188884 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add MCObjectDisassembler support for entrypoint + static ctors.Ahmed Bougacha2013-08-21
| | | | | | For now, this isn't implemented for any format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188882 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Split MCBasicBlocks to mirror atom splitting.Ahmed Bougacha2013-08-21
| | | | | | | | When an MCTextAtom is split, all MCBasicBlocks backed by it are automatically split, with a fallthrough between both blocks, and the successors moved to the second block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188881 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.Ahmed Bougacha2013-08-21
| | | | | | While there, do some minor cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188880 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: ObjectSymbolizer can now recognize external function stubs.Ahmed Bougacha2013-08-21
| | | | | | | Only implemented in the Mach-O ObjectSymbolizer. The testcase sadly introduces a new binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188879 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Refactor ObjectSymbolizer to make relocation/section info generation lazy.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188878 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add entrypoint address to MCModule.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188877 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add more MCFunction container methods (find, empty).Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188876 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Keep pointer to parent MCModule in created MCFunctions.Ahmed Bougacha2013-08-21
| | | | | | Also, drive-by cleaning around createFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188875 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: uint64_t -> size_t for vector size.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188872 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Add a getter for MCDataAtom's data array.Ahmed Bougacha2013-08-21
| | | | | | While there, switch to new-style documentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188871 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Do not use the DWARF Version for the .debug_pubnames or ↵David Majnemer2013-08-21
| | | | | | | | | | | | | | | | | | | | | | | .debug_pubtypes version field Summary: LLVM would generate DWARF with version 3 in the .debug_pubname and .debug_pubtypes version fields. This would lead SGI dwarfdump to fail parsing the DWARF with (in the instance of .debug_pubnames) would exit with: dwarfdump ERROR: dwarf_get_globals: DW_DLE_PUBNAMES_VERSION_ERROR (123) This fixes PR16950. Reviewers: echristo, dblaikie Reviewed By: echristo CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1454 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188869 91177308-0d34-0410-b5e6-96231b3b80d8
* Move #includes from .h to .cpp file.Jakub Staszak2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188852 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some constantness.Jakub Staszak2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188844 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix include guards.Jakub Staszak2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188841 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips][msa] Removed fcge, fcgt, fsge, fsgtDaniel Sanders2013-08-20
| | | | | | | | | These instructions were present in a draft spec but were removed before publication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188782 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Use SRST to optimize memchrRichard Sandiford2013-08-20
| | | | | | | | | | | | | | | | | | | | SystemZTargetLowering::emitStringWrapper() previously loaded the character into R0 before the loop and made R0 live on entry. I'd forgotten that allocatable registers weren't allowed to be live across blocks at this stage, and it confused LiveVariables enough to cause a miscompilation of f3 in memchr-02.ll. This patch instead loads R0 in the loop and leaves LICM to hoist it after RA. This is actually what I'd tried originally, but I went for the manual optimisation after noticing that R0 often wasn't being hoisted. This bug forced me to go back and look at why, now fixed as r188774. We should also try to optimize null checks so that they test the CC result of the SRST directly. The select between null and the SRST GPR result could then usually be deleted as dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188779 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips][msa] Added insveDaniel Sanders2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188777 91177308-0d34-0410-b5e6-96231b3b80d8