summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Re-enable constructors when lifetime extension through fields occurs.Artem Dergachev2018-06-044-31/+24
| | | | | | | | | | | | | | | | Temporary object constructor inlining was disabled in r326240 for code like const int &x = A().x; because automatic destructor for the lifetime-extended object A() was not working correctly in CFG. CFG was fixed in r333941, so inlining can be re-enabled. CFG for lifetime extension through aggregates still needs to be fixed. Differential Revision: https://reviews.llvm.org/D44239 llvm-svn: 333946
* [Support] Add functions that operate on native file handles on Windows.Zachary Turner2018-06-043-30/+123
| | | | | | | | | | | | | | | | | | | | Windows' CRT has a limit of 512 open file descriptors, and fds which are generated by converting a HANDLE via _get_osfhandle count towards this limit as well. Regardless, often you find yourself marshalling back and forth between native HANDLE objects and fds anyway. If we know from the getgo that we're going to need to work directly with the handle, we can cut out the marshalling layer while also not contributing to filling up the CRT's very limited handle table. On Unix these functions just delegate directly to the existing set of functions since an fd *is* the native file type. It would be nice, very long term, if we could convert most uses of fds to file_t. Differential Revision: https://reviews.llvm.org/D47688 llvm-svn: 333945
* [X86] Avoid passing _mm_undefined* to builtin_shufflevector if we are able ↵Craig Topper2018-06-048-55/+44
| | | | | | | | to pass the first input a second time. This is more consistent with other usages of builtin_shufflevector. Later optimization passes or codegen will detect the duplicate vector and replace it with undef. Using _mm_undefined just puts a zeroinitializer that still needs to be optimized out later. llvm-svn: 333944
* [DAGcombine] Teach the combiner about -a = ~a + 1Amaury Sechet2018-06-044-41/+88
| | | | | | | | | | | | Summary: This include variant for add, uaddo and addcarry. usubo and subcarry require the carry to be flipped to preserve semantic, but we chose to do the transform anyway in that case as to push the transform down the carry chain. Reviewers: efriedma, spatel, RKSimon, zvi, bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46505 llvm-svn: 333943
* Fix for llvm-dis/llvm-bcanalyzer overflowsTeresa Johnson2018-06-042-2/+2
| | | | | | | | | | | | | | | | | | Summary: These tools failed for a very large bitcode file produced by LTO due to 64-bit values being assigned to 32-bit types. For the BitstreamReader.h fix, the value initially fit into the 32-bit unsigned, but there was an overflow when multiplying by 32 furter below to compute the bit offset. No test case in the patch as this requires a huge bitcode file. Reviewers: pcc, george.karpenkov Subscribers: mehdi_amini, a.sidorin, llvm-commits Differential Revision: https://reviews.llvm.org/D47731 llvm-svn: 333942
* [CFG] Fix automatic destructors when a member is bound to a reference.Artem Dergachev2018-06-042-37/+320
| | | | | | | | | | | | | | | | | | | In code like const int &x = A().x; automatic destructor for the object A() lifetime-extended by reference 'x' was not present in the clang CFG due to ad-hoc pattern-matching in getReferenceInitTemporaryType(). Re-use skipRValueSubobjectAdjustments() again to find the lifetime-extended object in the AST and emit the correct destructor. Lifetime extension through aggregates with references still needs to be covered. Differential Revision: https://reviews.llvm.org/D44238 llvm-svn: 333941
* [llvm-strip] Add missing aliases for --strip-debugAlexander Shaposhnikov2018-06-042-4/+24
| | | | | | | | | | Add missing aliases for --strip-debug: -g, -S, -d. Test plan: make check-all Differential revision: https://reviews.llvm.org/D47674 llvm-svn: 333940
* Get rid of SETCCEAmaury Sechet2018-06-047-61/+14
| | | | | | | | | | | | Summary: It has been deprecated in favor of SETCCCARRY for a year now and isn't used by any in tree backend. Reviewers: efriedma, craig.topper, dblaikie, bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47685 llvm-svn: 333939
* Remove llvm::Triple argument from get***Personality() functions. NFC.Heejin Ahn2018-06-041-17/+18
| | | | | | | | | | | | | | Summary: Because `llvm::Triple` can be derived from `TargetInfo`, it is simpler to take only `TargetInfo` argument. Reviewers: sbc100 Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47620 llvm-svn: 333938
* In thin and full LTO + CFI, direct function calls may go through jump tableDmitry Mikulin2018-06-0414-60/+287
| | | | | | | | | | entries to reach the target. Since these calls don't require type checks, we can short-circuit them to their real targets, except in cases when they can be pre-empted. Differential Revision: https://reviews.llvm.org/D46326 llvm-svn: 333937
* [clang-doc] Adding missing dependencies to fix linker error on botJulie Hockett2018-06-041-0/+2
| | | | llvm-svn: 333936
* [X86] Don't pass ParitySrc array into isAddSubOrSubAddMask. Instead use a ↵Craig Topper2018-06-041-8/+10
| | | | | | | | bool output parameter to get the real piece of info we care about. NFC The ParitySrc array is more of an implementation detail. A single bool to get the final parity is sufficient. llvm-svn: 333935
* [AMDGPU] Small refactoring in the schedulerStanislav Mekhanoshin2018-06-041-18/+3
| | | | | | | | After last changes some code can be simplified. Differential Revision: https://reviews.llvm.org/D47661 llvm-svn: 333934
* Remove dependency from Host to clang.Zachary Turner2018-06-0414-187/+253
| | | | | | | | | | Host depended on clang because HostInfo had a function to get the directory where clang was installed. We move this over to the clang expression parser plugin where it's more at home. Differential Revision: https://reviews.llvm.org/D47384 llvm-svn: 333933
* [clang-doc] Implement reducer portion of the frontend frameworkJulie Hockett2018-06-0411-59/+1602
| | | | | | | | | | | | | | | | | | Implements a simple, in-memory reducer for the mapped output of the initial tool. This creates a collection object for storing the deduplicated infos on each declaration, and populates that from the mapper output. The collection object is serialized to LLVM bitstream. On reading each serialized output, it checks to see if a merge is necessary and if so, merges the new info with the existing info (prefering the existing one if conflicts exist). For a more detailed overview of the tool, see the design document on the mailing list: http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html Differential Revision: https://reviews.llvm.org/D43341 llvm-svn: 333932
* [AMDGPU] Factored out common part of GCNRPTracker::reset()Stanislav Mekhanoshin2018-06-042-11/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D47664 llvm-svn: 333931
* [IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commandsVedant Kumar2018-06-044-341/+355
| | | | | | | | | | | | | | | | Change the syntax of the malloc and free commands in lldb-test's ir-memory-map subcommand to: <malloc> ::= <label> = malloc <size> <alignment> <free> ::= free <label> This should make it easier to read and extend tests in the future, e.g to test IRMemoryMap::WriteMemory or double-free behavior. Differential Revision: https://reviews.llvm.org/D47646 llvm-svn: 333930
* [MachO] Add out-of-bounds check to MachOObjectFile.cppSam Clegg2018-06-041-0/+1
| | | | | | | | This is a followup to rL333496. Differential Revision: https://reviews.llvm.org/D47544 llvm-svn: 333929
* [WebAssembly] Fix .td files after rL333900Sam Clegg2018-06-043-33/+33
| | | | | | Differential Revision: https://reviews.llvm.org/D47727 llvm-svn: 333928
* [ValueTracking] Match select abs pattern when there's an sext involvedJohn Brawn2018-06-043-6/+108
| | | | | | | | | | | | | | When checking a select to see if it matches an abs, allow the true/false values to be a sign-extension of the comparison value instead of requiring that they're directly the comparison value, as all the comparison cares about is the sign of the value. This fixes a regression due to r333702, where we were no longer generating ctlz due to isKnownNonNegative failing to match such a pattern. Differential Revision: https://reviews.llvm.org/D47631 llvm-svn: 333927
* [AMDGPU][Waitcnt] Fix handling of flat instrsMark Searles2018-06-043-17/+18
| | | | | | | | On GFX9 and earlier, flat memory ops may decrement VMCNT out-of-order as well as LGKMCNT out-of-order. Differential Revision: https://reviews.llvm.org/D46616 llvm-svn: 333926
* [X86] Only accept const SelectionDAG to ↵Simon Pilgrim2018-06-041-2/+2
| | | | | | | | resolveTargetShuffleInputs/getFauxShuffleMask These methods should only be using SelectionDAG for analysis (known/sign bits etc), not node creation. llvm-svn: 333925
* [NVPTX] Delete dead code from the AsmPrinter.Benjamin Kramer2018-06-042-142/+0
| | | | llvm-svn: 333924
* This diff includes changes for supporting the following types.Leonard Chan2018-06-0438-6/+453
| | | | | | | | | | | | | | | | | | | | | | | | | // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches. The tests included are for asserting that we can declare these types. Fixed the test that was failing by not checking for dso_local on some targets. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333923
* [RFC][patch 3/3] Add support for variant scheduling classes in llvm-mca.Andrea Di Biagio2018-06-047-19/+230
| | | | | | | | | | | | | | | | | | | | | | | | This patch is the last of a sequence of three patches related to LLVM-dev RFC "MC support for variant scheduling classes". http://lists.llvm.org/pipermail/llvm-dev/2018-May/123181.html This fixes PR36672. The main goal of this patch is to teach llvm-mca how to solve variant scheduling classes. This patch does that, plus it adds new variant scheduling classes to the BtVer2 scheduling model to identify so-called zero-idioms (i.e. so-called dependency breaking instructions that are known to generate zero, and that are optimized out in hardware at register renaming stage). Without the BtVer2 change, this patch would not have had any meaningful tests. This patch is effectively the union of two changes: 1) a change that teaches llvm-mca how to resolve variant scheduling classes. 2) a change to the BtVer2 scheduling model that allows us to special-case packed XOR zero-idioms (this partially fixes PR36671). Differential Revision: https://reviews.llvm.org/D47374 llvm-svn: 333909
* [llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in ↵Alexander Ivchenko2018-06-043-4/+74
| | | | | | | | | | | | | | | | | .note.gnu.property Resubmit of r333424. This version contains the fix for fails found by buildbots on some targets. This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property sections. These notes indicate that the object file is built to support Intel CET. patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D47473 llvm-svn: 333908
* [SelectionDAG] Add missing closing parentheses in comments, NFCKrzysztof Parzyszek2018-06-041-6/+6
| | | | llvm-svn: 333907
* [clangd] Boost scores for decls from current file in completionIlya Biryukov2018-06-043-12/+72
| | | | | | | | | | | | | | Summary: This should, arguably, give better ranking. Reviewers: ioeric, sammccall Reviewed By: sammccall Subscribers: mgorny, klimek, MaskRay, jkorous, mgrang, cfe-commits Differential Revision: https://reviews.llvm.org/D46943 llvm-svn: 333906
* AMDGPU: Make various NamedOperands upper caseNicolai Haehnle2018-06-044-43/+43
| | | | | | | | | | | | | | | | Summary: Avoid name clashes with the corresponding bit fields in the instruction encoding. Change-Id: Id1644e703e976e78f7af93788d9f44cb48c3251f Reviewers: arsenm, rampitec, kzhuravl Subscribers: wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D47433 llvm-svn: 333905
* TableGen/DAGPatterns: Allow bit constants in addition to int constantsNicolai Haehnle2018-06-041-3/+5
| | | | | | | | | | | | | | | Summary: Implicit casting is a simple quality of life improvement. Change-Id: I3d2b31b8b8f12cbb1e84f691e359fa713a9c4b42 Reviewers: tra, simon_tatham, craig.topper, MartinO, arsenm Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D47432 llvm-svn: 333904
* [analyzer] False positive refutation with Z3Mikhail R. Gadelha2018-06-046-1/+139
| | | | | | | | | | | | | | Summary: This is a prototype of a bug reporter visitor that invalidates bug reports by re-checking constraints of certain states on the bug path using the Z3 constraint manager backend. The functionality is available under the `crosscheck-with-z3` analyzer config flag. Reviewers: george.karpenkov, NoQ, dcoughlin, rnkovacs Reviewed By: george.karpenkov Subscribers: rnkovacs, NoQ, george.karpenkov, dcoughlin, xbolva00, ddcc, mikhail.ramalho, MTC, fhahn, whisperity, baloghadamsoftware, szepet, a.sidorin, gsd, dkrupp, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D45517 llvm-svn: 333903
* [ReleaseNotes] Formatting fixes.Nicola Zaghen2018-06-041-9/+4
| | | | llvm-svn: 333902
* TableGen: some LangRef doc fixesNicolai Haehnle2018-06-042-5/+31
| | | | | | | | | | | | | Summary: Change-Id: I1442e2daa09cab727a01d8c31893b50e644a5cd3 Reviewers: tra, simon_tatham, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47530 Change-Id: I397655dd18b7ff978c1affa3174740d9c1a82594 llvm-svn: 333901
* TableGen: Streamline the semantics of NAMENicolai Haehnle2018-06-0416-537/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The new rules are straightforward. The main rules to keep in mind are: 1. NAME is an implicit template argument of class and multiclass, and will be substituted by the name of the instantiating def/defm. 2. The name of a def/defm in a multiclass must contain a reference to NAME. If such a reference is not present, it is automatically prepended. And for some additional subtleties, consider these: 3. defm with no name generates a unique name but has no special behavior otherwise. 4. def with no name generates an anonymous record, whose name is unique but undefined. In particular, the name won't contain a reference to NAME. Keeping rules 1&2 in mind should allow a predictable behavior of name resolution that is simple to follow. The old "rules" were rather surprising: sometimes (but not always), NAME would correspond to the name of the toplevel defm. They were also plain bonkers when you pushed them to their limits, as the old version of the TableGen test case shows. Having NAME correspond to the name of the toplevel defm introduces "spooky action at a distance" and breaks composability: refactoring the upper layers of a hierarchy of nested multiclass instantiations can cause unexpected breakage by changing the value of NAME at a lower level of the hierarchy. The new rules don't suffer from this problem. Some existing .td files have to be adjusted because they ended up depending on the details of the old implementation. Change-Id: I694095231565b30f563e6fd0417b41ee01a12589 Reviewers: tra, simon_tatham, craig.topper, MartinO, arsenm, javed.absar Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D47430 llvm-svn: 333900
* Created a tiny SMT interface and make Z3ConstraintManager implement itMikhail R. Gadelha2018-06-042-3/+101
| | | | | | | | | | | | | | | | | | | Summary: This patch implements a simple SMTConstraintManager API, and requires the implementation of two methods for now: `addRangeConstraints` and `isModelFeasible`. Update Z3ConstraintManager to inherit it and implement required methods. I also moved the method to dump the SMT formula from D45517 to this patch. This patch was created based on the reviews from D47640. Reviewers: george.karpenkov, NoQ, ddcc, dcoughlin Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D47689 llvm-svn: 333899
* [ReleaseNotes] Add release note for the new LLVM_DEBUG macro.Nicola Zaghen2018-06-041-0/+15
| | | | | | | | This is to provide a way to migrate from the old DEBUG macro to the new one. Differential Revision: https://reviews.llvm.org/D47528 llvm-svn: 333898
* [clangd] Fix inverted test (--gtest_filter strikes again...)Sam McCall2018-06-041-1/+1
| | | | llvm-svn: 333897
* [mips] Restore the availablity of trap for microMIPSSimon Dardis2018-06-042-0/+35
| | | | | | | | Reviewers: smaksimovic, atanasyan, abeserminji Differential Revision: https://reviews.llvm.org/D47584 llvm-svn: 333895
* [llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given ↵Greg Bedwell2018-06-041-1/+1
| | | | | | empty input llvm-svn: 333894
* [llvm-mca] Regenerate a test to remove a double newlineGreg Bedwell2018-06-041-1/+0
| | | | | | Command used: py update_mca_test_checks.py ..\test\tools\llvm-mca\*\*.s ..\test\tools\llvm-mca\*\*\*.s llvm-svn: 333893
* [llvm-mca] Track cycles contributed by resources that are in a 'Super' ↵Andrea Di Biagio2018-06-041-1/+19
| | | | | | | | | | | | | | relationship. This is required if we want to correctly match the behavior of method SubtargetEmitter::ExpandProcResource() in Tablegen. When computing the set of "consumed" processor resources and resource cycles, the logic in ExpandProcResource() doesn't update the number of resource cycles contributed by a "Super" resource to a group. We need to take this into account when a model declares a processor resource which is part of a 'processor resource group', and it is also used as the "Super" of other resources. llvm-svn: 333892
* [clang][tooling] Don't forget to link to clangToolingInclusions.Roman Lebedev2018-06-041-0/+1
| | | | | | | Fixes build with shared libs, broken by rL333874. Some buildbot converage is sorely missing. llvm-svn: 333891
* [clang][tooling] Don't forget to link to clangToolingInclusions.Roman Lebedev2018-06-041-0/+1
| | | | | | | Fixes build with shared libs, broken by rL333874. Some buildbot converage is sorely missing. llvm-svn: 333890
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-0/+10
| | | | | | OpenBSD python module. llvm-svn: 333889
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-042-15/+23
| | | | | | | | | | | | Add OpenBSD python module in order to support unit tests. Reviewers: labath, zturner Reviewed By: labath Differential Revision: https://reviews.llvm.org/D47692 llvm-svn: 333888
* [llvm-mca] Make sure not to end the test files with an empty line.Roman Lebedev2018-06-04198-200/+5
| | | | | | | | | | | | | | | | | | | Summary: It's super irritating. [properly configured] git client then complains about that double-newline, and you have to use `--force` to ignore the warning, since even if you fix it manually, it will be reintroduced the very next runtime :/ Reviewers: RKSimon, andreadb, courbet, craig.topper, javed.absar, gbedwell Reviewed By: gbedwell Subscribers: javed.absar, tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D47697 llvm-svn: 333887
* [llvm-exegesis][NFC] Use an enum instead of a string for benchmark mode.Clement Courbet2018-06-0410-14/+29
| | | | | | | | | | | | Summary: YAML encoding is backwards-compatible. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D47705 llvm-svn: 333886
* [clangd] Avoid indexing decls associated with friend decls.Eric Liu2018-06-043-0/+61
| | | | | | | | | | | | | | | | | | | | Summary: These decls are sometime used as the canonical declarations (e.g. for go-to-def), which seems to be bad. - friend decls that are not definitions should be ignored for indexing purposes - this means they should never be selected as canonical decl - if the friend decl is the only decl, then the symbol should not be indexed Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D47623 llvm-svn: 333885
* [llvm-exegesis] Analysis: Show inconsistencies between checked-in and ↵Clement Courbet2018-06-045-93/+241
| | | | | | | | | | | | | | | | | | measured data. Summary: We now highlight any sched classes whose measurements do not match the LLVM SchedModel. "bad" clusters are marked in red. Screenshot in phabricator diff. Reviewers: gchatelet Subscribers: tschuett, mgrang, RKSimon, llvm-commits Differential Revision: https://reviews.llvm.org/D47639 llvm-svn: 333884
* [ELF] - Fix BB.George Rimar2018-06-041-2/+2
| | | | llvm-svn: 333883
OpenPOWER on IntegriCloud