summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* [IR] Share implementation for pairs of const and non-const methods using ↵Craig Topper2017-03-274-12/+12
| | | | | | const_cast. NFCI llvm-svn: 298830
* [IR] Share implementation of pairs of const and non-const methods in ↵Craig Topper2017-03-272-63/+75
| | | | | | | | | | | | | | | | | | | 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-262-13/+5
| | | | | | static version. llvm-svn: 298826
* [Target] Remove some code probably copy/pasted from another backend.Davide Italiano2017-03-261-4/+0
| | | | llvm-svn: 298825
* [MachineScheduler] Reference the correct header.Davide Italiano2017-03-261-1/+1
| | | | llvm-svn: 298823
* 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
* [llvm-readobj] Prefer ILT to IAT for reading COFF importsShoaib Meenai2017-03-261-6/+12
| | | | | | | | | | | | | | | | | | | | | | | We're seeing binutils ld produce binaries where the import address table's NameRVA entry is actually a VA instead (i.e. it's already base relocated), which llvm-readobj then chokes on. Both dumpbin and the Windows loader are able to handle these binaries correctly, however, and we can make llvm-readobj handle them correctly too by iterating the import lookup table (which doesn't have a relocated NameRVA) rather than the import address table. The import lookup table and the import address table are supposed to be identical on disk, and prior to r277298 the import lookup table would be used by `llvm-readobj -coff-imports` anyway, so this shouldn't have any functional change (except in the case of our malformed binaries). The import lookup table can apparently be missing when using old Borland linkers, so fall back to the import address table in that case. Resolves PR31766. Differential Revision: https://reviews.llvm.org/D31362 llvm-svn: 298812
* [LoopUnroll] Remap references in peeled iterationSerge Pavlov2017-03-262-4/+66
| | | | | | | | | References in cloned blocks must be remapped prior to dominator calculation. Differential Revision: https://reviews.llvm.org/D31281 llvm-svn: 298811
* [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
* [X86][SSE] Add computeKnownBitsForTargetNode support for (V)PSLL/(V)PSRL ↵Simon Pilgrim2017-03-262-2/+26
| | | | | | instructions llvm-svn: 298806
* [X86][AVX512F] Fix reg class for VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrkSimon Pilgrim2017-03-262-17/+16
| | | | | | | | | | Fixed -verify-machineinstrs errors in fast-isel-select-sse.ll (one of many in PR27481) The VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrk instructions were assuming both source registers were V128X when the second is actually supposed to be FR32X/FR64X Differential Revision: https://reviews.llvm.org/D31200 llvm-svn: 298805
* Fix MSVC signed/unsigned comparison warnings.Simon Pilgrim2017-03-261-6/+9
| | | | llvm-svn: 298804
* Regenerate testSimon Pilgrim2017-03-261-1/+1
| | | | llvm-svn: 298803
* Regenerate testSimon Pilgrim2017-03-261-7/+7
| | | | | | The CHECK-DAG aren't necessary and get in the way of automated checks llvm-svn: 298802
* Regenerate tests to remove duplicated checksSimon Pilgrim2017-03-261-241/+118
| | | | llvm-svn: 298801
* [GlobalISel][X86] support G_FRAME_INDEX instruction selection.Igor Breger2017-03-267-5/+110
| | | | | | | | | | | | | | | Summary: Support G_FRAME_INDEX instruction selection. Reviewers: zvi, rovka, ab, qcolombet Reviewed By: ab Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank Differential Revision: https://reviews.llvm.org/D30980 llvm-svn: 298800
* Split the SimplifyCFG pass into two variants.Joerg Sonnenberger2017-03-2617-39/+114
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add check for BSD when setting LIB_NAMES for GNU ldAndrew Wilkins2017-03-261-1/+1
| | | | | | | | Patch by Koop Mast and Alex Arslan! Differential Revision: https://reviews.llvm.org/D28215 llvm-svn: 298798
* [IR] Make SwitchInst::CaseIt almost a normal iterator.Chandler Carruth2017-03-266-50/+58
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [X86] Pull out repeated ScalarValueSizeInBits code. NFCI.Simon Pilgrim2017-03-251-6/+4
| | | | llvm-svn: 298783
* [X86][SSE] Combine (VSRLI (VSRAI X, Y), (NumSignBits-1)) -> (VSRLI X, ↵Simon Pilgrim2017-03-252-2/+9
| | | | | | | | | | (NumSignBits-1)) Part 3 of 3. Differential Revision: https://reviews.llvm.org/D31347 llvm-svn: 298782
* Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonlyEric Christopher2017-03-258-25/+65
| | | | | | | | so that we can perform some optimizations across it. Fixes PR32365 llvm-svn: 298781
* [X86][SSE] Added ComputeNumSignBitsForTargetNode support for (V)PSRAISimon Pilgrim2017-03-252-2/+11
| | | | | | | | Part 2 of 3. Differential Revision: https://reviews.llvm.org/D31347 llvm-svn: 298780
* [X86][SSE] Generalised CMP+AND1 combine to ZERO/ALLBITS+MASKSimon Pilgrim2017-03-251-26/+22
| | | | | | | | | | | | Patch to generalize combinePCMPAnd1 (for handling SETCC + ZEXT cases) to work for any input that has zero/all bits set masked with an 'all low bits' mask. Replaced the implicit assumption of shift availability with a call to SupportedVectorShiftWithImm. Part 1 of 3. Differential Revision: https://reviews.llvm.org/D31347 llvm-svn: 298779
* [x86] use PMOVMSK to replace memcmp libcalls for 16-byte equalitySanjay Patel2017-03-255-44/+81
| | | | | | | | | 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
* [X86][SSE] Add extra computeNumSignBits test case for D31311.Simon Pilgrim2017-03-251-0/+47
| | | | llvm-svn: 298774
* [InstCombine] Change the interface of SimplifyDemandedBits so that it takes ↵Craig Topper2017-03-253-46/+46
| | | | | | | | the instruction and operand instead of the Use. The first thing it did was get the User for the Use to get the instruction back. This requires looking through the Uses for the User using the waymarking walk. That's pretty fast, but its probably still better to just pass the Instruction we already had. llvm-svn: 298772
* [AArch64] Refine Falkor Machine Model - Part1Balaram Makam2017-03-253-88/+422
| | | | llvm-svn: 298768
* [NewGVN] Adjust NDEBUG markers.Davide Italiano2017-03-251-2/+2
| | | | | | | This avoids 'used but not defined' warnings in Release builds with GCC. llvm-svn: 298760
* [AMDGPU] Switch data layout by triple environment amdgizYaxun Liu2017-03-253-1/+28
| | | | | | | | | | | | Switch data layout by target triple environment amdgiz and amdgizcl indicating using of an address space mapping in which generic address space is 0. amdgiz is for non-OpenCL environment where generic address space is 0. amdgizcl is for OpenCL environment where generic address space is 0. Differential Revision: https://reviews.llvm.org/D31211 llvm-svn: 298758
* [libFuzzer] Fix test on Windows.Vitaly Buka2017-03-251-1/+1
| | | | llvm-svn: 298757
* [asan] Put ctor/dtor in comdat.Evgeniy Stepanov2017-03-253-10/+54
| | | | | | | | | | | | | | | | When possible, put ASan ctor/dtor in comdat. The only reason not to is global registration, which can be TU-specific. This is not the case when there are no instrumented globals. This is also limited to ELF targets, because MachO does not have comdat, and COFF linkers may GC comdat constructors. The benefit of this is a lot less __asan_init() calls: one per DSO instead of one per TU. It's also necessary for the upcoming gc-sections-for-globals change on Linux, where multiple references to section start symbols trigger quadratic behaviour in gold linker. llvm-svn: 298756
* [libFuzzer] read asan's dedup_token while minimizing a crash and stop ↵Kostya Serebryany2017-03-252-4/+53
| | | | | | minimization if another bug was found during minimization (https://github.com/google/oss-fuzz/issues/452) llvm-svn: 298755
* [ARM] Fix mixup between Lo and Hi in SMLALBB formation.Eli Friedman2017-03-252-88/+88
| | | | llvm-svn: 298752
* Apply clang-format as commented in D31311. NFCI.Simon Pilgrim2017-03-241-1/+2
| | | | llvm-svn: 298751
* [codeview] Don't assert when the user violates the ODRReid Kleckner2017-03-242-28/+102
| | | | | | | | | | If we have an array of a user-defined aggregates for which there was an ODR violation, then the array size will not necessarily match the number of elements times the size of the element. Fixes PR32383 llvm-svn: 298750
* [Outliner] Revert r298734.Jessica Paquette2017-03-241-1/+1
| | | | | | | When I tested r298734, I thought that red zones were enabled by default like in X86. Since red zones are behind a flag on AArch64 the testing wasn't true. llvm-svn: 298747
* [libFuzzer] be more careful when calling strlen of strcmp parameters, PR32357Kostya Serebryany2017-03-244-3/+30
| | | | llvm-svn: 298746
* Revert r298711 "[InstCombine] Provide a way to calculate KnownZero/One for ↵Craig Topper2017-03-243-45/+25
| | | | | | | | Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits" Tsan bot is failing. llvm-svn: 298745
* [x86] add 32-bit RUN for better memcmp coverage; NFCSanjay Patel2017-03-241-102/+244
| | | | llvm-svn: 298744
* [libFuzzer] honor -exact_artifact_path for all intermediate files during ↵Kostya Serebryany2017-03-242-3/+6
| | | | | | crash minimization (https://github.com/google/oss-fuzz/issues/250) llvm-svn: 298740
* Move spill size and alignment info from MC to TargetRegisterInfoKrzysztof Parzyszek2017-03-243-17/+15
| | | | | | | | | | | | 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
* AMDGPU: Fix annotating loops with nested loop conditionsMatt Arsenault2017-03-242-9/+290
| | | | | | | | If the branch condition for a loop was a phi which itself was fed from a phi from a loop, it isn't safe to try to delete the phi until after the loop is handled. llvm-svn: 298737
* [MachineScheduler] Add missing machine pass dependency.Davide Italiano2017-03-241-0/+1
| | | | llvm-svn: 298736
* Revert r298620: [LV] Vectorize GEPsIvan Krasin2017-03-244-221/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason: breaks linking Chromium with LLD + ThinLTO (a pass crashes) LLVM bug: https://bugs.llvm.org//show_bug.cgi?id=32413 Original change description: [LV] Vectorize GEPs This patch adds support for vectorizing GEPs. Previously, we only generated vector GEPs on-demand when creating gather or scatter operations. All GEPs from the original loop were scalarized by default, and if a pointer was to be stored to memory, we would have to build up the pointer vector with insertelement instructions. With this patch, we will vectorize all GEPs that haven't already been marked for scalarization. The patch refines collectLoopScalars to more exactly identify the scalar GEPs. The function now more closely resembles collectLoopUniforms. And the patch moves vector GEP creation out of vectorizeMemoryInstruction and into the main vectorization loop. The vector GEPs needed for gather and scatter operations will have already been generated before vectoring the memory accesses. Original Differential Revision: https://reviews.llvm.org/D30710 llvm-svn: 298735
* [Outliner] Remove no red zone requirment for AArch64Jessica Paquette2017-03-241-1/+1
| | | | | | | | | | | AArch64 doesn't require -mno-red-zone; stack fixups are sufficient here. This was unnecessarily copied over from the X86 target. (You can now outline with red zones! Yay!) Removing the requirement passes all Single/MultiSource tests. llvm-svn: 298734
* Document how to fetch monorepo SVN revision notesReid Kleckner2017-03-241-6/+18
| | | | llvm-svn: 298733
* [asan] Delay creation of asan ctor.Evgeniy Stepanov2017-03-244-23/+31
| | | | | | | | | 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
OpenPOWER on IntegriCloud