summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* MC: Clean up the naming for MCMachObjectWriter. NFC.Jim Grosbach2015-06-049-62/+62
| | | | | | | | | | | | | | | | | | s/ExecutePostLayoutBinding/executePostLayoutBinding/ s/ComputeSymbolTable/computeSymbolTable/ s/BindIndirectSymbols/bindIndirectSymbols/ s/RecordTLVPRelocation/recordTLVPRelocation/ s/RecordScatteredRelocation/recordScatteredRelocation/ s/WriteLinkerOptionsLoadCommand/writeLinkerOptionsLoadCommand/ s/WriteLinkeditLoadCommand/writeLinkeditLoadCommand/ s/WriteNlist/writeNlist/ s/WriteDysymtabLoadCommand/writeDysymtabLoadCommand/ s/WriteSymtabLoadCommand/writeSymtabLoadCommand/ s/WriteSection/writeSection/ s/WriteSegmentLoadCommand/writeSegmentLoadCommand/ s/WriteHeader/writeHeader/ llvm-svn: 239119
* MC: Move MachObjectWriter::SectionAddress to private.Jim Grosbach2015-06-041-2/+2
| | | | | | There's already a get() method everything that needs it is using. llvm-svn: 239118
* MC: Tidy up formatting and doc comments. NFC.Jim Grosbach2015-06-041-25/+15
| | | | llvm-svn: 239117
* [Object, ELF] Don't assert on invalid magic in createELFObjectFile.Alexey Samsonov2015-06-043-2/+5
| | | | | | Instead, return a proper error code from factory. llvm-svn: 239116
* [InstCombine] Don't miscompile safe increment idiomDavid Majnemer2015-06-042-3/+31
| | | | | | | | | | | We cleverly handle cases where computation done in one argument of a select instruction is suitable for the other operand, thus obviating the need of the select and the comparison. However, the other operand cannot have flags. This fixes PR23757. llvm-svn: 239115
* Statepoint: Fix handling of Far Immediate callsSwaroop Sridhar2015-06-042-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | gc.statepoint intrinsics with a far immediate call target were lowered incorrectly as pc-rel32 calls. This change fixes the problem, and generates an indirect call via a scratch register. For example: Intrinsic: %safepoint_token = call i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* inttoptr (i64 140727162896504 to void ()*), i32 0, i32 0, i32 0, i32 0) Old Incorrect Lowering: callq 140727162896504 New Correct Lowering: movabsq $140727162896504, %rax callq *%rax In lowerCallFromStatepoint(), the callee-target was modified and represented as a "TargetConstant" node, rather than a "Constant" node. Undoing this modification enabled LowerCall() to generate the correct CALL instruction. llvm-svn: 239114
* [Object, ELF] Don't call llvm_unreachable() from createELFObjectFile.Alexey Samsonov2015-06-043-2/+4
| | | | | | Instead, return a proper error code from factory. llvm-svn: 239113
* [Target/X86] Don't use callee-saved registers in a Win64 tail call on ↵Charles Davis2015-06-042-2/+26
| | | | | | | | | | | | | | | | | | | | | | non-Windows. Summary: A small bit that I missed when I updated the X86 backend to account for the Win64 calling convention on non-Windows. Now we don't use dead non-volatile registers when emitting a Win64 indirect tail call on non-Windows. Should fix PR23710. Test Plan: Added test for the correct behavior based on the case I posted to PR23710. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10258 llvm-svn: 239111
* [Object, MachO] Fixup for r239075: use union to store mach_header and ↵Alexey Samsonov2015-06-042-9/+6
| | | | | | mach_header_64. llvm-svn: 239110
* [Object, MachO] Don't crash on incomplete MachO segment load commands.Alexey Samsonov2015-06-043-1/+7
| | | | | | | | Report proper error code from MachOObjectFile constructor if we can't parse another segment load command (we already return a proper error if segment load command contents is suspicious). llvm-svn: 239109
* MC: Clean up naming in MCObjectWriter. NFC.Jim Grosbach2015-06-0420-263/+263
| | | | | | | | | | | | | | | | | | | | s/WriteObject/writeObject/ s/RecordRelocation/recordRelocation/ s/IsSymbolRefDifferenceFullyResolved/isSymbolRefDifferenceFullyResolved/ s/Write8/write8/ s/WriteLE16/writeLE16/ s/WriteLE32/writeLE32/ s/WriteLE64/writeLE64/ s/WriteBE16/writeBE16/ s/WriteBE32/writeBE32/ s/WriteBE64/writeBE64/ s/Write16/write16/ s/Write32/write32/ s/Write64/write64/ s/WriteZeroes/writeZeroes/ s/WriteBytes/writeBytes/ llvm-svn: 239108
* MC: Tidy up formatting and doc comments. NFC.Jim Grosbach2015-06-041-19/+17
| | | | llvm-svn: 239107
* [Object, MachO] Simplify load segment parsing code. NFC.Alexey Samsonov2015-06-041-52/+30
| | | | llvm-svn: 239106
* [SDAG switch lowering] Fix switch case -> or merging for 0 and INT_MINBenjamin Kramer2015-06-042-10/+25
| | | | | | | | | | | The big/small ordering here is based on signed values so SmallValue will be INT_MIN and BigValue 0. This shouldn't be a problem but the code assumed that BigValue always had more bits set than SmallValue. We used to just miss the transformation, but a recent refactoring of mine turned this into an assertion failure. llvm-svn: 239105
* Shouldn't be XFAIL'ed.Colin LeMahieu2015-06-041-1/+0
| | | | llvm-svn: 239103
* Revert r239095 incorrect test tree.Colin LeMahieu2015-06-0417-2831/+59
| | | | llvm-svn: 239102
* [NVPTX] roll forward r239082Jingyue Wu2015-06-0412-158/+223
| | | | | | | | | NVPTXISelDAGToDAG translates "addrspacecast to param" to NVPTX::nvvm_ptr_gen_to_param Added an llc test in bug21465. llvm-svn: 239100
* Simplify ARMTargetParser::getArchSynonymArtyom Skrobov2015-06-042-12/+10
| | | | | | | | | | | | | | | | Summary: 1) The only caller, ARMTargetParser::parseArch, uses the results for an "endswith" test; so, including the "arm" prefix into the result is unnecessary. 2) Most ARMTargetParser::parseArch callers pass it the output from ARMTargetParser::getCanonicalArchName; so, make this behaviour the default. Then, including the "arm" prefix into the cases is unnecessary. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10249 llvm-svn: 239099
* [Hexagon] Removing unused variable.Colin LeMahieu2015-06-041-1/+0
| | | | llvm-svn: 239097
* [MachOWriter] Use for-range and roll some duplicated code into loops.Benjamin Kramer2015-06-041-43/+25
| | | | | | No functionality change intended. llvm-svn: 239096
* [Hexagon] Adding functionality for duplexing. Duplexing is a way to ↵Colin LeMahieu2015-06-0416-58/+2832
| | | | | | compress commonly used pairs of instructions in order to reduce code size. The test case duplex.ll normally would be 8 bytes, assign register to 0 and jump to link register. After duplexing this is only 4 bytes. This also tests the HexagonMCShuffler code path which is used to make sure duplexed instructions still follow slot requirements. llvm-svn: 239095
* Revert r239082Jingyue Wu2015-06-0411-215/+158
| | | | | | llc crashed for NVPTX backend llvm-svn: 239094
* Remove unused argument. NFC.Rafael Espindola2015-06-041-4/+3
| | | | llvm-svn: 239092
* Re-unique_ptrify LoadedObjectInfo::clone after it was reverted due to some ↵David Blaikie2015-06-042-3/+4
| | | | | | | | | | | | other changes that broke on GCC around the same time Apparently this functionality isn't used in-tree (or I would go & make the explicit unique_ptr constructions into implicit constructions to make them more self documenting now that clone doesn't return a raw owning pointer anymore) but only by the Julia frontend. This isn't ideal. llvm-svn: 239091
* Tidy comment. NFC.Diego Novillo2015-06-041-2/+2
| | | | llvm-svn: 239090
* Erase constant dbgloc on reuse in PHI nodeSergey Dmitrouk2015-06-042-1/+91
| | | | | | | | | | | | | | | | | | | | Basic block selection involves checking successor BBs for PHI nodes that depend on the current BB. In case such BBs are found, the value being selected is a constant and such constant already exists in current BB, it's value is reused. This might lead to wrong locations in some situations, especially if same constant value ends up being materialized twice in two different ways, which discards that sharing and leaves us with wrong debug location in the successor BB. In code this involves the following sequence of calls: SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks -> SelectionDAGBuilder::CopyValueToVirtualRegister -> SelectionDAGBuilder::getNonRegisterValue llvm-svn: 239089
* Retry defaulting the virtual dtor in LoadedObjectInfoDavid Blaikie2015-06-042-3/+1
| | | | | | | | | | | | Originally committed in r237975, GCC 4.7 gave a compilation error regarding "looser throw specification" though it seemed to be pointing to a virtual defaulted dtor in a base class and an override defaulted dtor in a derived class - so I'm not quite sure why/how they could end up with different throw specifications. To simplify and reduce the risk of this, I've just removed the pointless override in the derived class, the base class's should be sufficient. *fingers crossed* llvm-svn: 239088
* [GlobalMerge] Take into account minsize on Global users' parents.Ahmed Bougacha2015-06-045-11/+113
| | | | | | | | | | Now that we can look at users, we can trivially do this: when we would have otherwise disabled GlobalMerge (currently -O<3), we can just run it for minsize functions, as it's usually a codesize win. Differential Revision: http://reviews.llvm.org/D10054 llvm-svn: 239087
* [docs] Document "LGTM" in the lexicon.Sean Silva2015-06-041-0/+4
| | | | llvm-svn: 239085
* MC: Remove obsolete MachO UseAggressiveSymbolFolding.Jim Grosbach2015-06-049-81/+28
| | | | | | | | | | Fix the FIXME and remove this old as(1) compat option. It was useful for bringup of the integrated assembler to diff object files, but now it's just causing more relocations than strictly necessary to be generated. rdar://21201804 llvm-svn: 239084
* Having another go at some simple cleanup from r237975/r237976David Blaikie2015-06-041-1/+0
| | | | | | | | | | | I made a few changes here in a couple of commits - breaking them out into smaller ones in case I hit the GCC oddities again. I'm still not /entirely/ sure what the issues were, so apologies if any of these experiments break things again. Feel free to revert immediately. llvm-svn: 239083
* [NVPTX] kernel pointer arguments point to the global address spaceJingyue Wu2015-06-0411-158/+215
| | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch, NVPTXLowerKernelArgs converts a kernel pointer argument to a pointer in the global address space. This change, along with NVPTXFavorNonGenericAddrSpaces, allows the NVPTX backend to emit ld.global.* and st.global.* for accessing kernel pointer arguments. Minor changes: 1. refactor: extract function convertToPointerInAddrSpace 2. fix a bug in the test case in bug21465.ll Test Plan: lower-kernel-ptr-arg.ll Reviewers: eliben, meheff, jholewinski Reviewed By: jholewinski Subscribers: wengxt, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D10154 llvm-svn: 239082
* [Object, MachO] Don't crash on invalid MachO segment load commands.Alexey Samsonov2015-06-044-13/+23
| | | | | | | | | | | | | | | Summary: Properly report the error in segment load commands from MachOObjectFile constructor instead of crashing the program. Adjust the test case accordingly. Test Plan: regression test suite Reviewers: rafael, filcab Subscribers: llvm-commits llvm-svn: 239081
* [Object, MachO] Don't crash on invalid MachO load commands.Alexey Samsonov2015-06-044-11/+28
| | | | | | | | | | | | | | | Summary: Currently all load commands are parsed in MachOObjectFile constructor. If the next load command cannot be parsed, or if command size is too small, properly report it through the error code and fail to construct the object, instead of crashing the program. Test Plan: regression test suite Reviewers: rafael, filcab Subscribers: llvm-commits llvm-svn: 239080
* [MC] Allowing operands to be erased from MCInst.Colin LeMahieu2015-06-041-3/+3
| | | | llvm-svn: 239079
* [Object, MachO] Don't crash on parsing invalid MachO header.Alexey Samsonov2015-06-043-4/+32
| | | | | | | | | | | Summary: Instead, properly report this error from MachOObjectFile constructor. Test Plan: regression test suite Reviewers: rafael Subscribers: llvm-commits llvm-svn: 239078
* [Object, MachO] Remove some code duplication. NFC.Alexey Samsonov2015-06-042-29/+25
| | | | llvm-svn: 239077
* [CMake] Fixing the check for NinjaChris Bieneman2015-06-041-2/+2
| | | | | | Enabling Ninja Job Pools needs to be dependent on the CMAKE_MAKE_PROGRAM not the CMAKE_GENERATOR. There are generators (like "Sublime Text 2 - Ninja") that also generate ninja build files. Basing of the CMAKE_MAKE_PROGRAM is the best future-proof way to handle this. llvm-svn: 239076
* [Object, MachO] Cache parsed MachO header in MachOObjectFile. NFC.Alexey Samsonov2015-06-042-22/+23
| | | | | | | | | | | | | | | Summary: Avoid parsing object file each time MachOObjectFile::getHeader() is called. Instead, cache the header in MachOObjectFile constructor, where it's parsed anyway. In future, we must avoid constructing the object at all if the header can't be parsed. Test Plan: regression test suite. Reviewers: rafael Subscribers: llvm-commits llvm-svn: 239075
* Fix buildbot failure on Windows by relaxing test expectations.Alexey Samsonov2015-06-041-1/+2
| | | | llvm-svn: 239074
* [bpf] add big- and host- endian supportAlexei Starovoitov2015-06-0425-72/+271
| | | | | | | | | | | | | | | | | | | Summary: -march=bpf -> host endian -march=bpf_le -> little endian -match=bpf_be -> big endian Test Plan: v1 was tested by IBM s390 guys and appears to be working there. It bit rots too fast here. Reviewers: chandlerc, tstellarAMD Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10177 llvm-svn: 239071
* [DAGCombiner] Fix wrong folding of a build_vector into a blend with zero.Andrea Di Biagio2015-06-042-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Method 'visitBUILD_VECTOR' in the DAGCombiner knows how to combine a build_vector of a bunch of extract_vector_elt nodes and constant zero nodes into a shuffle blend with a zero vector. However, method 'visitBUILD_VECTOR' forgot that a floating point build_vector may contain negative zero as well as positive zero. Example: define <2 x double> @example(<2 x double> %A) { entry: %0 = extractelement <2 x double> %A, i32 0 %1 = insertelement <2 x double> undef, double %0, i32 0 %2 = insertelement <2 x double> %1, double -0.0, i32 1 ret <2 x double> %2 } Before this patch, llc (with -mattr=+sse4.1) wrongly generated movq %xmm0, %xmm0 # xmm0 = xmm0[0],zero So, the sign bit of the negative zero was effectively lost. This patch fixes the problem by adding explicit checks for positive zero. With this patch, llc produces the following code for the example above: movhpd .LCPI0_0(%rip), %xmm0 where .LCPI0_0 referes to a 'double -0'. llvm-svn: 239070
* Fix the check for Ninja in the CMake build.Evgeniy Stepanov2015-06-041-2/+2
| | | | | | | | | | The current check never passes, because CMAKE_MAKE_PROGRAM, at least on Linux, includes the full path to the "ninja" binary; this effectively disables compile/link jobs pools. Use CMAKE_GENERATOR STREQUAL "Ninja" as a more reliable check. llvm-svn: 239069
* Make test case more readable: move CHECK-lines next to corresponding RUN-lines.Alexey Samsonov2015-06-041-8/+6
| | | | llvm-svn: 239068
* llvm-objdump: return non-zero exit code for certain cases of invalid inputAlexey Samsonov2015-06-042-7/+17
| | | | | | | | * If the input file is missing; * If the type of input object file can't be recognized; * If the object file can't be parsed correctly. llvm-svn: 239065
* [APInt] Remove special case for i1.Benjamin Kramer2015-06-042-3/+8
| | | | | | Add a unit test. llvm-svn: 239062
* Test commit access.Gabor Ballabas2015-06-041-1/+1
| | | | | | Fix trailing whitespace. llvm-svn: 239058
* [SDag switch lowering] Simplify code a bit. No functional change intended.Benjamin Kramer2015-06-041-10/+9
| | | | llvm-svn: 239056
* R600/SI: Reimplement isLegalAddressingModeMatt Arsenault2015-06-043-31/+312
| | | | | | | | | | | Now that we sometimes know the address space, this can theoretically do a better job. This needs better test coverage, but this mostly depends on first updating the loop optimizatiosn to provide the address space. llvm-svn: 239053
* CodeGenPrepare: Provide address space to isLegalAddressingModeMatt Arsenault2015-06-042-27/+44
| | | | | | Use -1 as the address space if it can't be determined. llvm-svn: 239052
OpenPOWER on IntegriCloud