summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Support of no_caller_saved_registers attributeOren Ben Simhon2017-05-037-49/+167
| | | | | | | | | This patch implements the LLVM part for no_caller_saved_registers attribute as appears here: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5ed3cc7b66af4758f7849ed6f65f4365be8223be. In order to implement the attribute, we use the dynamic CSR mechanism to remove returned/passed arguments from the function regmask/CSR list. Differential Revision: https://reviews.llvm.org/D31876 llvm-svn: 302020
* Support arbitrary address space pointers in masked gather/scatter intrinsics.Elad Cohen2017-05-0319-171/+556
| | | | | | | | | | | | Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a non-default address space pointer we fail with a "Calling a function with a bad singature!" assertion. This patch solves this by adding the 'vector of pointers' argument as an overloaded type which will determine the address space. Differential revision: https://reviews.llvm.org/D31490 llvm-svn: 302018
* [AVR] Reserve the Y register in all functionsDylan McKay2017-05-034-10/+15
| | | | llvm-svn: 302017
* [analyzer] Fix memory error bug category capitalization.Artem Dergachev2017-05-0311-44/+50
| | | | | | | | | | | | It was written as "Memory Error" in most places and as "Memory error" in a few other places, however it is the latter that is more consistent with other categories (such as "Logic error"). rdar://problem/31718115 Differential Revision: https://reviews.llvm.org/D32702 llvm-svn: 302016
* [Loop Deletion] Delete loops that are never executedAnna Thomas2017-05-032-14/+426
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, loop deletion deletes loop where the only values that are used outside the loop are loop-invariant. This patch adds logic to delete loops where the loop is proven to be never executed (i.e. the only predecessor of the loop preheader has a constant conditional branch as terminator, and the preheader is not the taken target). This will remove loops that become dead after loop-unswitching generates constant conditional branches. The next steps are: 1. moving the loop deletion implementation to LoopUtils. 2. Add logic in loop-simplifyCFG which will support changing conditional constant branches to unconditional branches. If loops become unreachable in this process, they can be removed using `deleteDeadLoop` function. Reviewers: chandlerc, efriedma, sanjoy, reames Reviewed by: sanjoy Subscribers: mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D32494 llvm-svn: 302015
* Revert "[AVR] Enable the frame pointer for all functions"Dylan McKay2017-05-031-3/+2
| | | | | | This reverts commit 358ad02d999e88853d2cfc954bd2f668308a51f7. llvm-svn: 302014
* Windows fix for TestConflictingDefinition makefilePavel Labath2017-05-031-1/+1
| | | | | | | | | | gnuwin32 rm does not like wildcards that match nothing even if we specify -f (probably because the wildcard expansion happens in-process there). We could use make $(wildcard) here, but it seems safer to explicitly list the files here, just like the normal Makefile.rules does. llvm-svn: 302013
* Undo turning ExtBehavior into a bitfield.Daniel Jasper2017-05-031-1/+1
| | | | | | | | | | | | | | | | | | This produces warnings that I can't explain in a GCC build: In file included from ../tools/clang/include/clang/Lex/LexDiagnostic.h:13:0, from /usr/local/google/home/djasper/llvm/tools/clang/lib/Lex/PTHLexer.cpp:19: ../tools/clang/include/clang/Basic/Diagnostic.h:219:34: warning: ‘clang::DiagnosticsEngine::DiagState::ExtBehavior’ is too small to hold all values of ‘enum class clang::diag::Severity’ [enabled by default] diag::Severity ExtBehavior : 4; // Map extensions to warnings or errors? ^ While I don't think this warning makes sense, I'd like to get this back to being warning-free. This only seems to trigger for "enum class". Reproducer: https://godbolt.org/g/P2ekVd llvm-svn: 302012
* [Triple] Add a "macos" OS type that acts as a synonym for "macosx"Alex Lorenz2017-05-032-1/+4
| | | | | | | | | | | The "macosx" OS type is still the canonical type. In the future "macos" will become the canonical OS type (but we will still support "macosx"). rdar://27043820 Differential Revision: https://reviews.llvm.org/D32748 llvm-svn: 302011
* [X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.Simon Pilgrim2017-05-031-7/+9
| | | | | | Pre-commit as requested in D32769. llvm-svn: 302010
* Fix tests after speculatable intrinsics patchDaniel Jasper2017-05-031-541/+541
| | | | | | These were relying on the attribute group numbering llvm-svn: 302009
* Check for lack of C++ context first when demanglingPavel Labath2017-05-031-18/+17
| | | | | | | | | | | | | | | Summary: It seems that if we have no context, then it can't possibly be a method. Check that first. Reviewers: clayborg Reviewed By: clayborg Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D32708 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 302008
* [ELF] Fix problems with fabricateDefaultCommands() and --section-startPeter Smith2017-05-033-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | The --section-start <name>=<address> needs to be translated into equivalent linker script commands. There are a couple of problems with the existing implementation: - The --section-start with the lowest address is assumed to be at the start of the map. This assumption is incorrect, we have to iterate through the SectionStartMap to find the lowest address. - The addresses in --section-start were being over-aligned when the sections were marked as PageAlign. This is inconsistent with the use of SectionStartMap in fixHeaders(), and can cause problems when the PageAlign causes an "unable to move location counter backward" error when the --section-start with PageAlign is aligned to an address higher than the next --section-start. The ld.bfd and ld.gold seem to be more consistent with this approach but this is not a well specified area. This change fixes the problems above and also corrects a typo in which fabricateDefaultCommands() is called with the wrong parameter, it should be called with AllocateHeader not Config->MaxPageSize. Differential Revision: https://reviews.llvm.org/D32749 llvm-svn: 302007
* [ELF] - Added testcase gdb-index-ranges.s (https://reviews.llvm.org/D32750)George Rimar2017-05-031-0/+66
| | | | | | | | | | | | | Before rL301170 was landed, LLD did not produce correct entries in .gdb_index address area. Issue was fixed on LLVM DWARF parsers side and was relative to how .debug_ranges section was scanned. It was main problem of PR32319. It makes sense to have testcase on LLD size too. This checks that we generate proper values now, because we do not have any tests for .gdb_index which works with .debug_ranges atm. Differential revision: https://reviews.llvm.org/D32750 llvm-svn: 302006
* [ScopInfo] Remove code not needed anymore after r302004Tobias Grosser2017-05-033-9/+4
| | | | llvm-svn: 302005
* [ScopInfo] Do not add array name into memory reference idsTobias Grosser2017-05-036-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Before this change a memory reference identifier had the form: <STMT>_<ACCESSTYPE><ID>_<MEMREF>, e.g., Stmt_bb9_Write0_MemRef_tmp11 After this change, we use the format: <STMT>_<ACCESSTYPE><ID>, e.g., Stmt_bb9_Write0 The name of the array that is accessed through a memory reference is not necessary to uniquely identify a memory reference, but was only added to provide additional information for debugging. We drop this information now for the following two reasons: 1) This shortens the names and consequently improves readability 2) This removes a second location where we decide on the name of a scop array, leaving us only with the location where the actual scop array is created. Having after 2) only a single location to name scop arrays will allow us to change the naming convention of scop arrays more easily, which we will do in a future commit to reduce compilation time. llvm-svn: 302004
* Silences gcc's -Wnarrowing.Daniel Jasper2017-05-031-2/+3
| | | | | | | | | I think this is a false positive in GCC's warning, but nonetheless, we should try to be warning-free. Smaller reproducer (reproduces with GCC 6.3): https://godbolt.org/g/cJuO2z llvm-svn: 302003
* Revert r301986 (and subsequent r301987).Daniel Jasper2017-05-0319-476/+110
| | | | | | | | | The patch is failing to add StringTableStreamBuilder.h, but that isn't even discovered because the corresponding StringTableStreamBuilder.cpp isn't added to any CMakeLists.txt file and thus never built. I think this patch is just incomplete. llvm-svn: 302002
* [sanitizer] Intercept mcheck and mprobe on LinuxMaxim Ostapenko2017-05-034-0/+71
| | | | | | | | | This patch addresses https://github.com/google/sanitizers/issues/804. Users can use mcheck and mprobe functions to verify heap state so we should intercept them to avoid breakage of valid code. Differential Revision: https://reviews.llvm.org/D32589 llvm-svn: 302001
* Revert rL301998: "Fix a bug that -isysroot is completely ignored on Unix"Yuka Takahashi2017-05-032-5/+1
| | | | | | | | This reverts commit because it broke sanitizer-x86_64-linux-autoconf bot and clang-ppc64be-linux-multistage bot. llvm-svn: 302000
* Fix use after free in BinaryStream library.Zachary Turner2017-05-0312-116/+198
| | | | | | | | | | | | | | | This was reported by the ASAN bot, and it turned out to be a fairly fundamental problem with the design of VarStreamArray and the way it passes context information to the extractor. The fix was cumbersome, and I'm not entirely pleased with it, so I plan to revisit this design in the future when I'm not pressed to get the bots green again. For now, this fixes the issue by storing the context information by value instead of by reference, and introduces some impossibly-confusing template magic to make things "work". llvm-svn: 301999
* Fix a bug that -isysroot is completely ignored on UnixYuka Takahashi2017-05-032-1/+5
| | | | | | | | | | | | -isysroot is the flag which set the system root directory. This bug report https://bugs.llvm.org//show_bug.cgi?id=11503 shows that -isysroot is not handled at all on Unix, so fixed this bug. After this diff, I could get this result https://pastebin.com/TeCmn9mj . Differential Revision: https://reviews.llvm.org/D31495 llvm-svn: 301998
* Fix tests after speculatable intrinsics patchMatt Arsenault2017-05-035-1031/+1031
| | | | | | These were relying on the attribute group numbering llvm-svn: 301996
* Replace hardcoded intrinsic list with speculatable attribute.Matt Arsenault2017-05-0312-89/+44
| | | | | | No change in which intrinsics should be speculated. llvm-svn: 301995
* [sanitizer-coverage] add a deprecation warning to the old sanitizer-coverage ↵Kostya Serebryany2017-05-032-16/+22
| | | | | | flag combinations llvm-svn: 301994
* Fixed a bug where we did not properly use the complete versions of ↵Sean Callanan2017-05-0310-2/+136
| | | | | | | | | | Objective-C classes. Also added a test case, thanks to Greg Clayton. <rdar://problem/18913551> llvm-svn: 301993
* [modules] Round-trip -Werror flag through explicit module build.Richard Smith2017-05-0310-108/+178
| | | | | | | | | | | | | | | The intent for an explicit module build is that the diagnostics produced within the module are those that were configured when the module was built, not those that are enabled within a user of the module. This includes diagnostics that don't actually show up until the module is used (for instance, diagnostics produced during template instantiation and weird cases like -Wpadded). We serialized and restored the diagnostic state for individual warning groups, but previously did not track the state for flags like -Werror and -Weverything, which are implemented as separate bits rather than as part of the diagnostics mapping information. llvm-svn: 301992
* Revert r295861, "[ModuleSummaryAnalysis] Don't crash when referencing ↵Peter Collingbourne2017-05-032-16/+0
| | | | | | | | | unnamed globals." We should always expect values to be named before running the module summary analysis (see NameAnonGlobals pass), so it's fine if we crash in that case. llvm-svn: 301991
* [PowerPC, DAGCombiner] Fold a << (b % (sizeof(a) * 8)) back to a single ↵Tim Shen2017-05-034-39/+49
| | | | | | | | | | | | | | | | instruction Summary: This is the corresponding llvm change to D28037 to ensure no performance regression. Reviewers: bogner, kbarton, hfinkel, iteratee, echristo Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D28329 llvm-svn: 301990
* [ODRHash] Add support for array and decayed types, and parameter names and ↵Richard Trieu2017-05-024-33/+346
| | | | | | types. llvm-svn: 301989
* [ubsan] Skip overflow checks on safe arithmetic (fixes PR32874)Vedant Kumar2017-05-022-8/+139
| | | | | | | | | | | | | | | | | | | | | | | | Currently, ubsan emits overflow checks for arithmetic that is known to be safe at compile-time, e.g: 1 + 1 => CheckedAdd(1, 1) This leads to breakage when using the __builtin_prefetch intrinsic. LLVM expects the arguments to @llvm.prefetch to be constant integers, and when ubsan inserts unnecessary checks on the operands to the intrinsic, this contract is broken, leading to verifier failures (see PR32874). Instead of special-casing __builtin_prefetch for ubsan, this patch fixes the underlying problem, i.e that clang currently emits unnecessary overflow checks. Testing: I ran the check-clang and check-ubsan targets with a stage2, ubsan-enabled build of clang. I added a regression test for PR32874, and some extra checking to make sure we don't regress runtime checking for unsafe arithmetic. The existing ubsan-promoted-arithmetic.cpp test also provides coverage for this change. llvm-svn: 301988
* Fix type conversion error.Zachary Turner2017-05-021-1/+1
| | | | llvm-svn: 301987
* Make codeview::StringTable.Zachary Turner2017-05-0219-110/+476
| | | | | | | | | | | | | | | | | | | | Previously we had knowledge of how to serialize and deserialize a string table inside of DebugInfo/PDB, but the string table that it serializes contains a piece that is actually considered CodeView and can appear outside of a PDB. We already have logic in llvm-readobj and MCCodeView to read and write this format, so it doesn't make sense to duplicate the logic in DebugInfoPDB as well. This patch makes codeview::StringTable (for writing) and codeview::StringTableRef (for reading), updates DebugInfoPDB to use these classes for its own writing, and updates llvm-readobj to additionally use StringTableRef for reading. It's a bit more difficult to get MCCodeView to use this for writing, but it's a logical next step. llvm-svn: 301986
* Typo in LangRef.rst. NFCXin Tong2017-05-021-1/+1
| | | | llvm-svn: 301985
* Add line table verification to lldb-dwarfdump --verifyGreg Clayton2017-05-024-77/+251
| | | | | | | | | | | | This patch verifies the .debug_line: - verify all addresses in a line table sequence have ascending addresses - verify that all line table file indexes are valid Unit tests added for both cases. Differential Revision: https://reviews.llvm.org/D32765 llvm-svn: 301984
* ARM: avoid handing a deleted node back to TableGen during ISel.Tim Northover2017-05-022-0/+21
| | | | | | | | | | When we replaced the multiplicand the destination node might already exist. When that happens the original gets CSEd and deleted. However, it's actually used as the offset so nonsense is produced. Should fix PR32726. llvm-svn: 301983
* Remove a dead function declaration.Rui Ueyama2017-05-021-2/+0
| | | | llvm-svn: 301982
* Re-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of ↵Reid Kleckner2017-05-0215-114/+57
| | | | | | | | | | AttributeList" This time, I fixed, built, and tested clang. This reverts r301712. llvm-svn: 301981
* [AArch64] ILP32 Backend Relocation SupportJoel Jones2017-05-0219-192/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and TLSDESC_ADD_LO12 relocations Rearrange ordering in AArch64.def to follow relocation encoding Fix name: R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC Add support for several "TLS", "TLSGD", and "TLSLD" relocations for ILP32 Fix return values from isNonILP32reloc Add implementations for R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC, R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC, *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC, *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC Modify error messages to give name of equivalent relocation in the ABI not being used, along with better checking for non-existent requested relocations. Added assembler support for "pg_hi21_nc" Relocation definitions added without implementations: R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21, R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21, R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19, R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC Fix encoding: R_AARCH64_P32_TLSDESC_ADR_PAGE21 Reviewers: Peter Smith Patch by: Joel Jones (jjones@cavium.com) Differential Revision: https://reviews.llvm.org/D32072 llvm-svn: 301980
* Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12Joel Jones2017-05-021-14/+14
| | | | llvm-svn: 301979
* [DWARFv5] Parse new line-table header format.Paul Robinson2017-05-025-24/+295
| | | | | | | | | | | | The directory and file tables now have form-based content descriptors. Parse these and extract the per-directory/file records based on the descriptors. For now we support only DW_FORM_string (inline) for the path names; follow-up work will add support for indirect forms (i.e., DW_FORM_strp, strx<N>, and line_strp). Differential Revision: http://reviews.llvm.org/D32713 llvm-svn: 301978
* revert r301766: InstructionSimplify: Canonicalize shuffle operands. NFC-ishSanjay Patel2017-05-021-29/+20
| | | | | | | | | | | | Turns out this wasn't NFC-ish at all because there's a bug processing shuffles that change the size of their input vectors (that case always seems to trip us up). This should fix PR32872 while we investigate how it failed and reduce a testcase: https://bugs.llvm.org/show_bug.cgi?id=32872 llvm-svn: 301977
* [asan] Mark some more testcases as unsupported on iOS.Kuba Mracek2017-05-025-0/+5
| | | | llvm-svn: 301976
* Fix typo.Rui Ueyama2017-05-021-1/+1
| | | | llvm-svn: 301975
* [NewGVN] Fix typo and format comment. NFCI.Davide Italiano2017-05-021-7/+4
| | | | llvm-svn: 301974
* [NFC] Add original test that triggered crash post r301735 Faisal Vali2017-05-021-1/+13
| | | | | | - this is added just for completeness sake (though the general case should be represented by the test added in the revision to that patch: https://reviews.llvm.org/rL301972 ) llvm-svn: 301973
* Fix PR32831 (Try Again): 'this' capture while instantiating generic lambda ↵Faisal Vali2017-05-022-245/+339
| | | | | | | | | | | | | | | | | | | | | | | call operator specialization When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda. https://bugs.llvm.org/show_bug.cgi?id=32831 This patch was initially committed here: https://reviews.llvm.org/rL301735 Then reverted here: https://reviews.llvm.org/rL301916 The issue with the original patch was a failure to check that the closure type has been created within the LambdaScopeInfo before querying its DeclContext - instead of just assuming it has (silly!). A reduced example such as this highlights the problem: struct X { int data; auto foo() { return [] { return [] -> decltype(data) { return 0; }; }; } }; When 'data' within decltype(data) tries to determine the type of 'this', none of the LambdaScopeInfo's have their closure types created at that point. llvm-svn: 301972
* Verify that all references point to actual DIEs in "llvm-dwarfdump --verify"Greg Clayton2017-05-024-84/+204
| | | | | | | | | | LTO and other fancy linking previously led to DWARF that contained invalid references. We already validate that CU relative references fall into the CU, and the DW_FORM_ref_addr references fall inside the .debug_info section, but we didn't validate that the references pointed to correct DIE offsets. This new verification will ensure that all references refer to actual DIEs and not an offset in between. This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any offset, it would match the DIE that mathes the offset _or_ the next DIE. This has been fixed. Differential Revision: https://reviews.llvm.org/D32722 llvm-svn: 301971
* [Sema] Update function doc; NFCGeorge Burgess IV2017-05-021-1/+1
| | | | llvm-svn: 301970
* Revert "Fix misnamed #include. Remove _NC suffix from ELF relocations ↵Rafael Espindola2017-05-022-15/+15
| | | | | | | | TLSDESC_{LD64,ADD}_LO12" This reverts commit r301964. It broke the build. llvm-svn: 301969
OpenPOWER on IntegriCloud