summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
* Dont emit Mapping symbols for sections that contain only data.Weiming Zhao2017-03-282-0/+2
| | | | | | | | | | | | | | | | | Summary: Dont emit mapping symbols for sections that contain only data. Patched by Shankar Easwaran <shankare@codeaurora.org> Reviewers: rengolin, peter.smith, weimingz, kparzysz, t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, llvm-commits Differential Revision: https://reviews.llvm.org/D30724 llvm-svn: 298901
* [APInt] Use 'unsigned' instead of 'unsigned int' in the interface to the ↵Craig Topper2017-03-281-29/+26
| | | | | | APInt tc functions. This is more consistent with the rest of the codebase. NFC llvm-svn: 298897
* MachineScheduler/ScheduleDAG: Add support for GetSubGraphValery Pykhtin2017-03-281-0/+8
| | | | | | | | Patch by Axel Davy (axel.davy@normalesup.org) Differential revision: https://reviews.llvm.org/D30626 llvm-svn: 298896
* [APInt] Move the single word cases of the bitwise operators inline.Craig Topper2017-03-281-3/+33
| | | | llvm-svn: 298894
* Revert "[asan] Delay creation of asan ctor."Alex Shlyapnikov2017-03-271-3/+0
| | | | | | | | Speculative revert. Some libfuzzer tests are affected. This reverts commit r298731. llvm-svn: 298890
* Improve machine schedulers for in-order processorsJaved Absar2017-03-272-0/+11
| | | | | | | | | | | This patch enables schedulers to specify instructions that cannot be issued with any other instructions. It also fixes BeginGroup/EndGroup. Reviewed by: Andrew Trick Differential Revision: https://reviews.llvm.org/D30744 llvm-svn: 298885
* Add the error handling for Mach-O dyld compact lazy bind, weak bind andKevin Enderby2017-03-271-5/+19
| | | | | | | | | | | | | | | | | | | | | rebase entry errors and test cases for each of the error checks. Also verified with Nick Kledzik that a BIND_OPCODE_SET_ADDEND_SLEB opcode is legal in a lazy bind table, so code that had that as an error check was removed. With MachORebaseEntry and MachOBindEntry classes now returning an llvm::Error in all cases for malformed input the variables Malformed and logic to set use them is no longer needed and has been removed from those classes. Also in a few places, removed the redundant Done assignment to true when also calling moveToEnd() as it does that assignment. This only leaves the dyld compact export entries left to have error handling yet to be added for the dyld compact info. llvm-svn: 298883
* [APInt] Move operator=(uint64_t) inline as its pretty simple and is often ↵Craig Topper2017-03-271-1/+10
| | | | | | | | used with small constants that the compiler can optimize. While there recognize that we only need to clearUnusedBits on the single word case. llvm-svn: 298881
* [APInt] Move operator&=(uint64_t) inline and use memset to clear the upper ↵Craig Topper2017-03-271-1/+9
| | | | | | | | words. This method is pretty new and probably isn't use much in the code base so this should have a negligible size impact. The OR and XOR operators are already inline. llvm-svn: 298870
* [APInt] Use memset in setAllBits.Craig Topper2017-03-271-4/+2
| | | | llvm-svn: 298867
* [APInt] Move the >64 bit case for flipAllBits out of line.Craig Topper2017-03-271-5/+7
| | | | | | This is more consistent with what we do for other operations. This shrinks the opt binary on my build by ~72k. llvm-svn: 298858
* [GlobalISel] Add a 'getConstantVRegVal' helper.Ahmed Bougacha2017-03-271-0/+4
| | | | | | Use it to compare immediate operands. llvm-svn: 298855
* ADT: Add range helpers for pointer_ and pointee_iteratorJustin Bogner2017-03-271-0/+19
| | | | llvm-svn: 298841
* [IR] Implement pairs of non-const and const methods using the const version ↵Craig Topper2017-03-277-50/+74
| | | | | | | | instead of the non-const version. NFCI This removes a const_cast of the this pointer. llvm-svn: 298831
* [IR] Share implementation for pairs of const and non-const methods using ↵Craig Topper2017-03-272-3/+12
| | | | | | const_cast. NFCI llvm-svn: 298830
* [IR] Share implementation of pairs of const and non-const methods in ↵Craig Topper2017-03-271-36/+48
| | | | | | | | | | | | | | | | | | | BasicBlock using the const version instead of the non-const version Summary: During post-commit review of a previous change I made it was pointed out that const casting 'this' is technically a bad practice. This patch re-implements all of the methods in BasicBlock that do this to use the const BasicBlock version and const_cast the return value instead. I think there are still many other classes that do similar things. I may look at more in the future. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31377 llvm-svn: 298827
* [IR] Make Instruction::isAssociative method inline. Add LLVM_READONLY to the ↵Craig Topper2017-03-261-2/+5
| | | | | | static version. llvm-svn: 298826
* Fix typo in comment; NFCSanjoy Das2017-03-261-1/+1
| | | | llvm-svn: 298819
* Fix signed/unsigned comparison warnings.Simon Pilgrim2017-03-261-1/+1
| | | | llvm-svn: 298813
* [IR] Switch to more normal template parameter names ending in `T`Chandler Carruth2017-03-261-10/+10
| | | | | | | | | instead of `Ty`. The `Ty` suffix is much more commonly used for LLVM `Type` variable names, so this seemed like a particularly confusing collision. llvm-svn: 298808
* Fix signed/unsigned comparison warnings.Simon Pilgrim2017-03-261-2/+2
| | | | llvm-svn: 298807
* Fix MSVC signed/unsigned comparison warnings.Simon Pilgrim2017-03-261-6/+9
| | | | llvm-svn: 298804
* Split the SimplifyCFG pass into two variants.Joerg Sonnenberger2017-03-266-4/+21
| | | | | | | | | | | | | | | | | | | | | | | The first variant contains all current transformations except transforming switches into lookup tables. The second variant contains all current transformations. The switch-to-lookup-table conversion results in code that is more difficult to analyze and optimize by other passes. Most importantly, it can inhibit Dead Code Elimination. As such it is often beneficial to only apply this transformation very late. A common example is inlining, which can often result in range restrictions for the switch expression. Changes in execution time according to LNT: SingleSource/Benchmarks/Misc/fp-convert +3.03% MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20% MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43% and a couple of smaller changes. For perimeter it also results 2.6% a smaller binary. Differential Revision: https://reviews.llvm.org/D30333 llvm-svn: 298799
* [IR] Make SwitchInst::CaseIt almost a normal iterator.Chandler Carruth2017-03-261-31/+29
| | | | | | | | | | | | | | | | | | | | | | | | | This moves it to the iterator facade utilities giving it full random access semantics, etc. It can also now be used with standard algorithms like std::all_of and std::any_of and range adaptors like llvm::reverse. Also make the semantics of iterating match what every other iterator uses and forbid decrementing past the begin iterator. This was used as a hacky way to work around iterator invalidation. However, every instance trying to do this failed to actually avoid touching invalid iterators despite the clear documentation that the removed and all subsequent iterators become invalid including the end iterator. So I've added a return of the next iterator to removeCase and rewritten the loops that were doing this to correctly follow the iterator pattern of either incremneting or removing and assigning fresh values to the iterator and the end. In one case we were trying to go backwards to make this cleaner but it doesn't actually work. I've made that code match the code we use everywhere else to remove cases as we iterate. This changes the order of cases in one test output and I moved that test to CHECK-DAG so it wouldn't care -- the order isn't semantically meaningful anyways. llvm-svn: 298791
* Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonlyEric Christopher2017-03-251-7/+7
| | | | | | | | so that we can perform some optimizations across it. Fixes PR32365 llvm-svn: 298781
* [x86] use PMOVMSK to replace memcmp libcalls for 16-byte equalitySanjay Patel2017-03-251-0/+9
| | | | | | | | | This is the payoff for D31156 - if a target has efficient comparison instructions for vector-sized equality, we can replace memcmp calls with inline code that is both smaller and faster. Differential Revision: https://reviews.llvm.org/D31290 llvm-svn: 298775
* Revert r298711 "[InstCombine] Provide a way to calculate KnownZero/One for ↵Craig Topper2017-03-241-5/+0
| | | | | | | | Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits" Tsan bot is failing. llvm-svn: 298745
* Move spill size and alignment info from MC to TargetRegisterInfoKrzysztof Parzyszek2017-03-242-10/+8
| | | | | | | | | | | | This is another step towards implementing register classes with parametrized register/spill sizes and value types. This is an updated version of r298652. The difference is that MCRegister- Class still contains register size, available as getPhysRegSize(). The old function getSize was retained as a temporary measure to avoid build breakage for out-of-tree targets. llvm-svn: 298739
* [asan] Delay creation of asan ctor.Evgeniy Stepanov2017-03-241-0/+3
| | | | | | | | | Create the constructor in the module pass. This in needed for the GC-friendly globals change, where the constructor can be put in a comdat in some cases, but we don't know about that in the function pass. llvm-svn: 298731
* AMDGPU: Unify divergent function exits.Matt Arsenault2017-03-241-0/+3
| | | | | | | | | | StructurizeCFG can't handle cases with multiple returns creating regions with multiple exits. Create a copy of UnifyFunctionExitNodes that only unifies exit nodes that skips exit nodes with uniform branch sources. llvm-svn: 298729
* Revert r298652 on Quentin's requestKrzysztof Parzyszek2017-03-242-3/+11
| | | | llvm-svn: 298727
* TTI: Split IsSimple in MemIntrinsicInfoMatt Arsenault2017-03-241-13/+16
| | | | | | All this did before was assert in EarlyCSE. llvm-svn: 298724
* [PDB] Split item and type records when merging type streamsReid Kleckner2017-03-241-2/+3
| | | | | | | | | | | | Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
* [InstCombine] Provide a way to calculate KnownZero/One for Add/Sub in ↵Craig Topper2017-03-241-0/+5
| | | | | | | | SimplifyDemandedUseBits without recursing into ComputeKnownBits SimplifyDemandedUseBits for Add/Sub already recursed down LHS and RHS for simplifying bits. If that didn't provide any simplifications we fall back to calling computeKnownBits which will recurse again. Instead just take the known bits for LHS and RHS we already have and call into a new function in ValueTracking that can calculate the known bits given the LHS/RHS bits. llvm-svn: 298711
* Don't build up std::vectors with constant sizes when an array suffices.Benjamin Kramer2017-03-241-2/+1
| | | | | | NFC. llvm-svn: 298701
* Remove stale and unused (MC)TargetOptions comparators.Teresa Johnson2017-03-242-62/+0
| | | | | | | | | | | | | | | | | Summary: I discovered accidentally that the operator== for TargetOptions is stale - it is missing many fields that have been added over the recent years. It isn't used, so remove it. Ditto for the comparator in MCTargetOptions, which doesn't seem stale yet but is unused. Reviewers: echristo Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D31301 llvm-svn: 298700
* Revert "[ScalarEvolution] Re-enable Predicate implication from operations"Max Kazantsev2017-03-241-17/+0
| | | | | | | | This reverts commit rL298690 Causes failures on clang. llvm-svn: 298693
* [ScalarEvolution] Re-enable Predicate implication from operationsMax Kazantsev2017-03-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | The patch rL298481 was reverted due to crash on clang-with-lto-ubuntu build. The reason of the crash was type mismatch between either a or b and RHS in the following situation: LHS = sext(a +nsw b) > RHS. This is quite rare, but still possible situation. Normally we need to cast all {a, b, RHS} to their widest type. But we try to avoid creation of new SCEV that are not constants to avoid initiating recursive analysis that can take a lot of time and/or cache a bad value for iterations number. To deal with this, in this patch we reject this case and will not try to analyze it if the type of sum doesn't match with the type of RHS. In this situation we don't need to create any non-constant SCEVs. This patch also adds an assertion to the method IsProvedViaContext so that we could fail on it and not go further into range analysis etc (because in some situations these analyzes succeed even when the passed arguments have wrong types, what should not normally happen). The patch also contains a fix for a problem with too narrow scope of the analysis caused by wrong usage of predicates in recursive invocations. The regression test on the said failure: test/Analysis/ScalarEvolution/implied-via-addition.ll llvm-svn: 298690
* Set the prof weight correctly for call instructions in DeadArgumentElimination.Dehao Chen2017-03-231-0/+3
| | | | | | | | | | | | | | Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile. Reviewers: eraman Reviewed By: eraman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31143 llvm-svn: 298660
* Use isFunctionHotInCallGraph to set the function section prefix.Dehao Chen2017-03-231-0/+4
| | | | | | | | | | | | | | Summary: The current prefix based function layout algorithm only looks at function's entry count, which is not sufficient. A function should be grouped together if its entry count or any call edge count is hot. Reviewers: davidxl, eraman Reviewed By: eraman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31225 llvm-svn: 298656
* Move spill size and alignment info from MC to TargetRegisterInfoKrzysztof Parzyszek2017-03-232-11/+3
| | | | | | | | | This is another step towards implementing register classes with parametrized register/spill sizes. Differential Revision: https://reviews.llvm.org/D31299 llvm-svn: 298652
* [PDB] Use two DBs when dumping the IPI streamReid Kleckner2017-03-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dumping these records from an object file section, we should use only one type database. However, when dumping from a PDB, we should use two: one for the type stream and one for the IPI stream. Certain type records that normally live in the .debug$T object file section get moved over to the IPI stream of the PDB file and they get new indices. So far, I've noticed that the MSVC linker always moves these records into IPI: - LF_FUNC_ID - LF_MFUNC_ID - LF_STRING_ID - LF_SUBSTR_LIST - LF_BUILDINFO - LF_UDT_MOD_SRC_LINE These records have index fields that can point into TPI or IPI. In particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID records to describe compilation command lines. I've modified the dumper to have an optional pointer to the item DB, and to do type name lookup of these fields in that DB. See printItemIndex. The result is that our pdbdump-headers.test is more faithful to the PDB contents and the output is less confusing. Reviewers: ruiu Subscribers: amccarth, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D31309 llvm-svn: 298649
* Remove unnecessary use of std::result_of, which is deprecated in C++17.Richard Smith2017-03-231-3/+2
| | | | llvm-svn: 298645
* LLVM Changes for alloc_alignErich Keane2017-03-231-17/+60
| | | | | | | | | | GCC has the alloc_align attribute, which is similar to assume_aligned, except the attribute's parameter is the index of the integer parameter that needs aligning to. This is the required LLVM changes to make this happen. Differential Revision: https://reviews.llvm.org/D29598 llvm-svn: 298643
* [ThinLTO] Add support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-233-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The cumulative size of the bitcode files for a very large application can be huge, particularly with -g. In a distributed build environment, all of these files must be sent to the remote build node that performs the thin link step, and this can exceed size limits. The thin link actually only needs the summary along with a bitcode symbol table. Until we have a proper bitcode symbol table, simply stripping the debug metadata results in significant size reduction. Add support for an option to additionally emit minimized bitcode modules, just for use in the thin link step, which for now just strips all debug metadata. I plan to add a cc1 option so this can be invoked easily during the compile step. However, care must be taken to ensure that these minimized thin link bitcode files produce the same index as with the original bitcode files, as these original bitcode files will be used in the backends. Specifically: 1) The module hash used for caching is typically produced by hashing the written bitcode, and we want to include the hash that would correspond to the original bitcode file. This is because we want to ensure that changes in the stripped portions affect caching. Added plumbing to emit the same module hash in the minimized thin link bitcode file. 2) The module paths in the index are constructed from the module ID of each thin linked bitcode, and typically is automatically generated from the input file path. This is the path used for finding the modules to import from, and obviously we need this to point to the original bitcode files. Added gold-plugin support to take a suffix replacement during the thin link that is used to override the identifier on the MemoryBufferRef constructed from the loaded thin link bitcode file. The assumption is that the build system can specify that the minimized bitcode file has a name that is similar but uses a different suffix (e.g. out.thinlink.bc instead of out.o). Added various tests to ensure that we get identical index files out of the thin link step. Reviewers: mehdi_amini, pcc Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31027 llvm-svn: 298638
* Somehow this still breaks because of ANSI color codes in test output on Linux.Adrian McCarthy2017-03-232-40/+1
| | | | | | | | | | Reverting until I can figure out the root cause. Revert "Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]" This reverts commit f461a70cc376f0f91c8b4917be79479cc86330a5. llvm-svn: 298626
* Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-232-1/+40
| | | | | | | | | | | | | | The new test should pass on all platforms now that llvm-pdbdump has the `-color-output` option. This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Original Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 298623
* [IR] Use a binary search in DataLayout::getAlignmentInfoCraig Topper2017-03-231-2/+13
| | | | | | | | | | | | | | | | | | | | | Summary: We currently do a linear scan through all of the Alignments array entries anytime getAlignmentInfo is called. I noticed while profiling compile time on a -O2 opt run that this function can be called quite frequently and was showing about as about 1% of the time in callgrind. This patch puts the Alignments array into a sorted order by type and then by bitwidth. We can then do a binary search. And use the sorted nature to handle the special cases for INTEGER_ALIGN. Some of this is modeled after the sorting/searching we do for pointers already. This reduced the time spent in this routine by about 2/3 in the one compilation I was looking at. We could maybe improve this more by using a DenseMap to cache the results, but just sorting was easy and didn't require extra data structure. And I think it made the integer handling simpler. Reviewers: sanjoy, davide, majnemer, resistor, arsenm, mehdi_amini Reviewed By: arsenm Subscribers: arsenm, llvm-commits Differential Revision: https://reviews.llvm.org/D31232 llvm-svn: 298579
* [IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.Craig Topper2017-03-231-2/+2
| | | | llvm-svn: 298578
* [codeview] Move type index remapping logic to type mergerReid Kleckner2017-03-231-127/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: This removes the 'remapTypeIndices' method on every TypeRecord class. My original idea was that this would be the beginning of some kind of generic entry point that would enumerate all of the TypeIndices inside of a TypeRecord, so that we could write generic graph algorithms for them without duplicating the knowledge of which fields are type index fields everywhere. This never happened, and nothing else uses this method. I need to change the API to deal with merging into IPI streams, so let's move it into the file that uses it first. Reviewers: zturner, ruiu Reviewed By: zturner, ruiu Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31267 llvm-svn: 298564
OpenPOWER on IntegriCloud