summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [InstSimplify] add tests for div/rem with bool divisor; NFCSanjay Patel2018-06-252-0/+44
| | | | llvm-svn: 335509
* Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code ↵Reid Kleckner2018-06-2514-42/+545
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | models" The large code model allows code and data segments to exceed 2GB, which means that some symbol references may require a displacement that cannot be encoded as a displacement from RIP. The large PIC model even relaxes the assumption that the GOT itself is within 2GB of all code. Therefore, we need a special code sequence to materialize it: .LtmpN: leaq .LtmpN(%rip), %rbx movabsq $_GLOBAL_OFFSET_TABLE_-.LtmpN, %rax # Scratch addq %rax, %rbx # GOT base reg From that, non-local references go through the GOT base register instead of being PC-relative loads. Local references typically use GOTOFF symbols, like this: movq extern_gv@GOT(%rbx), %rax movq local_gv@GOTOFF(%rbx), %rax All calls end up being indirect: movabsq $local_fn@GOTOFF, %rax addq %rbx, %rax callq *%rax The medium code model retains the assumption that the code segment is less than 2GB, so calls are once again direct, and the RIP-relative loads can be used to access the GOT. Materializing the GOT is easy: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rbx # GOT base reg DSO local data accesses will use it: movq local_gv@GOTOFF(%rbx), %rax Non-local data accesses will use RIP-relative addressing, which means we may not always need to materialize the GOT base: movq extern_gv@GOTPCREL(%rip), %rax Direct calls are basically the same as they are in the small code model: They use direct, PC-relative addressing, and the PLT is used for calls to non-local functions. This patch adds reasonably comprehensive testing of LEA, but there are lots of interesting folding opportunities that are unimplemented. I restricted the MCJIT/eh-lg-pic.ll test to Linux, since the large PIC code model is not implemented for MachO yet. Differential Revision: https://reviews.llvm.org/D47211 llvm-svn: 335508
* [CMake] Fix install-cxx target.Matt Morehouse2018-06-251-1/+1
| | | | | | Was broken by r334477. llvm-svn: 335507
* [InstCombine] add tests for add-of-sext-bool; NFCSanjay Patel2018-06-251-0/+22
| | | | | | | We canonicalize to select with a zext-add and either zext-sub or sext-sub, so this shows a pattern that's not conforming to the general trend. llvm-svn: 335506
* [GISel]: Update the end of GISel Opcode namespace.Aditya Nandakumar2018-06-251-1/+1
| | | | | | | G_ADDRSPACE_CAST was added at the end, but PRE_ISEL_GENERIC_OPCODE_END is still pointing incorrectly. llvm-svn: 335505
* [MachineOutliner] Outline from linkonceodrs by default in LTO when -moutline ↵Jessica Paquette2018-06-252-0/+12
| | | | | | | | | | | | is passed Pass -enable-linkonceodr-outlining by default when LTO is enabled. The outliner shouldn't compete with any sort of linker deduplication on linkonceodr functions when LTO is enabled. Therefore, this behaviour should be the default. llvm-svn: 335504
* [MachineOutliner] Make last of -moutline/-mno-outline winJessica Paquette2018-06-252-10/+8
| | | | | | | | The expected behaviour of command-line flags to clang is to have the last of -m(whatever) and -mno-(whatever) win. The outliner didn't do that. This fixes that and updates the test. llvm-svn: 335503
* [HWASan] Initalize shadow earler.Alex Shlyapnikov2018-06-251-4/+4
| | | | | | | | | | | | | | Summary: Initialize shadow memory before calling more libc functions to allow for HWASan-instrumented libc. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48551 llvm-svn: 335502
* [X86] Sort the static memory folding tables by reg opcode. Remove the ↵Craig Topper2018-06-252-5419/+5328
| | | | | | | | | | | | reg->mem DenseMaps in favor of binary search. With the static tables sorted we can binary search them directly for reg->mem lookups. This removes 6 DenseMaps that had to be created when X86InstrInfo is constructed. We still have one Mem->Reg DenseMap for the reverse direction. This is created just as before by walking the reg->mem arrays to populate it. Differential Revision: https://reviews.llvm.org/D48527 llvm-svn: 335501
* [X86] Allow base and index for gather instructions to appear in other order ↵Craig Topper2018-06-252-0/+16
| | | | | | for Intel syntax. llvm-svn: 335500
* [ELF] Fix sort-non-script.sFangrui Song2018-06-251-1/+1
| | | | llvm-svn: 335499
* [ELF] Change test files for style consistency. NFCFangrui Song2018-06-2510-37/+37
| | | | | | | | | * Move `REQUIRES:` line to the top * llvm-mc ... -o %t -> llvm-mc ... -o %t.o * Don't check "TEXT" "DATA" columns (they are bfd-style names that do not fit into llvm well) in llvm-objdump output llvm-svn: 335498
* [SelectionDAG] Remove debug locations from ConstantSD(FP)NodesVedant Kumar2018-06-257-75/+28
| | | | | | | | | | | | | | | | | | This removes debug locations from ConstantSDNode and ConstantSDFPNode. When this kind of node is materialized we no longer create a line table entry which jumps back to the constant's first point of use. This makes single-stepping behavior smoother, and it matches the model used by IR, where Constants have no locations. See this thread for more context: http://lists.llvm.org/pipermail/llvm-dev/2018-June/124164.html I'd like to handle constant BuildVectorSDNodes and to try to eliminate passing SDLocs to SelectionDAG::getConstant*() in follow-up commits. Differential Revision: https://reviews.llvm.org/D48468 llvm-svn: 335497
* [llvm-mca] Rename Backend to Pipeline. NFC.Matt Davis2018-06-2522-96/+97
| | | | | | | | | | | | | | | | | | Summary: This change renames the Backend and BackendPrinter to Pipeline and PipelinePrinter respectively. Variables and comments have also been updated to reflect this change. The reason for this rename, is to be slightly more correct about what MCA is modeling. MCA models a Pipeline, which implies some logical sequence of stages. Reviewers: andreadb, courbet, RKSimon Reviewed By: andreadb, courbet Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D48496 llvm-svn: 335496
* Use Triple::isMIPS() instead of enumerating all Triples. NFCAlexander Richardson2018-06-2510-74/+31
| | | | | | | | Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D48549 llvm-svn: 335495
* [ELF] readobj -elf-output-style=GNU -> readelfFangrui Song2018-06-2512-16/+15
| | | | | | Style change for consistency. NFC llvm-svn: 335494
* Add Triple::isMIPS()/isMIPS32()/isMIPS64(). NFCAlexander Richardson2018-06-2511-26/+28
| | | | | | | | | | | | | | There are quite a few if statements that enumerate all these cases. It gets even worse in our fork of LLVM where we also have a Triple::cheri (which is mips64 + CHERI instructions) and we had to update all if statements that check for Triple::mips64 to also handle Triple::cheri. This patch helps to reduce our diff to upstream and should also make some checks more readable. Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D48548 llvm-svn: 335493
* [clang-format] Add a default format style that can be used by users of ↵Eric Liu2018-06-253-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | `getStyle` Summary: Tools that reformat code often call `getStyle` to decide the format style to use on a certain source file. In practice, "file" style is widely used. As a result, many tools hardcode "file" when calling `getStyle`, which makes it hard to control the default style in tools across a codebase when needed. This change introduces a `DefaultFormatStyle` constant (default to "file" in upstream), which can be modified downstream if wanted, so that all users/tools built from the same source tree can have a consistent default format style. This also adds an DefaultFallbackStyle that is recommended to be used by tools and can be modified downstream. Reviewers: sammccall, djasper Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48492 llvm-svn: 335492
* Revert "[ASTImporter] Import the whole redecl chain of functions"Gabor Marton2018-06-255-787/+111
| | | | | | This reverts commit r335480. llvm-svn: 335491
* AMDGPU/GlobalISel: Add support for llvm.amdgcn.kernarg.segment.ptrMatt Arsenault2018-06-255-1/+62
| | | | | | | | | Note a normal select test is not currently possible because this relies on input registers tracked in SIMachineFunctionInfo which are not currently serializable in MIR, but this does work end-to-end from the IR. llvm-svn: 335490
* [LLDB] Select helper sign comparison fixDavid Carlier2018-06-251-2/+2
| | | | | | | | | | | | The constant could be unsigned thus explicit cast to silent compilation warnings Reviewers: aprantl Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D48540 llvm-svn: 335489
* StackSlotColoring: Decide colors per stack IDMatt Arsenault2018-06-253-22/+150
| | | | | | | | | | | | | | | | I thought I fixed this in r308673, but that fix was very broken. The assumption that any frame index can be used in place of another was more widespread than I realized. Even when stack slot sharing was disabled, this was still replacing frame index uses with a different ID with a different stack slot. Really fix this by doing the coloring per-stack ID, so all of the coloring logically done in a separate namespace. This is a lot simpler than trying to figure out how to change the color if the stack ID is different. llvm-svn: 335488
* [libFuzzer] Use Vector rather than std::vector.Matt Morehouse2018-06-251-1/+1
| | | | llvm-svn: 335487
* AMDGPU: Remove commented out codeMatt Arsenault2018-06-251-2/+0
| | | | llvm-svn: 335486
* AMDGPU/GlobalISel: Fix G_IMPLICIT_DEF for pointersMatt Arsenault2018-06-252-8/+86
| | | | llvm-svn: 335485
* [SampleFDO] Add an option to turn on/off warning about samples unused.Wei Mi2018-06-251-0/+8
| | | | | | | | | | | | | | | | | | If a function has sample to use, but cannot use them because of no debug information, currently a warning will be issued to inform the missing opportunity. This warning assumes the binary generating the profile and the binary using the profile are similar enough. It is not always the case. Sometimes even if the binaries are not quite similar, we may still get some benefit by using sampleFDO. In those cases, we may still want to apply sampleFDO but not want to see a lot of such warnings pop up. The patch adds an option for the warning. Differential Revision: https://reviews.llvm.org/D48510 llvm-svn: 335484
* [OPENMP] Do not consider address constant vars as possiblyAlexey Bataev2018-06-252-1/+31
| | | | | | | | | threadprivate. Do not delay emission of the address constant variables in OpenMP mode as they cannot be defined as threadprivate. llvm-svn: 335483
* [ELF] - ICF: add one more test case #3.George Rimar2018-06-251-0/+23
| | | | | | | | | | | | ICF is able to merge sections which relocations referring regular input sections or mergeable sections, so it handles InputSection and MergeInputSection cases. The following "return false" line which is executed in case of another type of the sections is uncovered by our test cases: https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L285 Patch fixes code coverage for this place. llvm-svn: 335482
* [DA] Delinearise AddRecs if we can prove they don't wrapDavid Green2018-06-253-3/+61
| | | | | | | | | | | We can prove that some delinearized subscripts do not wrap around to become negative by the fact that they are from inbound geps of load/store locations. This helps improve the delinearisation in cases where we can't prove that they are non-negative from SCEV alone. Differential Revision: https://reviews.llvm.org/D48481 llvm-svn: 335481
* [ASTImporter] Import the whole redecl chain of functionsGabor Marton2018-06-255-111/+787
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch when any `FunctionDecl` of a redeclaration chain is imported then we bring in the whole declaration chain. This involves functions and function template specializations. Also friend functions are affected. The chain is imported as it is in the "from" tu, the order of the redeclarations are kept. I also changed the lookup logic in order to find friends, but first making them visible in their declaration context. We may have long redeclaration chains if all TU contains the same prototype, but our measurements shows no degradation in time of CTU analysis (Tmux, Xerces, Bitcoin, Protobuf). Also, as further work we could squash redundant prototypes, but first ensure that functionality is working properly; then should we optimize. This may seem like a huge patch, sorry about that. But, most of the changes are new tests, changes in the production code is not that much. I also tried to create a smaller patch which does not affect specializations, but that patch failed to pass some of the `clang-import-test`s because there we import function specializations. Also very importantly, we can't just change the import of `FunctionDecl`s without changing the import of function template specializations because they are handled as `FunctionDecl`s. Reviewers: a.sidorin, r.stahl, xazax.hun, balazske Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47532 llvm-svn: 335480
* [ELF] - Rewrote comment. NFC.George Rimar2018-06-251-2/+2
| | | | llvm-svn: 335479
* AMDGPU: Respect align argument parameterMatt Arsenault2018-06-253-11/+133
| | | | | | | | | | This should avoid relying on the pointee type to get the alignment, particularly since pointee types are supposed to be removed at some point. Also fixes not getting the alignment for unsized types. llvm-svn: 335478
* [ELF] - ICF: add one more test case #2.George Rimar2018-06-251-0/+23
| | | | | | | | | | Check that ICF does not merge sections which relocations have equal addends, but different target values. This covers the following line, which was uncovered: https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L278 llvm-svn: 335477
* Fix TestThreadExit for gcc&libc++ comboPavel Labath2018-06-251-1/+2
| | | | | | | | | | | | | | | | pseudo_barrier_wait() begins by decrementing an atomic variable. Since these are always_inline in libc++, there is no line table anchor to break on before we decrement it. This meant that on gcc we stopped after the variable has been decremented, which meant that thread2 could have exited, violating the test setup. On clang this wasn't a problem because it generated some line table entries for the do{}while(0) loop in the macro, so we still ended up stopping, before we touched the variable. I fix this by adding a dummy statement before the pseudo_barrier_wait() command and setting the breakpoint there. llvm-svn: 335476
* [ELF] - ICF: add one more test case.George Rimar2018-06-251-0/+26
| | | | | | | | | | | This test case check that ICF does not merge 2 sections which relocations efer to symbols that live in sections of the different types (regular input section and mergeable input sections in this case). It covers the following line of code, which was uncovered previously: https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L271 llvm-svn: 335475
* SafepointIRVerifier should ignore dead blocks and dead edgesArtur Pilipenko2018-06-251-28/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only should SafepointIRVerifier ignore unreachable blocks (as suggested in https://reviews.llvm.org/D47011) but it also has to ignore dead blocks. In @test2 (see the new tests): br i1 true, label %right, label %left left: ... right: ... merge: %val = phi i8 addrspace(1)* [ ..., %left ], [ ..., %right ] use %val both left and right branches are reachable. If they collide then SafepointIRVerifier reports an error. Because of the foldable branch condition GVN finds the left branch dead and removes the phi node entry that merges values from right and left. Then the use comes from the right branch. This results in no collision. So, SafepointIRVerifier ends up in different results depending on either GVN is run or not. To solve this issue this patch adds Dead Block detection to SafepointIRVerifier which can ignore dead blocks while validating IR. The Dead Block detection algorithm is taken from GVN but modified to not split critical edges. That is needed to keep CFG unchanged by SafepointIRVerifier. Patch by Yevgeny Rouban. Reviewed By: anna, apilipenko, DaniilSuchkov Differential Revision: https://reviews.llvm.org/D47441 llvm-svn: 335473
* Improve handling of COPY instructions with identical value numbersKrzysztof Parzyszek2018-06-258-28/+1131
| | | | | | | | Testcases provided by Tim Renouf. Differential Revision: https://reviews.llvm.org/D48102 llvm-svn: 335472
* Revert r335460 "[ELF] - ICF: Remove dead code. NFC."George Rimar2018-06-251-0/+3
| | | | | | My mistake, it was not NFC. llvm-svn: 335471
* [llvm-exegesis][NFC] Remove unnecessary member variables.Clement Courbet2018-06-255-13/+10
| | | | llvm-svn: 335470
* [OPENMP, NVPTX] Fixes for NVPTX RTLAlexey Bataev2018-06-253-32/+36
| | | | | | | | | | | | | | | | | | Summary: Patch fixes several problems in the implementation of NVPTX RTL. 1. Detection of the last iteration for loops with static scheduling, no chunks. 2. Fixes reductions for the serialized parallel constructs. 3. Fixes handling of the barriers. Reviewers: grokos Reviewed By: grokos Subscribers: Hahnfeld, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D48480 llvm-svn: 335469
* [IR] avoid -Wdocumentation spew about HTML tagsSanjay Patel2018-06-251-8/+8
| | | | | | | | There's probably a better solution, but adding spaces in the IR vector examples sidesteps the problem without uglifying the plain text. llvm-svn: 335468
* [llvm-exegesis] Fix warning in r22752: Initialize IsSnippetSetupComplete.Clement Courbet2018-06-251-1/+1
| | | | llvm-svn: 335467
* [clang-cl] Don't emit dllexport inline functions etc. from pch files (PR37801)Hans Wennborg2018-06-2517-13/+168
| | | | | | | | | | | | | | | | | | | | | | | With MSVC, PCH files are created along with an object file that needs to be linked into the final library or executable. That object file contains the code generated when building the headers. In particular, it will include definitions of inline dllexport functions, and because they are emitted in this object file, other files using the PCH do not need to emit them. See the bug for an example. This patch makes clang-cl match MSVC's behaviour in this regard, causing significant compile-time savings when building dlls using precompiled headers. For example, in a 64-bit optimized shared library build of Chromium with PCH, it reduces the binary size and compile time of stroke_opacity_custom.obj from 9315564 bytes to 3659629 bytes and 14.6 to 6.63 s. The wall-clock time of building blink_core.dll goes from 38m41s to 22m33s. ("user" time goes from 1979m to 1142m). Differential Revision: https://reviews.llvm.org/D48426 llvm-svn: 335466
* [llvm-exegesis] Generate snippet setup code.Clement Courbet2018-06-2513-31/+324
| | | | | | | | | | | | | | | Summary: This ensures that the snippet always sees the same values for registers, making measurements reproducible. This will also allow exploring different values. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D48542 llvm-svn: 335465
* [ASTImporter] Add ms compatibility to tests which use the TestBaseGabor Marton2018-06-253-296/+283
| | | | | | | | | | | | | | | | | | Summary: In order to avoid build failures on MS, we use -fms-compatibility too in the tests which use the TestBase. Moved the family of `testImport` functions under a test fixture class, so we can use parameterized tests. Refactored `testImport` and `testImportSequence`, because `for` loops over the different compiler options is no longer needed, that is handeld by the test framework via parameters from now on. Reviewers: a.sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47367 llvm-svn: 335464
* Revert change 335077 "[InlineSpiller] Fix a crash due to lack of forward ↵Artur Pilipenko2018-06-252-97/+0
| | | | | | | | | | progress from remat specifically for STATEPOINT" This change caused widespread assertion failures in our downstream testing: lib/CodeGen/LiveInterval.cpp:409: bool llvm::LiveRange::overlapsFrom(const llvm::LiveRange&, llvm::LiveRange::const_iterator) const: Assertion `!empty() && "empty range"' failed. llvm-svn: 335462
* Revert change 335091. Artur Pilipenko2018-06-251-55/+0
| | | | | | It adds extra test for the change 335077, which is also to be reverted as it causes test failures in downstream testing. llvm-svn: 335461
* [ELF] - ICF: Remove dead code. NFC.George Rimar2018-06-251-3/+0
| | | | | | | | | | | | Code is dead. We use only InputSections when building the list of sections elegible for the ICF: https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L439 And 'isEligible' filters out SyntheticSections as well for us. That way the only Kind we have in the Sections vector is SectionBase::Regular, so we do not need to check sections kind at all, it is always the same. llvm-svn: 335460
* [clang-format] Keep @message together in text protosKrasimir Georgiev2018-06-253-3/+39
| | | | | | | | | | | | Summary: In C++ code snippets of the form `@field` are common. This makes clang-format keep them together in text protos, whereas before it would break them. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48543 llvm-svn: 335459
* [clangd] Always remove dots before converting paths to URIs in symbol collector.Eric Liu2018-06-251-1/+2
| | | | llvm-svn: 335458
OpenPOWER on IntegriCloud