summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Reorder symbol table to match MC orderNicholas Wilson2018-02-2810-121/+120
| | | | | | | | This removes a TODO introduced in rL325860 Differential Revision: https://reviews.llvm.org/D43685 llvm-svn: 326334
* [ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operationsPablo Barrio2018-02-283-2/+221
| | | | | | | | | | | | | | | | | | | Summary: Expressions of the form x < 0 ? 0 : x; and x < -1 ? -1 : x can be lowered using bit-operations instead of branching or conditional moves In thumb-mode this results in a two-instruction sequence, a shift followed by a bic or or while in ARM/thumb2 mode that has flexible second operand the shift can be folded into a single bic/or instructions. In most cases this results in smaller code and possibly less branches, and in no case larger than before. Patch by Martin Svanfeldt Reviewers: fhahn, pbarrio, rogfer01 Reviewed By: pbarrio, rogfer01 Subscribers: chrib, yroux, eugenis, efriedma, rogfer01, aemerson, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D42574 llvm-svn: 326333
* Test commit access: apply clang-format suggestionJoel E. Denny2018-02-281-2/+2
| | | | llvm-svn: 326332
* [InstCombine] auto-generate complete checks; NFCSanjay Patel2018-02-281-26/+36
| | | | llvm-svn: 326331
* [InstCombine] move invariant call out of loop; NFCSanjay Patel2018-02-281-4/+4
| | | | | | We really shouldn't need a 2-loop here at all, but that's another cleanup. llvm-svn: 326330
* [InstCombine] move constant check into foldBinOpIntoSelectOrPhi; NFCISanjay Patel2018-02-286-34/+29
| | | | | | | | Also, rename 'foldOpWithConstantIntoOperand' because that's annoyingly vague. The constant check is redundant in some cases, but it allows removing duplication for most of the calls. llvm-svn: 326329
* [DEBUGINFO] Add flag for DWARF2 or less to use sections as references.Alexey Bataev2018-02-284-11/+104
| | | | | | | | | | | | | | | | | Summary: Some targets does not support labels inside debug sections, but support references in form `section +|- offset`. Patch adds initial support for this. Also, this patch disables emission of all additional debug sections that may have labels inside of it (like pub sections and string tables). Reviewers: probinson, echristo Subscribers: JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D43627 llvm-svn: 326328
* Rename a few checks from misc- to bugprone-.Alexander Kornienko2018-02-2824-80/+92
| | | | | | | | | | | | | | | | | | Summary: rename_check.py {misc,bugprone}-forwarding-reference-overload rename_check.py {misc,bugprone}-macro-repeated-side-effects rename_check.py {misc,bugprone}-lambda-function-name rename_check.py {misc,bugprone}-misplaced-widening-cast Reviewers: hokein, sammccall, aaron.ballman Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D43867 llvm-svn: 326327
* [WebAssembly] Fix copy-paste error in debugging stringNicholas Wilson2018-02-281-1/+1
| | | | llvm-svn: 326326
* [clangd] A few more fixes for STL header mapping.Eric Liu2018-02-281-1/+7
| | | | llvm-svn: 326325
* [analyzer] Fix a compiler warningGabor Horvath2018-02-281-1/+2
| | | | llvm-svn: 326324
* [analyzer] Support for naive cross translation unit analysisGabor Horvath2018-02-2823-51/+773
| | | | | | | | | | | | | | | | | | The aim of this patch is to be minimal to enable incremental development of the feature on the top of the tree. This patch should be an NFC when the feature is turned off. It is turned off by default and still considered as experimental. Technical details are available in the EuroLLVM Talk: http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#7 Note that the initial prototype was done by A. Sidorin et al.: http://lists.llvm.org/pipermail/cfe-dev/2015-October/045730.html Contributions to the measurements and the new version of the code: Peter Szecsi, Zoltan Gera, Daniel Krupp, Kareem Khazem. Differential Revision: https://reviews.llvm.org/D30691 llvm-svn: 326323
* [mips] Begin reworking instruction predicates for ISAs/encodings (1/N)Simon Dardis2018-02-283-22/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MIPS backend has inconsistent usage of instruction predicates for assembly and code generation. The issue arises from supporting three encodings, two (MIPS and microMIPS) of which have a near 1:1 instruction mapping across ISA revisions and a third encoding with a more restricted set of instructions (MIPS16e). To enforce consistent usage, each of the ISA_* adjectives has (or will have) the relevant encoding attached to it along the relevant ISA revision where the instruction is defined. Each instruction, pattern or alias will then have the correct ISA adjective attached to it, and the base instruction description classes will have any predicates relating to ISA encoding or revision removed. Pseudo instructions will also be guarded for the encoding or ABI that they are supported in. Finally, the hasStandardEncoding() / inMicroMipsMode() / inMips16Mode() methods of MipsSubtarget will be changed such that only one can be true at any one time. The result of this is that code generation and assembly will produce the correct encoding up front, while code generated from pseudo instructions and other inserted sequences of instructions will be able to rely on the mapping tables to produce the correct encoding. This should fix numerous bugs where the result 'happens' to be correct but has edge cases where microMIPS and MIPS have subtle differences (e.g. microMIPSR6 using 'j', 'jal' instructions.) This patch starts the process by changing most of the ISA adjectives to make use of the EncodingPredicate member of PredicateControl. Follow on patches will annotate instructions with their correct ISA adjective and eliminate the usage of "let Predicates = [..]", "let AdditionalPredicates = [..]" and "isCodeGenOnly = 1" in the cases where it was used to control instruction availability. Contributions from Nitesh Jain. Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D41434 llvm-svn: 326322
* [clang-tidy] Fix 'add_new_check.py --udpate-docs'Alexander Kornienko2018-02-281-0/+7
| | | | llvm-svn: 326321
* [GlobalIsel][X86] Support G_INTTOPTR instruction.Alexander Ivchenko2018-02-287-1/+167
| | | | | | | | | | | Add legalization/selection for x86/x86_64 and corresponding tests. Reviewed By: igorb Differential Revision: https://reviews.llvm.org/D43622 llvm-svn: 326320
* Fix typo. NFCXin Tong2018-02-281-1/+1
| | | | llvm-svn: 326319
* [MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed ↵Xin Tong2018-02-282-0/+70
| | | | | | | | | | | | | | | | | | | | | more than once. Summary: Fix a bug in MergeICmp that can lead to a BCECmp block being processed more than once and eventually lead to a broken LLVM module. The problem is that if the non-constant value is not produced by the last block, the producer will be processed once when the its parent block is processed and second time when the last block is processed. We end up having 2 same BCECmpBlock in the merge queue. And eventually lead to a broken LLVM module. Reviewers: courbet, davide Reviewed By: courbet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43825 llvm-svn: 326318
* [IR] - Make User construction exception safeKlaus Kretzschmar2018-02-282-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many instruction ctors that call the setName method of the Value base class, which can throw a bad_alloc exception in OOM situations. In such situations special User delete operators are called which are not implemented yet. Example: Lets look at the construction of a CallInst instruction during IR generation: static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args, .. ){ ... return new (TotalOps, DescriptorBytes) CallInst(Ty, Func, Args, Bundles, NameStr, InsertBefore); } CallInst::CalInst(Value* Func, ...) { ... Op<-1>() = Func; .... setName(name); // throws ... } Op<-1>() returns a reference to a Use object of the CallInst instruction and the operator= inserts this use object into the UseList of Func. The same object is removed from that UseList by calling the User::operator delete If the CallInst object is deleted. Since setName can throw a bad_alloc exception (if LLVM_ENABLE_EXCEPTIONS is switched on), the unwind chain runs into assertions ("Constructor throws?") in special User::operator deletes operators: operator delete(void* Usr, unsigned) operator delete(void* Usr, unsigned, bool) This situation can be fixed by simlpy calling the User::operator delete(void*) in these unimplemented methods. To ensure that this additional call succeeds all information that is necessary to calculate the storage pointer from the Usr address must be restored in the special case that a sublass has changed this information, e.g. GlobalVariable can change the NumberOfOperands. Reviewd by: rnk Differential Revision: https://reviews.llvm.org/D42731 llvm-svn: 326316
* [Dominators] Remove verifyDomTree and add some verifying for Post Dom TreesDavid Green2018-02-2815-104/+73
| | | | | | | | | | | | Removes verifyDomTree, using assert(verify()) everywhere instead, and changes verify a little to always run IsSameAsFreshTree first in order to print good output when we find errors. Also adds verifyAnalysis for PostDomTrees, which will allow checking of PostDomTrees it the same way we check DomTrees and MachineDomTrees. Differential Revision: https://reviews.llvm.org/D41298 llvm-svn: 326315
* [clang-tidy] Add a test for readability-implicit-bool-conversion with bitfields.Alexander Kornienko2018-02-281-0/+6
| | | | llvm-svn: 326314
* [clangd] Prefer the definition of a TagDecl (e.g. class) as ↵Eric Liu2018-02-284-86/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CanonicalDeclaration. Summary: Currently, we pick the first declaration of a symbol in a TU, which is considered canonical in the clangIndex, as the canonical declaration in clangd. This causes forward declarations that might appear in a random header to be used as a canonical declaration, which is not desirable for features like go-to-declaration or include insertion. For example, for class X, we would consider the forward declaration in fwd.h to be the canonical declaration, while the preferred canonical declaration should be the actual definition in x.h. ``` // fwd.h class X; // forward decl // x.h class X {}; ``` This patch fixes the issue by making symbol collector favor the actual definition of a TagDecl (i.e. class/struct/enum/union) found in a header file over the first seen declarations in a TU. Other symbol types like functions are not handled because using the first seen declarations as canonical declarations is usually a good heuristic for them. Reviewers: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43823 llvm-svn: 326313
* [OMPT] Fix inconsistent testcasesJoachim Protze2018-02-282-31/+31
| | | | | | | | | | | The main change of this patch is to insert {{.*}} in current_address=[[RETURN_ADDRESS_END]]. This is needed to match any of the alternatively printed addresses. Additionally, clang-format is applied to the two tests. Differential Revision: https://reviews.llvm.org/D43115 llvm-svn: 326312
* [GlobalIsel][X86] Support G_PTRTOINT instruction.Alexander Ivchenko2018-02-287-10/+682
| | | | | | | | | | | Add legalization/selection for x86/x86_64 and corresponding tests. Reviewed By: igorb Differential Revision: https://reviews.llvm.org/D43617 llvm-svn: 326311
* [clangd] A few minor fixes for STL internal header mapping.Eric Liu2018-02-281-4/+4
| | | | llvm-svn: 326310
* [RISCV] Update two tests after r326208Alex Bradbury2018-02-282-4/+4
| | | | llvm-svn: 326309
* [X86] Don't use EXTRACT_ELEMENT from v1i1 with i8/i32 result type when we ↵Craig Topper2018-02-287-54/+83
| | | | | | | | | | need to guarantee zeroes in the upper bits of return. An extract_element where the result type is larger than the scalar element type is semantically an any_extend of from the scalar element type to the result type. If we expect zeroes in the upper bits of the i8/i32 we need to mae sure those zeroes are explicit in the DAG. For these cases the best way to accomplish this is use an insert_subvector to pad zeroes to the upper bits of the v1i1 first. We extend to either v16i1(for i32) or v8i1(for i8). Then bitcast that to a scalar and finish with a zero_extend up to i32 if necessary. We can't extend past v16i1 because that's the largest mask size on KNL. But isel is smarter enough to know that a zext of a bitcast from v16i1 to i16 can use a KMOVW instruction. The insert_subvectors will be dropped during isel because we can determine that the producing instruction already zeroed the upper bits of the k-register. llvm-svn: 326308
* [ObjC] Allow declaring __strong pointer fields in structs in Objective-CAkira Hatanaka2018-02-2827-97/+1917
| | | | | | | | | | | | | | | | | | | | | ARC mode. Declaring __strong pointer fields in structs was not allowed in Objective-C ARC until now because that would make the struct non-trivial to default-initialize, copy/move, and destroy, which is not something C was designed to do. This patch lifts that restriction. Special functions for non-trivial C structs are synthesized that are needed to default-initialize, copy/move, and destroy the structs and manage the ownership of the objects the __strong pointer fields point to. Non-trivial structs passed to functions are destructed in the callee function. rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D41228 llvm-svn: 326307
* [X86] Change the masked FPCLASS implementation to use AND instead of OR to ↵Craig Topper2018-02-282-10/+8
| | | | | | | | | | | | | | | | | | | | | | combine the mask results. While the description for the instruction does mention OR, its talking about how the individual classification test results are ORed together. The incoming mask is used as a zeroing write mask. If the bit is 1 the classification is written to the output. The bit is 0 the output is 0. This equivalent to an AND. Here is pseudocode from the intrinsics guide FOR j := 0 to 1 i := j*64 IF k1[j] k[j] := CheckFPClass_FP64(a[i+63:i], imm8[7:0]) ELSE k[j] := 0 FI ENDFOR k[MAX:2] := 0 llvm-svn: 326306
* [ELF] Process linker scripts deeper when declaring symbols.Igor Kudrin2018-02-283-15/+39
| | | | | | | | We should process symbols inside output section declarations the same way as top-level ones. Differential Revision: https://reviews.llvm.org/D43008 llvm-svn: 326305
* [ARM] Cortex-A57 scheduler fix for ARM backend (missed 16-bit, ↵Andrew Zhogin2018-02-281-5/+33
| | | | | | | | | | | | v8.1/v8.2/v8.3, thumb and pseudo instructions) Added missed scheduling info for ARM Cortex A57 (AArch32) to have CompleteModel with this checkCompleteness fix: https://reviews.llvm.org/D43235. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D43808 llvm-svn: 326304
* [SLP] Added new tests and updated existing for jumbled load, NFC.Mohammad Shahid2018-02-284-6/+468
| | | | llvm-svn: 326303
* Add EmulateInstructionPPC64.cpp to xcode project file.Jason Molenda2018-02-281-0/+15
| | | | llvm-svn: 326302
* [WebAssembly] Fix variable name.Rui Ueyama2018-02-281-1/+1
| | | | llvm-svn: 326301
* [WebAssembly] Remove unnecessary namespace specifiers. NFC.Rui Ueyama2018-02-281-2/+2
| | | | llvm-svn: 326300
* Fix a couple of cases where we would fail to correctly parse deduced class ↵Richard Smith2018-02-2811-27/+161
| | | | | | | | | | | | | | | | template specialization types. Specifically, we would not properly parse these types within template arguments (for non-type template parameters), and in tentative parses. Fixing both of these essentially requires that we parse deduced template specialization types as types in all contexts, even in template argument lists -- in particular, tentative parsing may look ahead and annotate a deduced template specialization type before we figure out that we're actually supposed to treat the tokens as a template-name. We deal with this by simply permitting deduced template specialization types when parsing template arguments, and converting them to template template arguments. llvm-svn: 326299
* Update cxx_status to mark "SVN" items as "Clang 6" instead.Richard Smith2018-02-282-6/+9
| | | | llvm-svn: 326298
* [WebAssembly] Simplify initializeSymbols and merge it with ObjFile::parse. NFC.Rui Ueyama2018-02-282-70/+43
| | | | | | | | | | | This patch simplifies initializeSymbols. Since that function is called at the tail context of ObjFile::parse, and the function is called only once from that function, that's effectively just a continuation of ObjFile::parse. So this patch merge it with ObjFile::parse. Differential Revision: https://reviews.llvm.org/D43848 llvm-svn: 326296
* [analyzer] [tests] Write to logfile instead of stdout while updatingGeorge Karpenkov2018-02-281-17/+18
| | | | | | reference results llvm-svn: 326295
* [WebAssembly] Add test for `--undefined` flag. NFC.Sam Clegg2018-02-281-2/+3
| | | | | | | | | Specifically the case where the undefined symbol is not found during the link. Differential Revision: https://reviews.llvm.org/D43846 llvm-svn: 326294
* [WebAssembly] Simplify Symbol::getWasmType. NFC.Rui Ueyama2018-02-281-10/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D43717 llvm-svn: 326293
* [StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2018-02-2810-208/+303
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 326292
* [WebAssembly] Inline translateVA as it's trivial.Rui Ueyama2018-02-283-11/+3
| | | | | | | | | | | The problem I want to address now is that chunks have too many data members for "offsets", and their origins are not well defined. For example, InputSegment has OutputSegmentOffset, but it's base class also has OutputOffset. That's very confusing. Differential Revision: https://reviews.llvm.org/D43726 llvm-svn: 326291
* [RuntimeDyld][MachO] Support ARM64_RELOC_BRANCH26 for BL instructions byLang Hames2018-02-282-2/+11
| | | | | | relaxing an assertion. llvm-svn: 326290
* [WebAssembly] Remove ELF-ness.Rui Ueyama2018-02-281-10/+6
| | | | | | | | | These output section names are ELF-specific. We shouldn't have this rule for WebAssembly. Differential Revision: https://reviews.llvm.org/D43712 llvm-svn: 326289
* update_mir_test_checks: Use the regexes from UpdateTestChecks.commonJustin Bogner2018-02-282-18/+17
| | | | | | | | | Some of the update_*_test_checks regexes have been moved into a library, so we might as well use them in update_mir_test_checks. Also includes minor bugfixes to the regexes that are there so we don't regress update_mir_test_checks llvm-svn: 326288
* [ELF] Rename test/ELF/note-loadaddr.c to .s NFCFangrui Song2018-02-281-0/+0
| | | | llvm-svn: 326287
* [WebAssembly] Do not use inheritance to define SubSection.Rui Ueyama2018-02-283-60/+58
| | | | | | | | | | | | | | SubSection inherited from SyntheticSection, and SyntheticSection inherits from OutputSection, so SubSection was an OutputSection. But that's wrong because SubSection is not actually a WebAssembly output section. It shares some functionalities with OutputSection, but overall it's very different. This patch removes that inheritance. Differential Revision: https://reviews.llvm.org/D43719 llvm-svn: 326286
* [WebAssembly] Refactor ObjFile::initializeSymbols.Rui Ueyama2018-02-282-66/+47
| | | | | | | | The main purpose of this change is to make initializeSymbols shorter. Differential Revision: https://reviews.llvm.org/D43691 llvm-svn: 326285
* update_mir_test_checks: Drop support for vreg block checksJustin Bogner2018-02-281-24/+9
| | | | | | | | | | Since vregs are printed in the instruction stream now, checking the vreg block is always redundant. Remove the temporary feature that allowed us to do that. This reverts r316134 llvm-svn: 326284
* [WebAssembly] Do not use Subsection as a local variable name.Rui Ueyama2018-02-281-40/+39
| | | | | | | | That variable hides the class of the same name. Differential Revision: https://reviews.llvm.org/D43718 llvm-svn: 326283
OpenPOWER on IntegriCloud