summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [AArch64] generate vuzp instead of movSebastian Pop2018-03-012-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when a BUILD_VECTOR is created out of a sequence of EXTRACT_VECTOR_ELT with a specific pattern sequence, either <0, 2, 4, ...> or <1, 3, 5, ...>, replace the BUILD_VECTOR with either vuzp1 or vuzp2. With this patch LLVM generates the following code for the first function fun1 in the testcase: adrp x8, .LCPI0_0 ldr q0, [x8, :lo12:.LCPI0_0] tbl v0.16b, { v0.16b }, v0.16b ext v1.16b, v0.16b, v0.16b, #8 uzp1 v0.8b, v0.8b, v1.8b str d0, [x8] ret Without this patch LLVM currently generates this code: adrp x8, .LCPI0_0 ldr q0, [x8, :lo12:.LCPI0_0] tbl v0.16b, { v0.16b }, v0.16b mov v1.16b, v0.16b mov v1.b[1], v0.b[2] mov v1.b[2], v0.b[4] mov v1.b[3], v0.b[6] mov v1.b[4], v0.b[8] mov v1.b[5], v0.b[10] mov v1.b[6], v0.b[12] mov v1.b[7], v0.b[14] str d1, [x8] ret llvm-svn: 326443
* [InstCombine] move/add tests for fmul reassociation; NFCSanjay Patel2018-03-012-12/+72
| | | | | | | This transform may be out-of-scope for instcombine, but this is only documenting the current behavior. llvm-svn: 326442
* Don't allocate a header bellow address 0.Rafael Espindola2018-03-012-4/+29
| | | | | | | | | | | | With the current code if the script has a PHDRS we always obey and try to allocate a header. This can cause Min - HeaderSize to underflow. It looks like bfd actually prints an error for this case. With this patch we do the same. Found while looking at pr36515. llvm-svn: 326441
* [InstCombine] auto-generate full checks; NFCSanjay Patel2018-03-011-51/+49
| | | | llvm-svn: 326440
* Resubmit [analyzer] Support for naive cross translation unit analysisIlya Biryukov2018-03-0123-51/+774
| | | | | | | | | | | Originally submitted as r326323 and r326324. Reverted in r326432. Reverting the commit was a mistake. The breakage was due to invalid build files in our internal buildsystem, CMakeLists did not have any cyclic dependencies. llvm-svn: 326439
* UsersManual: improve the clang-cl text some moreHans Wennborg2018-03-011-0/+17
| | | | llvm-svn: 326438
* Make Finalize tolerant of empty register sets.Tatyana Krasnukha2018-03-011-1/+1
| | | | llvm-svn: 326437
* Revert "[DEBUGINFO] Add flag for DWARF2 or less to use sections as references."Alexey Bataev2018-03-014-104/+11
| | | | | | | This reverts commit r326328 to remove checks for emission of certain sections after discussion with Eric Christofer. llvm-svn: 326436
* [OMPT] Fix interoperability test with GCCJonas Hahnfeld2018-03-011-2/+14
| | | | | | | | | | | | | | | | We have to ensure that the runtime is initialized _before_ waiting for the two started threads to guarantee that the master threads post their ompt_event_thread_begin before the worker threads. This is not guaranteed in the parallel region where one worker thread could start before the other master thread has invoked the callback. The problem did not happen with Clang becauses the generated code calls __kmpc_global_thread_num() and cashes its result for functions that contain OpenMP pragmas. Differential Revision: https://reviews.llvm.org/D43882 llvm-svn: 326435
* UsersManual: beef up the clang-cl text a littleHans Wennborg2018-03-011-3/+13
| | | | llvm-svn: 326434
* [CodeGen] fix argument attribute in lowering statepoint/patchpointThan McIntosh2018-03-014-2/+38
| | | | | | | | | | | | | | | Summary: Use the correct loop index varaible, ArgI, to retrieve attributes. Reviewers: thanm, sanjoy, rnk Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43832 llvm-svn: 326433
* Revert "[analyzer] Support for naive cross translation unit analysis"Ilya Biryukov2018-03-0123-774/+51
| | | | | | | | | | Also revert "[analyzer] Fix a compiler warning" This reverts commits r326323 and r326324. Reason: the commits introduced a cyclic dependency in the build graph. This happens to work with cmake, but breaks out internal integrate. llvm-svn: 326432
* [ELF] - Don't crash on broken MEMORY declaration.George Rimar2018-03-012-3/+20
| | | | | | | | | | | LLD crashes with broken scripts shown in testcase, because fails to read memory regon name and accesses MemoryRegions's element which is nullptr. Patch fixes it. Differential revision: https://reviews.llvm.org/D43866 llvm-svn: 326431
* [ELF] - Do not remove empty sections that use symbols in expressions.George Rimar2018-03-014-5/+27
| | | | | | | | | | | | | | | This is PR36515. Currenly if we have a script like .debug_info 0 : { *(.debug_info) }, we would not remove this section and keep it in the output. That does not work, because it is common case for debug sections to have a zero address expression. Patch changes behavior so that we remove only sections that do not use symbols in its expressions. Differential revision: https://reviews.llvm.org/D43863 llvm-svn: 326430
* [SCCP] Fix unused variable warning in release builds.Benjamin Kramer2018-03-011-0/+1
| | | | llvm-svn: 326429
* [OMPT] Fix task-type test with GCCJoachim Protze2018-03-011-0/+3
| | | | | | | | | | This is similar to D43882. The runtime needs to be initialized before calling print_ids(0) http://lab.llvm.org:8011/builders/openmp-gcc-x86_64-linux-debian/builds/60 Differential Revision: https://reviews.llvm.org/D43897 llvm-svn: 326428
* [ELF] - Fix eh-frame-reloc-out-of-range.test.George Rimar2018-03-011-1/+1
| | | | | | Was broken after recent testcases changes. llvm-svn: 326427
* [clang-format] Add SpaceBeforeColon optionFrancois Ferrand2018-03-015-1/+182
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When disabled, this option allows removing the space before colon, making it act more like the semi-colon. When enabled (default), the current behavior is not affected. This mostly affects C++11 loop, initializer list, inheritance list and container literals: class Foo: Bar {} Foo::Foo(): a(a) {} for (auto i: myList) {} f({a: 1, b: 2, c: 3}); Reviewers: krasimir, djasper Reviewed By: djasper Subscribers: xvallspl, teemperor, karies, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32525 llvm-svn: 326426
* [dsymutil] Move string pool into its own implementatino file. NFC.Jonas Devlieghere2018-03-014-46/+57
| | | | | | | | The DwarfLinker implementation is already relatively large with over 4k LOC. This commit moves the implementation of NonRelocatableStringpool into a separate cpp file. llvm-svn: 326425
* [WebAssembly] Reorder exports to match symbol table orderNicholas Wilson2018-03-0114-105/+103
| | | | | | | | This fixes a TODO introduced in rLLD325861. Differential Revision: https://reviews.llvm.org/D43877 llvm-svn: 326424
* [PATCH] [compiler-rt, RISCV] Support builtins for RISC-VShiva Chen2018-03-019-2/+177
| | | | | | | | | | | Summary: Support builtins for RISC-V, RV32 and RV64. Reviewers: asb, apazos, mgrang Differential Revision: https://reviews.llvm.org/D42958 llvm-svn: 326420
* Function definition may have uninstantiated bodySerge Pavlov2018-03-014-51/+100
| | | | | | | | | | | | | | | | | | | | | | | | Current implementation of `FunctionDecl::isDefined` does not take into account redeclarations that do not have bodies, but the bodies can be instantiated from corresponding templated definition. This behavior does not allow to detect function redefinition in the cases where friend functions is defined in class templates. For instance, the code: ``` template<typename T> struct X { friend void f() {} }; X<int> xi; void f() {} ``` compiles successfully but must fail due to redefinition of `f`. The declaration of the friend `f` is created when the containing template `X` is instantiated, but it does not have a body as per 14.5.4p4 because `f` is not odr-used. With this change the function `Sema::CheckForFunctionRedefinition` considers functions with uninstantiated bodies as definitions. Differential Revision: https://reviews.llvm.org/D30170 llvm-svn: 326419
* [SCEV] Smart range calculation for SCEVUnknown PhisMax Kazantsev2018-03-015-3/+187
| | | | | | | | | | The range of SCEVUnknown Phi which merges values `X1, X2, ..., XN` can be evaluated as `U(Range(X1), Range(X2), ..., Range(XN))`. Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D43810 llvm-svn: 326418
* [X86] Stop passing two arguments by reference. NFCCraig Topper2018-03-011-1/+1
| | | | | | I think these used to be out parameters, but they haven't been for a while. llvm-svn: 326417
* Remove redundant casts. NFCGeorge Burgess IV2018-03-0151-178/+162
| | | | | | | | | | | | | | | | | | | So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and `dyn_cast`s for fun. This is a portion of what it found for clang; I plan to do similar cleanups in LLVM and other subprojects when I find time. Because of the volume of changes, I explicitly avoided making any change that wasn't highly local and obviously correct to me (e.g. we still have a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading is a thing and the cast<Bar> did actually change the type -- just up the class hierarchy). I also tried to leave the types we were cast<>ing to somewhere nearby, in cases where it wasn't locally obvious what we were dealing with before. llvm-svn: 326416
* Convert more tests as linker scripts instead of assembly.Rui Ueyama2018-03-0136-491/+445
| | | | llvm-svn: 326415
* [test] Restore cleanup behavior in TestQuoting.pyVedant Kumar2018-03-011-1/+1
| | | | | | | | | | Before the change to compile tests out-of-tree, the cleanup classmethod in TestQuoting.py would remove a temp file. After the change it threw an exception due to a malformed call to getBuildArtifact(). Bring back the old behavior. llvm-svn: 326414
* [Support] Fix comments for handleAllErrors: it calls llvm_unreachable if theLang Hames2018-03-011-4/+4
| | | | | | contract is violated, not report_fatal_error. llvm-svn: 326413
* We were getting the wrong dynamic type if there were two classes with the ↵Jim Ingham2018-03-014-2/+106
| | | | | | | | | | | | | | same basename. There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with :: and pass eTypeClassAny for the type. In this case we always know that the name we get from the vtable name is absolute so we can work around the bug by prepending the "::". This doesn't fix the FindTypes bug. <rdar://problem/38010986> llvm-svn: 326412
* [WebAssembly] Remove unused forward declaration.Rui Ueyama2018-03-011-2/+0
| | | | llvm-svn: 326411
* Do not create multiple NOTE segments.Rui Ueyama2018-03-012-12/+22
| | | | | | | | | | | Previously, we didn't try to make effort to put .note sections next to each other in the output file, so two .note sections were likely to be stored to two separate NOTE segments. That's undesirable because we should create as few segments as possible in general. Differential Revision: https://reviews.llvm.org/D43858 llvm-svn: 326410
* Expand test a bit.Rafael Espindola2018-03-011-11/+27
| | | | | | | | | It now includes both linkerscript and non linkerscript variants. Extracted from a patch by Rui while I was trying to figure out what exactly was changing. llvm-svn: 326409
* [analyzer] [tests] Create a directory for the log fileGeorge Karpenkov2018-03-011-0/+2
| | | | llvm-svn: 326408
* [XRay] cache symbolized function names for a repeatedly queried function IDMartin Pelikan2018-03-012-1/+9
| | | | | | | | | | | | | | | | | | | Summary: Processing 2 GB XRay traces with "llvm-xray convert -symbolize" needs to go over each trace record and symbolize the function name refered to by its ID. Currently this happens by asking the LLVM symbolizer code every single time. A simple cache can save around 30 minutes of processing of that trace. llvm-xray's resident memory usage increased negligibly with this cache. Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43896 llvm-svn: 326407
* [RuntimeDyld][MachO] Fix assertion in encodeAddend, add missing directive toLang Hames2018-03-012-3/+7
| | | | | | | | | | | | test case. r326290 fixed the assertion for decodeAddend, but not encodeAddend. The regression test failed to catch this because it was missing the subsections_via_symbols flag, so the desired relocation was not applied. This patch also fixes the formatting of the assertion from r326290. llvm-svn: 326406
* [analyzer] Add a checker for mmap()s which are both writable and executable.Artem Dergachev2018-03-014-0/+131
| | | | | | | | | | | | | | | | | | | This is a security check that warns when both PROT_WRITE and PROT_EXEC are set during mmap(). If mmap()ed memory is both writable and executable, it makes it easier for the attacker to execute arbitrary code when contents of this memory are compromised. Some applications require such mmap()s though, such as different sorts of JIT. Re-applied after a revert in r324167. Temporarily stays in the alpha package because it needs a better way of determining macro values that are not immediately available in the AST. Patch by David Carlier! Differential Revision: https://reviews.llvm.org/D42645 llvm-svn: 326405
* [IPSCCP] do not break musttail invariant (PR36485)Reid Kleckner2018-03-012-1/+113
| | | | | | | | | | | | | | | | | Do not replace results of `musttail` calls with a constant if the call itself can't be removed. Do not zap returns of `musttail` callees, if the call site can't be removed and replaced with a constant. Do not zap returns of `musttail`-calling blocks, this breaks invariant too. Patch by Fedor Indutny Differential Revision: https://reviews.llvm.org/D43695 llvm-svn: 326404
* Convert more .s files to linker script files.Rui Ueyama2018-03-0136-468/+506
| | | | | | | | | | | | | | Summary: This change removes large "echo" commands from the test by writing tests themselves as linker scripts. Reviewers: rafael Subscribers: emaste, javed.absar, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D43900 llvm-svn: 326403
* [CFG] [analyzer] Recall that we only skip NoOp casts in construction contexts.Artem Dergachev2018-03-012-1/+34
| | | | | | | | | | | | For now. We should also add support for ConstructorConversion casts as presented in the attached test case, but this requires more changes because AST around them seems different. The check was originally present but was accidentally lost during r326021. Differential Revision: https://reviews.llvm.org/D43840 llvm-svn: 326402
* Simplify removing empty output sections.Rafael Espindola2018-03-014-32/+30
| | | | | | | With this the meaning of the Live bit in output sections is clear: we have at some point added a input section into it. llvm-svn: 326401
* [ELF] Fix a test comment. NFCFangrui Song2018-03-011-1/+1
| | | | llvm-svn: 326400
* Add another entitlement that we need for debugserver.Jason Molenda2018-03-011-0/+2
| | | | | | <rdar://problem/29855293> llvm-svn: 326399
* [WebAssembly] Use Twine rather than StringRef for logging messagesSam Clegg2018-03-012-15/+19
| | | | | | | | Also add missing tracing to writeU8. Differential Revision: https://reviews.llvm.org/D43919 llvm-svn: 326398
* Start setting dllimport/dllexport in setGVProperties.Rafael Espindola2018-03-0114-169/+110
| | | | | | | | | | This is the next step in setting dso_local for COFF. The patches changes setGVProperties to first set dllimport/dllexport and changes a few cases that were setting dllimport/dllexport manually. With this a few more GVs are marked dso_local. llvm-svn: 326397
* [GlobalISel][AArch64] Adding -disable-gisel-legality-check CL optionRoman Tereshin2018-03-015-27/+4589
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it's impossible to test InstructionSelect pass with MIR which is considered illegal by the Legalizer in Assert builds. In early stages of porting an existing backend from SelectionDAG ISel to GlobalISel, however, we would have very basic CallLowering, Legalizer, and RegBankSelect implementations, but rather functional Instruction Select with quite a few patterns selectable due to the semi-automatic porting process borrowing them from SelectionDAG ISel. As we are trying to define legality as a property of being selectable by the instruction selector, it would be nice to be able to easily check what the selector can do in its current state w/o the legality check provided by the Legalizer getting in the way. It also seems beneficial to have a regression testing set up that would not allow the selector to silently regress in its support of the MIR not supported yet by the previous passes in the GlobalISel pipeline. This commit adds -disable-gisel-legality-check command line option to llc that disables those legality checks in RegBankSelect and InstructionSelect passes. It also adds quite a few MIR test cases for AArch64's Instruction Selector. Every one of them would fail on the legality check at the moment, but will select just fine if the check is disabled. Every test MachineFunction is intended to exercise a specific selection rule and that rule only, encoded in the MachineFunction's name by the rule's number, ID, and index of its GIM_Try opcode in TableGen'erated MatchTable (-optimize-match-table=false). Reviewers: ab, dsanders, qcolombet, rovka Reviewed By: bogner Subscribers: kristof.beyls, volkan, aditya_nandakumar, aemerson, rengolin, t.p.northover, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D42886 llvm-svn: 326396
* [DWARF] Emit a split line table only if there are split type units.Paul Robinson2018-03-013-0/+9
| | | | | | A .debug_info.dwo section doesn't use the .debug_line.dwo section. llvm-svn: 326395
* [DAE] don't remove args of musttail target/callerReid Kleckner2018-03-012-3/+53
| | | | | | | | | | | | | `musttail` requires identical signatures of caller and callee. Removing arguments breaks `musttail` semantics. PR36441 Patch by Fedor Indutny Differential Revision: https://reviews.llvm.org/D43708 llvm-svn: 326394
* [X86] Make sure we don't combine (fneg (fma X, Y, Z)) to a target specific ↵Craig Topper2018-03-012-1/+21
| | | | | | | | | | node when there are no FMA instructions. This would cause a 'cannot select' error at isel when we should have emitted a lib call and an xor. Fixes PR36553. llvm-svn: 326393
* Pass a GlobalDecl to SetCommonAttributes. NFC.Rafael Espindola2018-03-012-6/+6
| | | | | | Part of D43900. llvm-svn: 326392
* Inline a trivial function. NFC.Rafael Espindola2018-03-013-10/+2
| | | | llvm-svn: 326391
OpenPOWER on IntegriCloud