summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove trailing `;`. NFC.Michael Liao2020-01-141-1/+1
|
* [AArch64][GlobalISel]: Support @llvm.{return,frame}address selection.Amara Emerson2020-01-143-1/+80
| | | | | | | | | These intrinsics expand to a variable number of instructions so just like in ISelLowering.cpp we use custom code to deal with them. Committing Tim's original patch. Differential Revision: https://reviews.llvm.org/D65656
* [Driver][test] Fix Driver/hexagon-toolchain-elf.c for ↵Fangrui Song2020-01-141-1/+2
| | | | | | | | -DCLANG_DEFAULT_LINKER=lld builds Reviewed By: nathanchance, sidneym Differential Revision: https://reviews.llvm.org/D72668
* [LegalizeTypes] Remove untested code from ExpandIntOp_UINT_TO_FPCraig Topper2020-01-141-70/+2
| | | | | | This code is untested in tree because the "APFloat::semanticsPrecision(sem) >= SrcVT.getSizeInBits() - 1" check is false for most combinations for int and fp types except maybe i32 and f64. For that you would need i32 to be an illegal type, but f64 to be legal and have custom handling for legalizing the split sint_to_fp. The precision check itself was added in 2010 to fix a double rounding issue in the algorithm that would occur if the sint_to_fp was not able to do the conversion without rounding. Differential Revision: https://reviews.llvm.org/D72728
* [GVN] fix comment/argument name to match actual implementation. NFCFedor Sergeev2020-01-151-2/+2
|
* [clang][test][NFC] Use more widely supported sanitizer for file dependency testsJan Korous2020-01-142-6/+6
| | | | | | | | The tests aren't concerned at all by the actual sanitizer - only by blacklist being reported as a dependency. We're unfortunately limited by platform support for any particular sanitizer but we can at least use one that is widely supported. Post-commit review: https://reviews.llvm.org/D72729
* [InstCombine] Fix worklist management when removing guard intrinsicNikita Popov2020-01-142-11/+11
| | | | | | | | | | | | | When multiple guard intrinsics are merged into one, currently the result of eraseInstFromFunction() is returned -- however, this should only be done if the current instruction is being removed. In this case we're removing a different instruction and should instead report that the current one has been modified by returning it. For this test case, this reduces the number of instcombine iterations from 5 to 2 (the minimum possible). Differential Revision: https://reviews.llvm.org/D72558
* [DebugInfo] Add option to clang to limit debug info that is emitted for classes.Amy Huang2020-01-142-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an option to limit debug info by only emitting complete class type information when its constructor is emitted. This applies to classes that have nontrivial user defined constructors. I implemented the option by adding another level to `DebugInfoKind`, and a flag `-flimit-debug-info-constructor`. Total object file size on Windows, compiling with RelWithDebInfo: before: 4,257,448 kb after: 2,104,963 kb And on Linux before: 9,225,140 kb after: 4,387,464 kb According to the Windows clang.pdb files, here is a list of types that are no longer complete with this option enabled: https://reviews.llvm.org/P8182 Reviewers: rnk, dblaikie Subscribers: aprantl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72427
* [analyzer] Fix SARIF column locationsJoe Ranieri2020-01-144-27/+141
| | | | Differential revision: https://reviews.llvm.org/D70689
* dotest.py: Add option to pass extra lldb settings to dotestAdrian Prantl2020-01-143-9/+28
| | | | | | | The primary motivation for this is to add another dimension to the Swift LLDB test matrix, but this seems generally useful. Differential Revision: https://reviews.llvm.org/D72662
* [libcxx] [Windows] Make a more proper implementation of strftime_l for mingw ↵Martin Storsjö2020-01-142-1/+10
| | | | | | | | | | | | | | | | with msvcrt.dll This also makes this function consistent with the rest of the libc++ provided fallbacks. The locale support in msvcrt.dll is very limited anyway; it can only be configured processwide, not per thread, and it only seems to support the locales "C" and "" (the user set locale), so it's hard to make any meaningful automatic test for it. But manually tested, this change does make time formatting locale code in libc++ output times in the user requested format, when using locale "". Differential Revision: https://reviews.llvm.org/D69554
* [SVE] Add patterns for MUL immediate instruction.Danilo Carvalho Grael2020-01-145-2/+113
| | | | | | | | | | | | Summary: Add the missing MUL pattern for integer immediate instructions. Reviewers: sdesmalen, huntergr, efriedma, c-rhodes, kmclaughlin Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits, amehsan Tags: #llvm Differential Revision: https://reviews.llvm.org/D72654
* [Driver] Ignore -fno-semantic-interpositionFangrui Song2020-01-142-0/+2
| | | | | | | | | | | | | | | | | | Fedora wants to build projects with -fno-semantic-interposition (e.g. https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup), which is supported by GCC>=5. Clang's current behavior is similar to -fno-semantic-interposition and the end goal is to make it more so (https://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html). Ignore this option. We should let users know -fsemantic-interposition is not currently supported, so it should remain a hard error. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D72724
* [OpenMP][Tool] Runtime warning for missing TSan-optionJoachim Protze2020-01-142-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | TSan spuriously reports for any OpenMP application a race on the initialization of a runtime internal mutex: ``` Atomic read of size 1 at 0x7b6800005940 by thread T4: #0 pthread_mutex_lock <null> (a.out+0x43f39e) #1 __kmp_resume_64 <null> (libomp.so.5+0x84db4) Previous write of size 1 at 0x7b6800005940 by thread T7: #0 pthread_mutex_init <null> (a.out+0x424793) #1 __kmp_suspend_initialize_thread <null> (libomp.so.5+0x8422e) ``` According to @AndreyChurbanov this is a false positive report, as the control flow of the runtime guarantees the ordering of the mutex initialization and the lock: https://software.intel.com/en-us/forums/intel-open-source-openmp-runtime-library/topic/530363 To suppress this report, I suggest the use of TSAN_OPTIONS='ignore_uninstrumented_modules=1'. With this patch, a runtime warning is provided in case an OpenMP application is built with Tsan and executed without this Tsan-option. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D70412
* [NewPM] Port MergeFunctions passNikita Popov2020-01-147-16/+70
| | | | | | | | | | This ports the MergeFunctions pass to the NewPM. This was rather straightforward, as no analyses are used. Additionally MergeFunctions needs to be conditionally enabled in the PassBuilder, but I left that part out of this patch. Differential Revision: https://reviews.llvm.org/D72537
* [OPENMP]Improve handling of possibly incorrectly mapped types.Alexey Bataev2020-01-142-12/+41
| | | | | Need to analayze the type of the expression for mapping, not the type of the declaration.
* [InstCombine] Fix infinite loop due to bitcast <-> phi transformsNikita Popov2020-01-142-3/+200
| | | | | | | | | | | | | | | | | Fix for https://bugs.llvm.org/show_bug.cgi?id=44245. The optimizeBitCastFromPhi() and FoldPHIArgOpIntoPHI() end up fighting against each other, because optimizeBitCastFromPhi() assumes that bitcasts of loads will get folded. This doesn't happen here, because a dangling phi node prevents the one-use fold in https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp#L620-L628 from triggering. This patch fixes the issue by explicitly performing the load combine as part of the bitcast of phi transform. Other attempts to force the load to be combined first were ultimately too unreliable. Differential Revision: https://reviews.llvm.org/D71164
* [InstCombine] Make combineLoadToNewType a method; NFCNikita Popov2020-01-142-13/+15
| | | | | So it can be reused as part of other combines. In particular for D71164.
* [InstCombine] Fix user iterator invalidation in bitcast of phi transformNikita Popov2020-01-142-9/+9
| | | | | | | | | This fixes the issue encountered in D71164. Instead of using a range-based for, manually iterate over the users and advance the iterator beforehand, so we do not skip any users due to iterator invalidation. Differential Revision: https://reviews.llvm.org/D72657
* [InstCombine] Add test for iterator invalidation bug; NFCNikita Popov2020-01-141-0/+36
|
* [nfc][libomptarget] Refactor nvptx/target_impl.cuJon Chesterfield2020-01-141-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [nfc][libomptarget] Refactor nxptx/target_impl.cu Use __kmpc_impl_atomic_add instead of atomicAdd to match the rest of the file. Alternatively, target_impl.cu could use the cuda functions directly. Using a mixture in this file was an oversight, happy to resolve in either direction. Removed some comments that look outdated. Call __kmpc_impl_unset_lock directly to avoid a redundant diagnostic and remove an implict dependency on interface.h. Reviewers: ABataev, grokos, jdoerfert Reviewed By: jdoerfert Subscribers: jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72719
* [nfc][libomptarget] Refactor amdgcn target_implJon Chesterfield2020-01-143-60/+57
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [nfc][libomptarget] Refactor amdgcn target_impl Removes references to internal libraries from the header Standardises on C++ mangling for all the target_impl functions Update comment block clang-format Move some functions into a new target_impl.hip source file This lays the groundwork for implementing the remaining unresolved symbols in the target_impl.hip source. Reviewers: jdoerfert, grokos, ABataev, ronlieb Reviewed By: jdoerfert Subscribers: jvesely, mgorny, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72712
* Fix NetBSD bot after b4a99a061f517e60985667e39519f60186cbb469 ↵Alexandre Ganea2020-01-141-1/+1
| | | | ([Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation)
* [InstCombine] add test for possible cast-of-select transform; NFCSanjay Patel2020-01-141-0/+18
|
* [MachineScheduler] Reduce reordering due to mem op clusteringJay Foad2020-01-1422-114/+117
| | | | | | | | | | | | | | | | | | | | | | Summary: Mem op clustering adds a weak edge in the DAG between two loads or stores that should be clustered, but the direction of this edge is pretty arbitrary (it depends on the sort order of MemOpInfo, which represents the operands of a load or store). This often means that two loads or stores will get reordered even if they would naturally have been scheduled together anyway, which leads to test case churn and goes against the scheduler's "do no harm" philosophy. The fix makes sure that the direction of the edge always matches the original code order of the instructions. Reviewers: atrick, MatzeB, arsenm, rampitec, t.p.northover Subscribers: jvesely, wdng, nhaehnle, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72706
* [lldb/test] test_breakpoints_func_full from ↵Stella Stamenova2020-01-141-1/+0
| | | | | | TestNamespace.NamespaceBreakpointTestCase is now passing on Windows After https://reviews.llvm.org/D70846, the test is now passing on Windows
* [gn build] Port 36fcbb838c8LLVM GN Syncbot2020-01-141-0/+1
|
* Added readability-qualified-auto checkNathan James2020-01-1411-0/+713
| | | | | | | | Adds a check that detects any auto variables that are deduced to a pointer or a const pointer then adds in the const and asterisk according. Will also check auto L value references that could be written as const. This relates to the coding standard https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto
* [RISCV] Allow shrink wrapping for RISC-Vlewis-revill2020-01-142-4/+113
| | | | | | | | | Enabling shrink wrapping requires ensuring the insertion point of the epilogue is correct for MBBs without a terminator, in which case the instruction to adjust the stack pointer is the last instruction in the block. Differential Revision: https://reviews.llvm.org/D62190
* [ThinLTO/WPD] Remove an overly-aggressive assertTeresa Johnson2020-01-143-8/+133
| | | | | | | | | | | | | | | | | | | | Summary: An assert added to the index-based WPD was trying to verify that we only have multiple vtables for a given guid when they are all non-external linkage. This is too conservative because we may have multiple external vtable with the same guid when they are in comdat. Remove the assert, as we don't have comdat information in the index, the linker should issue an error in this case. See discussion on D71040 for more information. Reviewers: evgeny777, aganea Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72648
* [ELF] Delete the RelExpr member R_HINT. NFCFangrui Song2020-01-143-4/+3
| | | | | | | R_HINT is ignored like R_NONE. There are no strong reasons to keep R_HINT. The largest RelExpr member R_RISCV_PC_INDIRECT is 60 now. Differential Revision: https://reviews.llvm.org/D71822
* [ThinLTO] Handle variable with twice promoted name (Rust)Teresa Johnson2020-01-143-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Ensure that we can internalize values produced from two rounds of promotion. Note that this cannot happen currently via clang, but in other use cases such as the Rust compiler which does a first round of ThinLTO on library code, producing bitcode, and a second round on the final binary. In particular this can happen if a function is exported and promoted, ending up with a ".llvm.${hash}" suffix, and then goes through a round of optimization creating an internal switch table expansion variable that is internal and contains the promoted name of the enclosing function. This variable will be promoted in the second round of ThinLTO if @foo is imported again, and therefore ends up with two ".llvm.${hash}" suffixes. Only the final one should be stripped when consulting the index to locate the summary. Reviewers: wmi Subscribers: mehdi_amini, inglorion, hiraditya, JDevlieghere, steven_wu, dexonsmith, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72711
* [X86] Directly emit a BROADCAST_LOAD from constant pool in ↵Craig Topper2020-01-144-20/+46
| | | | | | | | lowerUINT_TO_FP_vXi32 to avoid double loads seen in D71971 By directly emitting the constants as a constant pool load we seem to avoid the build_vector/extract_subvector combines that resulted in the duplicate loads we had before. Differential Revision: https://reviews.llvm.org/D72307
* SCC: Allow ReplaceNode to safely support insertionWarren Ristow2020-01-141-1/+4
| | | | | | | | | | | If scc_iterator::ReplaceNode is inserting a new entry in the map, rather than replacing an existing entry, the possibility of growing the map could cause a failure. This change safely implements the insertion. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D72469
* [AIX][XCOFF] Supporting the ReadOnlyWithRel SectionKnddiggerlin2020-01-143-3/+24
| | | | | | | | | | SUMMARY: In this patch we put the global variable in a Csect which's SectionKind is "ReadOnlyWithRel" into Data Section. Reviewers: hubert.reinterpretcast,jasonliu,Xiangling_L Subscribers: wuzish, nemanjai, hiraditya Differential Revision: https://reviews.llvm.org/D72461
* [InstCombine] Let combineLoadToNewType preserve ABI alignment of the load ↵Juneyoung Lee2020-01-152-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | (PR44543) Summary: If aligment on `LoadInst` isn't specified, load is assumed to be ABI-aligned. And said aligment may be different for different types. So if we change load type, but don't pay extra attention to the aligment (i.e. keep it unspecified), we may either overpromise (if the default aligment of the new type is higher), or underpromise (if the default aligment of the new type is smaller). Thus, if no alignment is specified, we need to manually preserve the implied ABI alignment. This addresses https://bugs.llvm.org/show_bug.cgi?id=44543 by making combineLoadToNewType preserve ABI alignment of the load. Reviewers: spatel, lebedev.ri Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72710
* [ELF] --exclude-libs: don't assign VER_NDX_LOCAL to undefined symbolsFangrui Song2020-01-142-1/+20
| | | | | | | | | | | | | | | Suggested by Peter Collingbourne. Non-VER_NDX_GLOBAL versions should not be assigned to defined symbols. --exclude-libs violates this and can cause a spurious error "cannot refer to absolute symbol" after D71795. excludeLibs incorrectly assigns VER_NDX_LOCAL to an undefined weak symbol => isPreemptible is false => R_PLT_PC is optimized to R_PC => in isStaticLinkTimeConstant, an error is emitted. Reviewed By: pcc, grimar Differential Revision: https://reviews.llvm.org/D72681
* Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic ↵Dmitri Gribenko2020-01-1413-38/+28
| | | | template
* [test] Make data layout of load-bitcast64.ll explicit, use update_test_checks.pyJuneyoung Lee2020-01-151-20/+43
|
* [RISCV] Add Clang frontend support for Bitmanip extensionScott Egerton2020-01-144-1/+19
| | | | | | | | | | | | | | Summary: This adds the __riscv_bitmanip macro and the 'b' target feature to enable it. Reviewers: asb, simoncook, lewis-revill, PaoloS, lenary Reviewed By: lenary Subscribers: Jim, rbar, johnrusso, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71553
* [lldb/Utility] Use assert instead of llvm_unreachable for LLDBAssertJonas Devlieghere2020-01-141-3/+3
| | | | | | llvm_unreachable is marked noreturn so the compiler can assume the code for printing the error message in release builds isn't hit which defeats the purpose.
* [IR] fix potential crash in Constant::isElementWiseEqual()Sanjay Patel2020-01-142-4/+48
| | | | | | | | | | | | There's only one user of this API currently, and it seems impossible that it would compare values with different types. But that's not true in general, so we need to make sure the types are the same. As denoted by the FIXME comments, we will also crash on FP values. That's what brought me here, but we can make that a follow-up patch.
* Fix "pointer is null" static analyzer warnings. NFCI.Simon Pilgrim2020-01-141-20/+17
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.
* Fix "pointer is null" clang static analyzer warnings. NFCI.Simon Pilgrim2020-01-141-23/+14
| | | | Use cast<>/castAs<> instead of dyn_cast<>/getAs<> since the pointers are always dereferenced and cast<>/castAs<> will perform the null assertion for us.
* [clang][OpenCL] Fix covered switch warningJinsong Ji2020-01-141-3/+1
| | | | | | | | | | | | | | | -Werror clang build is broken now. tools/clang/lib/Sema/OpenCLBuiltins.inc:11824:5: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] default: We don't need default now, since all enumeration values are covered. Reviewed By: svenvh Differential Revision: https://reviews.llvm.org/D72707
* [ARM][MVE] VTP Block Pass fixSjoerd Meijer2020-01-142-2/+90
| | | | | | | | | | Fix a missing and broken test: 2 VPT blocks predicated on the same VCMP instruction that can be folded. The problem was that for each VPT block, we record the predicate statements with a list, but the same instruction was added twice. Thus, we were running in an assert trying to remove the same instruction twice. To avoid this the instructions are now recorded with a set. Differential Revision: https://reviews.llvm.org/D72699
* [Syntax] Unset IsOriginal flag on nodes removed from the treeIlya Biryukov2020-01-142-8/+22
| | | | | | And add a corresponding test. Only nodes inside the TranslationUnit subtree can be marked as original, computeReplacements() relies on this.
* [scudo][standalone] Fork supportKostya Kortchinsky2020-01-1418-42/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: fork() wasn't well (or at all) supported in Scudo. This materialized in deadlocks in children. In order to properly support fork, we will lock the allocator pre-fork and unlock it post-fork in parent and child. This is done via a `pthread_atfork` call installing the necessary handlers. A couple of things suck here: this function allocates - so this has to be done post initialization as our init path is not reentrance, and it doesn't allow for an extra pointer - so we can't pass the allocator we are currently working with. In order to work around this, I added a post-init template parameter that gets executed once the allocator is initialized for the current thread. Its job for the C wrappers is to install the atfork handlers. I reorganized a bit the impacted area and added some tests, courtesy of cferris@ that were deadlocking prior to this fix. Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D72470
* [DBG][LIVEDEBUGVALUES][NFC] Add Targeted LiveDebugValues Behaviour Tests.Tom Weaver2020-01-1422-0/+1546
| | | | | | | | | Adds 22 distinct tests that exercise the live-debug-values passes expected behaviour. reviewers: aprantl, vsk Differential revision: https://reviews.llvm.org/D72515
* [Syntax] Mark synthesized nodes as modifiableIlya Biryukov2020-01-143-0/+24
| | | | | This was an oversight in the original patch. Also add corresponding tests.
OpenPOWER on IntegriCloud