summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
* DCE math library calls with a constant operand.Eli Friedman2016-11-021-0/+5
| | | | | | | | | | | On platforms which use -fmath-errno, math libcalls without any uses require some extra checks to figure out if they are actually dead. Fixes https://llvm.org/bugs/show_bug.cgi?id=30464 . Differential Revision: https://reviews.llvm.org/D25970 llvm-svn: 285857
* [lli/COFF] Set the correct alignment for common symbolsDavide Italiano2016-11-021-0/+1
| | | | | | | | | | Otherwise we set it always to zero, which is not correct, and we assert inside alignTo (Assertion failed: Align != 0u && "Align can't be 0."). Differential Revision: https://reviews.llvm.org/D26173 llvm-svn: 285841
* Fix build due to missing definition.Zachary Turner2016-11-021-1/+1
| | | | llvm-svn: 285837
* Add CodeViewRecordIO for reading and writing.Zachary Turner2016-11-026-504/+409
| | | | | | | | | | | | | | | Using a pattern similar to that of YamlIO, this allows us to have a single codepath for translating codeview records to and from serialized byte streams. The current patch only hooks this up to the reading of CodeView type records. A subsequent patch will hook it up for writing of CodeView type records, and then a third patch will hook up the reading and writing of CodeView symbols. Differential Revision: https://reviews.llvm.org/D26040 llvm-svn: 285836
* [ARM][MC] Cleanup ARM Target Assembly ParserNirav Dave2016-11-021-1/+22
| | | | | | | | | | | | | | Summary: Correctly parse end-of-statement tokens and handle preprocessor end-of-line comments in ARM assembly processor. Reviewers: rnk, majnemer Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D26152 llvm-svn: 285830
* Simplify control flow in the the DWARF expression compilerAdrian Prantl2016-11-021-0/+2
| | | | | | by refactoring common code into a DwarfExpressionCursor wrapper. llvm-svn: 285827
* Simplify typedefs. NFC.Rafael Espindola2016-11-021-15/+14
| | | | llvm-svn: 285819
* Inline a version of getSectionStringTable into the only use.Rafael Espindola2016-11-021-10/+4
| | | | llvm-svn: 285817
* Compute the section table lazily.Rafael Espindola2016-11-021-55/+52
| | | | | | As a consequence this move a bunch of error checking out of the constructor. llvm-svn: 285815
* Inline getSectionStringTableIndex() into only caller. NFC.Rafael Espindola2016-11-021-9/+3
| | | | llvm-svn: 285812
* Avoid a report_fatal_error in sections().Rafael Espindola2016-11-022-19/+14
| | | | | | | Have it return a ErrorOr<Range> and delete section_begin and section_end. llvm-svn: 285807
* getNumSections should return a uintX_t. NFC.Rafael Espindola2016-11-021-4/+3
| | | | llvm-svn: 285804
* Simplify getSection. NFC.Rafael Espindola2016-11-021-4/+3
| | | | llvm-svn: 285803
* [Reassociate] Skip analysis of dead code to avoid infinite loop.Bjorn Pettersson2016-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: It was detected that the reassociate pass could enter an inifite loop when analysing dead code. Simply skipping to analyse basic blocks that are dead avoids such problems (and as a side effect we avoid spending time on optimising dead code). The solution is using the same Reverse Post Order ordering of the basic blocks when doing the optimisations, as when building the precalculated rank map. A nice side-effect of this solution is that we now know that we only try to do optimisations for blocks with ranked instructions. Fixes https://llvm.org/bugs/show_bug.cgi?id=30818 Reviewers: llvm-commits, davide, eli.friedman, mehdi_amini Subscribers: dberlin Differential Revision: https://reviews.llvm.org/D26154 llvm-svn: 285793
* Bitcode: Fix short read implementation.Peter Collingbourne2016-11-021-1/+1
| | | | | | | We need to zero extend the byte in order to correctly shift it into a 64-bit value. llvm-svn: 285785
* Disable the use of std::call_once on OpenBSD with libstdc++.Brad Smith2016-11-021-5/+5
| | | | | | | | | | | It was noticed this caused performance regressions and deadlocks. PR30768. Reorder the code to make it clearer what is tested. PPC now disables the use of std::call_once only with libstdc++ with the reordering of the code, as was the original intent. llvm-svn: 285782
* [ilist_node] Add a getReverseIterator() method and a unittest for it.Michael Gottesman2016-11-021-0/+6
| | | | | | This is the reverse_iterator analogue of getIterator(). llvm-svn: 285780
* Support: Remove MemoryObject and DataStreamer interfaces.Peter Collingbourne2016-11-023-193/+0
| | | | | | | | These interfaces are no longer used. Differential Revision: https://reviews.llvm.org/D26222 llvm-svn: 285774
* Bitcode: Change reader interface to take memory buffers.Peter Collingbourne2016-11-022-81/+36
| | | | | | | | | | | | | | | | | | | As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html This change also fixes an API oddity where BitstreamCursor::Read() would return zero for the first read past the end of the bitstream, but would report_fatal_error for subsequent reads. Now we always report_fatal_error for all reads past the end. Updated clients to check for the end of the bitstream before reading from it. I also needed to add padding to the invalid bitcode tests in test/Bitcode/. This is because the streaming interface was not checking that the file size is a multiple of 4. Differential Revision: https://reviews.llvm.org/D26219 llvm-svn: 285773
* Don't compute DotShstrtab eagerly.Rafael Espindola2016-11-011-18/+27
| | | | | | | This saves a field that is not always used. It also avoids failing a program that doesn't need the section names. llvm-svn: 285753
* [MemorySSA] Tighten up types to make our API prettier. NFC.George Burgess IV2016-11-011-7/+7
| | | | | | | | Patch by bryant. Differential Revision: https://reviews.llvm.org/D26126 llvm-svn: 285750
* Simplify getStringTableIndex.Rafael Espindola2016-11-011-10/+5
| | | | | | | | | | | | | | | | The description in the ELF spec is just --------------------------- If the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00), this member has the value SHN_XINDEX (0xffff) and the actual index of the section name string table section is contained in the sh_link field of the section header at index 0. --------------------------- So we only have to check for it being SHN_XINDEX. Also, sh_link is always 32 bits, so don't return an uintX_t. llvm-svn: 285747
* Use the existing std::error_code out parameter.Rafael Espindola2016-11-011-3/+4
| | | | | | This avoids calling exit with a partially constructed object. llvm-svn: 285738
* [RISCV] Add RISCV.def to module.modulemapAlex Bradbury2016-11-011-0/+1
| | | | llvm-svn: 285730
* [RISCV] Add missing RISCV.defAlex Bradbury2016-11-011-0/+50
| | | | | | Fix rL285708 llvm-svn: 285709
* [RISCV] Add RISC-V ELF definesAlex Bradbury2016-11-012-0/+19
| | | | | | | | | | Add the necessary definitions for RISC-V ELF files, including relocs. Also make necessary trivial change to ELFYaml, llvm-objdump, and llvm-readobj in order to work with RISC-V ELFs. Differential Revision: https://reviews.llvm.org/D23557 llvm-svn: 285708
* [RISCV] Recognise riscv32 and riscv64 in triple parsing codeAlex Bradbury2016-11-011-0/+2
| | | | | | | | | | | This is the first in a series of 10 initial patches that incrementally add an MC layer for RISC-V to LLVM. See <http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html> for more discussion. Differential Revision: https://reviews.llvm.org/D23557 llvm-svn: 285707
* [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.hAlex Bradbury2016-11-011-0/+6
| | | | | | | | | | | | | | | As it stands, the OperandMatchResultTy is only included in the generated header if there is custom operand parsing. However, almost all backends make use of MatchOperand_Success and friends from OperandMatchResultTy for e.g. parseRegister. This is a pain when starting an AsmParser for a new backend that doesn't yet have custom operand parsing. Move the enum to MCTargetAsmParser.h. This patch is a prerequisite for D23563 Differential Revision: https://reviews.llvm.org/D23496 llvm-svn: 285705
* [PowerPC] Implement vector shift builtins - llvm portionNemanja Ivanovic2016-11-011-0/+2
| | | | | | | This patch corresponds to review https://reviews.llvm.org/D26095. Committing on behalf of Tony Jiang. llvm-svn: 285681
* Allow resolving response file names relative to including fileSerge Pavlov2016-11-011-1/+3
| | | | | | | | | | | | | | If a response file included by construct @file itself includes a response file and that file is specified by relative file name, current behavior is to resolve the name relative to the current working directory. The change adds additional flag to ExpandResponseFiles that may be used to resolve nested response file names relative to including file. With the new mode a set of related response files may be kept together and reference each other with short position independent names. Differential Revision: https://reviews.llvm.org/D24917 llvm-svn: 285675
* Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.Peter Collingbourne2016-11-011-2/+2
| | | | | | | | | | | No block info block should need to define local abbreviations, so we can always use a code width of 2. Also change all block info block writers to use EnterBlockInfoBlock. Differential Revision: https://reviews.llvm.org/D26168 llvm-svn: 285660
* Remove llc -jump-table-type option, it hasn't been functional for years.Joerg Sonnenberger2016-10-312-21/+1
| | | | llvm-svn: 285633
* [PPC] add absolute difference altivec instructions and matching intrinsicsNemanja Ivanovic2016-10-311-0/+5
| | | | | | | This patch corresponds to review https://reviews.llvm.org/D26072. Committing on behalf of Sean Fertile. llvm-svn: 285627
* DebugInfo: make DW_TAG_atomic_type validVictor Leschuk2016-10-311-0/+1
| | | | | | | | | | | | | | DW_TAG_atomic_type was already included in Dwarf.defs and emitted correctly, however Verifier didn't recognize it as valid. Thus we introduce the following changes: * Make DW_TAG_atomic_type valid tag for IR and DWARF (enabled only with -gdwarf-5) * Add it to related docs * Add DebugInfo tests Differential Revision: https://reviews.llvm.org/D26144 llvm-svn: 285624
* GlobalISel: translate stack protector intrinsicsTim Northover2016-10-311-0/+10
| | | | llvm-svn: 285614
* Define DbiStreamBuilder::addSectionMap.Rui Ueyama2016-10-311-0/+10
| | | | | | | | | | | | | This change enables LLD to construct a Section Map stream in a PDB file. I do not understand all these fields in the Section Map yet, but it seems like a copy of a COFF section header in another format. With this patch, DbiStreamBuilder can emit a Section Map which llvm-pdbdump can dump. Differential Revision: https://reviews.llvm.org/D26112 llvm-svn: 285606
* SingleLinkedListIterator::operator++(int) shouldn't return a referenceDavid Majnemer2016-10-311-1/+1
| | | | | | | | The returned reference is to a local object. Instead, make a copy. Found by PVS-Studio. llvm-svn: 285603
* Modify DWARFFormValue to remember the DWARFUnit that it was decoded with.Greg Clayton2016-10-312-11/+16
| | | | | | | | Modifying DWARFFormValue to remember the DWARFUnit that it was encoded with can simplify the usage of instances of this class. Previously users would have to try and pass in the same DWARFUnit that was used to decode the form value and there was a possibility that a different DWARFUnit might be supplied to the functions that extract values (strings, CU relative references, addresses) and cause problems. This fixes this potential issue by storing the DWARFUnit inside the DWARFFormValue so that this mistake can't be made. Instances of DWARFFormValue are not stored permanently and are used as temporary values, so the increase in size of an instance of DWARFFormValue isn't a big deal. This makes decoding form values more bullet proof and is a change that will be used by future modifications. https://reviews.llvm.org/D26052 llvm-svn: 285594
* Recommit r285285 - [Object/ELF] - Fixed behavior when ↵George Rimar2016-10-311-0/+6
| | | | | | | | | | | | | | | | | | SectionHeaderTable->sh_size is too large. with fix: edited invalid-section-index2.elf input to pass the new check and fail on the same place it was intended to fail. Original commit message: Elf.h already has code checking that section table does not go past end of file. Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize because of calculation overflow. Parch fixes the issue. Differential revision: https://reviews.llvm.org/D25432 llvm-svn: 285586
* Add getOffset to ELFSectionRefEugene Leviant2016-10-311-0/+11
| | | | | | Differential revision: https://reviews.llvm.org/D26074 llvm-svn: 285558
* [ThinLTO] Use per-summary flag to prevent exporting locals used in inline asmTeresa Johnson2016-10-302-5/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Instead of using the workaround of suppressing the entire index for modules that call inline asm that may reference locals, use the NoRename flag on the summary for any locals in the llvm.used set, and add a reference edge from any functions containing inline asm. This avoids issues from having no summaries despite the module defining global values, which was preventing more aggressive index-based optimization. It will be followed by a subsequent patch to make a similar fix for local references in module level asm (to fix PR30610). Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26121 llvm-svn: 285513
* [ThinLTO] Rename doPromoteLocalToGlobal to shouldPromoteLocalToGlobal (NFC)Teresa Johnson2016-10-291-1/+1
| | | | | | Rename as suggested in code review for D26063. llvm-svn: 285508
* [ThinLTO] Use NoPromote flag in summary during promotionTeresa Johnson2016-10-291-4/+6
| | | | | | | | | | | | | | | | Summary: Replace the check of whether a GV has a section with the flag check in the summary. This is in preparation for using the NoPromote flag to convey other situations when we can't promote (e.g. locals used in inline asm). Reviewers: mehdi_amini Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26063 llvm-svn: 285507
* [DAGCombiner] (REAPPLIED) Add vector demanded elements support to ↵Simon Pilgrim2016-10-291-3/+13
| | | | | | | | | | | | | | | | | | | | computeKnownBits Currently computeKnownBits returns the common known zero/one bits for all elements of vector data, when we may only be interested in one/some of the elements. This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original computeKnownBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1. The approach was found to be easier than trying to add a per-element known bits solution, for a similar usefulness given the combines where computeKnownBits is typically used. I've only added support for a few opcodes so far (the ones that have proven straightforward to test), all others will default to demanding all elements but can be updated in due course. DemandedElts support could similarly be added to computeKnownBitsForTargetNode in a future commit. This looked like this had caused compile time regressions on some buildbots (and was reverted in rL285381), but appears to have just been a harmless bystander! Differential Revision: https://reviews.llvm.org/D25691 llvm-svn: 285494
* Define calculateDbgStreamSize for consistency.Rui Ueyama2016-10-291-0/+1
| | | | llvm-svn: 285487
* Resubmit "Add support for advanced number formatting."Zachary Turner2016-10-291-11/+21
| | | | | | | | | | | | | This resubmits r284436 and r284437, which were reverted in r284462 as they were breaking the AArch64 buildbot. The breakage on AArch64 turned out to be a miscompile which is still not fixed, but is actively tracked at llvm.org/pr30748. This resubmission re-writes the code in a way so as to make the miscompile not happen. llvm-svn: 285483
* Refactor DW_LNE_* into Dwarf.defAdrian Prantl2016-10-282-14/+23
| | | | llvm-svn: 285475
* Refactor DW_LNS_* into Dwarf.defAdrian Prantl2016-10-282-21/+31
| | | | llvm-svn: 285474
* Refactor DW_APPLE_PROPERTY_* into Dwarf.defAdrian Prantl2016-10-282-23/+34
| | | | llvm-svn: 285473
* Refactor DW_CFA_* into Dwarf.defAdrian Prantl2016-10-282-36/+46
| | | | llvm-svn: 285472
OpenPOWER on IntegriCloud