summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] Disable VLD4 under MVEDavid Green2019-12-087-89/+400
| | | | | | | | | | Alas, using half the available vector registers in a single instruction is just too much for the register allocator to handle. The mve-vldst4.ll test here fails when these instructions are enabled at present. This patch disables the generation of VLD4 and VST4 by adding a mve-max-interleave-factor option, which we currently default to 2. Differential Revision: https://reviews.llvm.org/D71109
* [clangd] Navigation from definition of template specialization to primary ↵Nathan Ridge2019-12-082-5/+32
| | | | | | | | | | | | | | template Fixes https://github.com/clangd/clangd/issues/212. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71090
* [LV] Pick correct BB as insert point when fixing PHI for FORs.Florian Hahn2019-12-072-10/+123
| | | | | | | | | | | | | | | | Currently we fail to pick the right insertion point when PreviousLastPart of a first-order-recurrence is a PHI node not in the LoopVectorBody. This can happen when PreviousLastPart is produce in a predicated block. In that case, we should pick the insertion point in the BB the PHI is in. Fixes PR44020. Reviewers: hsaito, fhahn, Ayal, dorit Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D71071
* Symbol: use elaborated types for `DataExtractor`Saleem Abdulrasool2019-12-071-3/+3
| | | | | | Use type elaborated spellings for the parameter to avoid the ambiguity between `llvm` and `lldb_private` names. This is needed for building with Visual Studio.
* [SystemZ] Fix build bot failuresUlrich Weigand2019-12-071-4/+4
| | | | | | | | | | | | | My patch 9db13b5a7d43096a9ab5f7cef6e1b7e2dc9c9c63 seems to have caused some build bots to fail due to warnings that appear only when using -Wcovered-switch-default. This patch is an attempt to fix this by trying to avoid both the warning "default label in switch which covers all enumeration values" for the inner switch statements and at the same time the warning "this statement may fall through" for the outer switch statement in getVectorComparison (SystemZISelLowering.cpp).
* Optionally exclude bitfield definitions from magic numbers checkFlorin Iucha2019-12-076-8/+90
| | | | Adds the IgnoreBitFieldsWidths option to readability-magic-numbers.
* [SimplifyCFG] Account for N being null.Florian Hahn2019-12-071-5/+6
| | | | | Fixes a crash, e.g. http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15119/
* [BPF] Support weak global variables for BTFYonghong Song2019-12-073-5/+137
| | | | | | | | | Generate types for global variables with "weak" attribute. Keep allocation scope the same for both weak and non-weak globals as ELF symbol table can determine whether a global symbol is weak or not. Differential Revision: https://reviews.llvm.org/D71162
* [SimplifyCFG] Handle AssumptionCache being null.Rodrigo Caetano Rocha2019-12-072-3/+52
| | | | | | | | | | | | AssumptionCache can be null in SimplifyCFGOptions. However, FoldCondBranchOnPHI() was not properly handling that when passing a null AssumptionCache to simplifyCFG. Patch by Rodrigo Caetano Rocha <rcor.cs@gmail.com> Reviewers: fhahn, lebedev.ri, spatel Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D69963
* [OpenMP] Require trivially copyable type for mappingJonas Hahnfeld2019-12-0731-161/+161
| | | | | | | | | | | | | A trivially copyable type provides a trivial copy constructor and a trivial copy assignment operator. This is enough for the runtime to memcpy the data to the device. Additionally there must be no virtual functions or virtual base classes and the destructor is guaranteed to be trivial, ie performs no action. The runtime does not require trivial default constructors because on alloc the memory is undefined. Thus, weaken the warning to be only issued if the mapped type is not trivially copyable. Differential Revision: https://reviews.llvm.org/D71134
* [FPEnv] Constrained FCmp intrinsicsUlrich Weigand2019-12-0741-100/+5394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for constrained floating-point comparison intrinsics. Specifically, we add: declare <ty2> @llvm.experimental.constrained.fcmp(<type> <op1>, <type> <op2>, metadata <condition code>, metadata <exception behavior>) declare <ty2> @llvm.experimental.constrained.fcmps(<type> <op1>, <type> <op2>, metadata <condition code>, metadata <exception behavior>) The first variant implements an IEEE "quiet" comparison (i.e. we only get an invalid FP exception if either argument is a SNaN), while the second variant implements an IEEE "signaling" comparison (i.e. we get an invalid FP exception if either argument is any NaN). The condition code is implemented as a metadata string. The same set of predicates as for the fcmp instruction is supported (except for the "true" and "false" predicates). These new intrinsics are mapped by SelectionDAG codegen onto two new ISD opcodes, ISD::STRICT_FSETCC and ISD::STRICT_FSETCCS, again representing quiet vs. signaling comparison operations. Otherwise those nodes look like SETCC nodes, with an additional chain argument and result as usual for strict FP nodes. The patch includes support for the common legalization operations for those nodes. The patch also includes full SystemZ back-end support for the new ISD nodes, mapping them to all available SystemZ instruction to fully implement strict semantics (scalar and vector). Differential Revision: https://reviews.llvm.org/D69281
* gn build: Merge e60b36cf92eLLVM GN Syncbot2019-12-071-1/+1
|
* [VPlan] Rename VPlanHCFGTransforms to VPlanTransforms (NFC).Florian Hahn2019-12-078-20/+17
| | | | | | | | | | | | The file is intended to gather various VPlan transformations, not only CFG related transforms. Actually, the only transformation there is not CFG related. Reviewers: Ayal, gilr, hsaito, rengolin Reviewed By: gilr Differential Revision: https://reviews.llvm.org/D70732
* [PowerPC] Fix MI peephole optimization for splatsKai Luo2019-12-073-55/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes an issue where the PPC MI peephole optimization pass incorrectly remove a vector swap. Specifically, the pass can combine a splat/swap to a splat/copy. It uses `TargetRegisterInfo::lookThruCopyLike` to determine that the operands to the splat are the same. However, the current logic only compares the operands based on register numbers. In the case where the splat operands are ultimately feed from the same physical register, the pass can incorrectly remove a swap if the feed register for one of the operands has been clobbered. This patch adds a check to ensure that the registers feeding are both virtual registers or the operands to the splat or swap are both the same register. Here is an example in pseudo-MIR of what happens in the test cased added in this patch: Before PPC MI peephole optimization: ``` %arg = XVADDDP %0, %1 $f1 = COPY %arg.sub_64 call double rint(double) %res.first = COPY $f1 %vec.res.first = SUBREG_TO_REG 1, %res.first, %subreg.sub_64 %arg.swapped = XXPERMDI %arg, %arg, 2 $f1 = COPY %arg.swapped.sub_64 call double rint(double) %res.second = COPY $f1 %vec.res.second = SUBREG_TO_REG 1, %res.second, %subreg.sub_64 %vec.res.splat = XXPERMDI %vec.res.first, %vec.res.second, 0 %vec.res = XXPERMDI %vec.res.splat, %vec.res.splat, 2 ; %vec.res == [ %vec.res.second[0], %vec.res.first[0] ] ``` After optimization: ``` ; ... %vec.res.splat = XXPERMDI %vec.res.first, %vec.res.second, 0 ; lookThruCopyLike(%vec.res.first) == lookThruCopyLike(%vec.res.second) == $f1 ; so the pass replaces the swap with a copy: %vec.res = COPY %vec.res.splat ; %vec.res == [ %vec.res.first[0], %vec.res.second[0] ] ``` As best as I can tell, this has occurred since r288152, which added support for lowering certain vector operations to direct moves in the form of a splat. Committed for vddvss (Colin Samples). Thanks Colin for the patch! Differential Revision: https://reviews.llvm.org/D69497
* export.sh: Fetch sources from GitHub instead of SVNTom Stellard2019-12-061-11/+24
| | | | | | | | | | Reviewers: hansw, jdoerfert Subscribers: sylvestre.ledru, mgorny, hans, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70460
* Driver: Don't look for libc++ headers in the install directory on Android.Peter Collingbourne2019-12-063-16/+29
| | | | | | | | | | | | | | | | The NDK uses a separate set of libc++ headers in the sysroot. Any headers in the installation directory are not going to work on Android, not least because they use a different name for the inline namespace (std::__1 instead of std::__ndk1). This effectively makes it impossible to produce a single toolchain that is capable of targeting both Android and another platform that expects libc++ headers to be installed in the installation directory, such as Mac. In order to allow this scenario to work, stop looking for headers in the install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* [AArch64][GlobalISel] Add missing default statement to a switch in the selector.Amara Emerson2019-12-061-0/+3
|
* Move variable only used in an assert into the assert itself.Sterling Augustine2019-12-061-2/+1
| | | | This prevents unused variable warnings from breaking the build.
* [c++20] Determine whether a defaulted comparison should be deleted orRichard Smith2019-12-0616-218/+1126
| | | | constexpr.
* [AArch64][GlobalISel] Add support for selection of vector G_SHL with immediates.Amara Emerson2019-12-063-21/+267
| | | | | | Only implemented for the type combinations already supported for G_SHL. Differential Revision: https://reviews.llvm.org/D71153
* [lldb/Reproducer] Disable test on Windows to unblock the bot.Jonas Devlieghere2019-12-061-0/+1
| | | | http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja
* Add matchDynamic convenience functionsStephen Kelly2019-12-072-0/+51
| | | | | | | | | | Summary: These correspond to the existing match() free functions. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54406
* gn build: Change scudo's list of supported platforms to a whitelist.Peter Collingbourne2019-12-061-5/+1
| | | | | | | | Scudo only supports building for android/linux/fuchsia, so require target_os to be one of linux/fuchsia to do a stage2_unix scudo build. Android is already covered by the stage2_android* toolchains below. Differential Revision: https://reviews.llvm.org/D71131
* Revert "[Sema][X86] Consider target attribute into the checks in ↵Reid Kleckner2019-12-0610-145/+84
| | | | | | | | | validateOutputSize and validateInputSize." This reverts commit e1578fd2b79fe5af5f80c0c166a8abd0f816c022. It introduces a dependency on Attr.h which I am removing from ASTContext.h.
* Use ASTDumper to dump the AST from clang-queryStephen Kelly2019-12-061-1/+6
| | | | | | | | | | | | | | | | | | | | Summary: This way, the output is not limited by the various API differences between the dump() member functions. For example, all dumps are now in color, while that used to be the case only for Decls and Stmts, but not Types. Additionally, while DynTypedNode::dump (which was used up to now) was limited to dumping only Decls, Stmts and Types, this makes clang-query support everything ASTNodeTraverser supports. Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62056
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-0610-84/+145
| | | | | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch copies some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Probably need some refactoring here to share more code with Codegen. Is there a good place to do that? Also need to support the cpu_specific attribute as well. Differential Revision: https://reviews.llvm.org/D68627
* Remove Expr.h include from ASTContext.h, NFCReid Kleckner2019-12-0625-49/+67
| | | | | | | ASTContext.h is popular, prune its includes. Expr.h brings in Attr.h, which is also expensive. Move BlockVarCopyInit to Expr.h to accomplish this.
* [CommandLine] Add callbacks to OptionsDon Hinton2019-12-064-2/+149
| | | | | | | | | | | | | | | | | | | | | | Summary: Add a new cl::callback attribute to Option. This attribute specifies a callback function that is called when an option is seen, and can be used to set other options, as in option A implies option B. If the option is a `cl::list`, and `cl::CommaSeparated` is also specified, the callback will fire once for each value. This could be used to validate combinations or selectively set other options. Reviewers: beanz, thomasfinch, MaskRay, thopre, serge-sans-paille Reviewed By: beanz Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70620
* Make it possible control matcher traversal kind with ASTContextStephen Kelly2019-12-068-37/+278
| | | | | | | | | | | | | | | | Summary: This will eventually allow traversal of an AST while ignoring invisible AST nodes. Currently it depends on the available enum values for TraversalKinds. That can be extended to ignore all invisible nodes in the future. Reviewers: klimek, aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61837
* [WebAssebmly][MC] Support .import_name/.import_field asm directivesSam Clegg2019-12-067-36/+63
| | | | | | | | Convert the MC test to use asm rather than bitcode. This is a precursor to https://reviews.llvm.org/D70520. Differential Revision: https://reviews.llvm.org/D70877
* [MC] Rewrite tablegen for printInstrAlias to comiple faster, NFCReid Kleckner2019-12-063-95/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the *InstPrinter.cpp files of each target where some of the slowest objects to compile in all of LLVM. See this snippet produced by ClangBuildAnalyzer: https://reviews.llvm.org/P8171$96 Search for "InstPrinter", and see that it shows up in a few places. Tablegen was emitting a large switch containing a sequence of operand checks, each of which created many conditions and many BBs. Register allocation and jump threading both did not scale well with such a large repetitive sequence of basic blocks. So, this change essentially turns those control flow structures into data. The previous structure looked like: switch (Opc) { case TGT::ADD: // check alias 1 if (MI->getOperandCount() == N && // check num opnds MI->getOperand(0).isReg() && // check opnd 0 ... MI->getOperand(1).isImm() && // check opnd 1 AsmString = "foo"; break; } // check alias 2 if (...) ... return false; The new structure looks like: OpToPatterns: Sorted table of opcodes mapping to pattern indices. \-> Patterns: List of patterns. Previous table points to subrange of patterns to match. \-> Conds: The if conditions above encoded as a kind and 32-bit value. See MCInstPrinter.cpp for the details of how the new data structures are interpreted. Here are some before and after metrics. Time to compile AArch64InstPrinter.cpp: 0m29.062s vs. 0m2.203s size of the obj: 3.9M vs. 676K size of clang.exe: 97M vs. 96M I have not benchmarked disassembly performance, but typically disassemblers are bottlenecked on IO and string processing, not alias matching, so I'm not sure it's interesting enough to be worth doing. Reviewers: RKSimon, andreadb, xbolva00, craig.topper Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D70650
* [X86] Fix prolog/epilog mismatch for stack protectors on win32-macho.Amara Emerson2019-12-062-1/+58
| | | | | | | | The xor'ing behaviour is only used for msvc/crt environments, when we're targeting macho the guard load code doesn't know about the xor in the epilog. Disable xor'ing when targeting win32-macho to be consistent. Differential Revision: https://reviews.llvm.org/D71095
* [ObjC] Make sure that the implicit arguments for direct methods have been setupAlex Lorenz2019-12-067-22/+27
| | | | | | | | | | | | | | | | | | | | This commit sets the Self and Imp declarations for ObjC method declarations, in addition to the definitions. It also fixes a bunch of code in clang that had wrong assumptions about when getSelfDecl() would be set: - CGDebugInfo::getObjCMethodName and AnalysisConsumer::getFunctionName would assume that it was set for method declarations part of a protocol, which they never were, and that self would be a Class type, which it isn't as it is id for a protocol. Also use the Canonical Decl to index the set of Direct methods so that when calls and implementations interleave, the same llvm::Function is used and the same symbol name emitted. Radar-Id: rdar://problem/57661767 Patch by: Pierre Habouzit Differential Revision: https://reviews.llvm.org/D71091
* wrap an rst file to 80 cols, to cycle botsNico Weber2019-12-061-6/+8
|
* [TargetLowering] Fix another potential FPE in expandFP_TO_UINTCraig Topper2019-12-068-344/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | D53794 introduced code to perform the FP_TO_UINT expansion via FP_TO_SINT in a way that would never expose floating-point exceptions in the intermediate steps. Unfortunately, I just noticed there is still a way this can happen. As discussed in D53794, the compiler now generates this sequence: // Sel = Src < 0x8000000000000000 // Val = select Sel, Src, Src - 0x8000000000000000 // Ofs = select Sel, 0, 0x8000000000000000 // Result = fp_to_sint(Val) ^ Ofs The problem is with the Src - 0x8000000000000000 expression. As I mentioned in the original review, that expression can never overflow or underflow if the original value is in range for FP_TO_UINT. But I missed that we can get an Inexact exception in the case where Src is a very small positive value. (In this case the result of the sub is ignored, but that doesn't help.) Instead, I'd suggest to use the following sequence: // Sel = Src < 0x8000000000000000 // FltOfs = select Sel, 0, 0x8000000000000000 // IntOfs = select Sel, 0, 0x8000000000000000 // Result = fp_to_sint(Val - FltOfs) ^ IntOfs In the case where the value is already in range of FP_TO_SINT, we now simply compute Val - 0, which now definitely cannot trap (unless Val is a NaN in which case we'd want to trap anyway). In the case where the value is not in range of FP_TO_SINT, but still in range of FP_TO_UINT, the sub can never be inexact, as Val is between 2^(n-1) and (2^n)-1, i.e. always has the 2^(n-1) bit set, and the sub is always simply clearing that bit. There is a slight complication in the case where Val is a constant, so we know at compile time whether Sel is true or false. In that scenario, the old code would automatically optimize the sub away, while this no longer happens with the new code. Instead, I've added extra code to check for this case and then just fall back to FP_TO_SINT directly. (This seems to catch even slightly more cases.) Original version of the patch by Ulrich Weigand. X86 changes added by Craig Topper Differential Revision: https://reviews.llvm.org/D67105
* [analyzer] Fix false positive on introspection of a block's internal layout.Artem Dergachev2019-12-062-1/+11
| | | | | | When implementation of the block runtime is available, we should not warn that block layout fields are uninitialized simply because they're on the stack.
* [InstSimplify] add tests for copysign with fneg operand; NFCSanjay Patel2019-12-061-0/+44
|
* [WPD] Remove unused parameter (NFC)Teresa Johnson2019-12-061-4/+3
| | | | Remove unused parameter.
* [X86] Don't setup and teardown memory for a musttail callReid Kleckner2019-12-065-76/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: musttail calls should not require allocating extra stack for arguments. Updates to arguments passed in memory should happen in place before the epilogue. This bug was mostly a missed optimization, unless inalloca was used and store to push conversion fired. If a reserved call frame was used for an inalloca musttail call, the call setup and teardown instructions would be deleted, and SP adjustments would be inserted in the prologue and epilogue. You can see these are removed from several test cases in this change. In the case where the stack frame was not reserved, i.e. call frame optimization fires and turns argument stores into pushes, then the imbalanced call frame setup instructions created for inalloca calls become a problem. They remain in the instruction stream, resulting in a call setup that allocates zero bytes (expected for inalloca), and a call teardown that deallocates the inalloca pack. This deallocation was unbalanced, leading to subsequent crashes. Reviewers: hans Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71097
* [clang-tidy] Pass -faligned-allocation on the compiler command line toAkira Hatanaka2019-12-061-2/+2
| | | | | | | | | fix compile error The test was failing when run on OSes older than MacOSX10.14 because aligned deallocation functions are unavailable on older OSes. rdar://problem/57706710
* Revert "[PGO][PGSO] Instrument the code gen / target passes."Hiroshi Yamauchi2019-12-0621-283/+61
| | | | | | This reverts commit 9a0b5e14075a1f42a72eedb66fd4fde7985d37ac. This seems to break buildbots.
* [OPENMP50]Add if clause in distribute simd directive.Alexey Bataev2019-12-067-32/+240
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [AutoFDO] Inline replay for cold/small callees from sample profile loaderWenlei He2019-12-063-3/+144
| | | | | | | | | | | | | | | Summary: Sample profile loader of AutoFDO tries to replay previous inlining using context sensitive profile. The replay only repeats inlining if the call site block is hot. As a result it punts inlining of small functions, some of which can be beneficial for size, and will still be inlined by CSGCC inliner later. The oscillation between sample profile loader's inlining and regular CGSSC inlining cause unnecessary loss of context-sensitive profile. It doesn't have much impact for inline decision itself, but it negatively affects post-inline profile quality as CGSCC inliner have to scale counts which is not as accurate as the original context sensitive profile, and bad post-inline profile can misguide code layout. This change added regular Inline Cost calculation for sample profile loader, so we can inline small functions upfront under switch -sample-profile-inline-size. In addition -sample-profile-cold-inline-threshold is added so we can tune the separate size threshold - currently the default is chosen to be the same as regular inliner's cold call-site threshold. Reviewers: wmi, davidxl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70750
* Stop checking whether std::strong_* has ::equivalent members.Richard Smith2019-12-062-9/+6
| | | | | Any attempt to use these would be a bug, so we shouldn't even look for them.
* Avoid naming variable after type to fix GCC 5.3 buildReid Kleckner2019-12-061-2/+2
| | | | | | | | | | | GCC says: .../llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp:195:12: error: ‘InfoType’ is not a class, namespace, or enumeration case InfoType::EndOfList: ^ Presumably, GCC thinks InfoType is a variable here. Work around it by using the name IT as is done above.
* Revert "[InstCombine] reduce code duplication; NFC"Sanjay Patel2019-12-061-40/+38
| | | | | This reverts commit db5739658467e20a52f20e769d3580412e13ff87. At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.
* Revert "[InstCombine] improve readability; NFC"Sanjay Patel2019-12-061-6/+10
| | | | | This reverts commit 7250ef3613cc6b81145b9543bafb86d7f9466cde. At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.
* Revert "[InstCombine] reduce indentation; NFC"Sanjay Patel2019-12-061-25/+28
| | | | | This reverts commit 8bf8ef7116bd0daec570b35480ca969b74e66c6e. At least 1 of these supposedly NFC commits wasn't - sanitizer bot is angry.
* [libcxx{,abi}] Don't link libpthread and libdl on FuchsiaPetr Hosek2019-12-062-5/+18
| | | | | | | | | These are a part of the libc so linking these explicitly isn't necessary and embedding these as deplibs causes link time error. This issues was introduced in a9b5fff which changed how we emit deplibs. Differential Revision: https://reviews.llvm.org/D71135
* Revert "ARM-Darwin: keep the frame register reserved even if not updated."Alina Sbirlea2019-12-064-18/+3
| | | | | | | | This reverts commit a7d90af1be48234ce583e00fb16e33633d44ae38. This revision came back as the root-cause for crashes in internal ARM-IOS apps. Reproducer in https://bugs.llvm.org/show_bug.cgi?id=44231.
OpenPOWER on IntegriCloud