summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Fix relative path in header-filter.Dmitri Gribenko2019-09-205-3/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang-tidy supports output diagnostics from header files if user specifies --header-filter. But it can't handle relative path well. For example, the folder structure of a project is: ``` // a.h is in /src/a/a.h // b.h is in /src/b/b.h ... // c.cpp is in /src/c.cpp ``` Now, we set --header-filter as --header-filter=/a/. That means we only want to check header files under /src/a/ path, and ignore header files uder /src/b/ path, but in current implementation, clang-tidy will check /src/b/b.h also, because the name of b.h used in clang-tidy is /src/a/../b/b.h. This change tries to fix this issue. Reviewers: alexfh, hokein, aaron.ballman, gribozavr Reviewed By: gribozavr Subscribers: MyDeveloperDay, xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67501 Patch by Yubo Xie. llvm-svn: 372388
* [SystemZ] Add SystemZ as supporting target in help text for -mfentry.Jonas Paulsson2019-09-202-2/+2
| | | | | | | => "Insert calls to fentry at function entry (x86/SystemZ only)" Review: Ulrich Weigand llvm-svn: 372387
* [StaticAnalyzer] Use llvm::StringLiteral instead of StringRef in few placesBenjamin Kramer2019-09-201-6/+7
| | | | | | | | StringRef's constexpr constructor seems to be extremely slow in MSVC 2017, so don't use it for generated tables. Should make PR43369 a bit better, no functionality change. llvm-svn: 372386
* Move decl completion out of the ASTImporterDelegate and document it [NFC]Raphael Isemann2019-09-202-129/+127
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ASTImporterDelegate is currently responsible for both recording and also completing types. This patch moves the actual completion and recording code outside the ASTImporterDelegate to reduce the amount of responsibilities the ASTImporterDelegate has to fulfill. As I anyway had to touch the code when moving I also documented and refactored most of it (e.g. no more asserts that we call the deporting start/end function always as a pair). Note that I had to make the ASTImporterDelegate and it's related functions public now so that I can move out the functionality in another class (that doesn't need to be in the header). Reviewers: shafik, aprantl, martong, a.sidorin Reviewed By: martong Subscribers: rnkovacs, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D61478 llvm-svn: 372385
* [AMDGPU] Use std::make_tuple to make some toolchains happy againBjorn Pettersson2019-09-201-6/+6
| | | | | | | | | | | | | | | | | | | | | My toolchain stopped working (LLVM 8.0 , libstdc++ 5.4.0) after r372338. The same problem was seen in clang-cuda-build buildbots: clang-cuda-build/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:763:12: error: chosen constructor is explicit in copy-initialization return {Reg, 0, nullptr}; ^~~~~~~~~~~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here constexpr tuple(_UElements&&... __elements) ^ This commit adds explicit calls to std::make_tuple to work around the problem. llvm-svn: 372384
* Revert r372366 "Use getTargetConstant for BLENDI, and add a test to catch it."Nico Weber2019-09-202-15/+1
| | | | | | | | | | | | | | | | | | | This reverts commit 52621307bcab2013e8833f3317cebd63a6db3885. Tests have been failing all night with [0/2] ACTION //llvm/test:check-llvm(//llvm/utils/gn/build/toolchain:unix) -- Testing: 33647 tests, 64 threads -- Testing: 0 .. 10.. UNRESOLVED: LLVM :: CodeGen/AMDGPU/GlobalISel/isel-blendi-gettargetconstant.ll (6943 of 33647) ******************** TEST 'LLVM :: CodeGen/AMDGPU/GlobalISel/isel-blendi-gettargetconstant.ll' FAILED ******************** Test has no run line! ******************** Since there were other concerns on https://reviews.llvm.org/D67785, I'm just reverting for now. llvm-svn: 372383
* [lldb][NFC] Remove unused include in TestLineEntry.cppRaphael Isemann2019-09-201-1/+0
| | | | llvm-svn: 372381
* [IntrinsicEmitter] Add overloaded types for SVE intrinsics (Subdivide2 & ↵Kerry McLaughlin2019-09-205-11/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | Subdivide4) Summary: Both match the type of another intrinsic parameter of a vector type, but where each element is subdivided to form a vector with more elements of a smaller type. Subdivide2Argument allows intrinsics such as the following to be defined: - declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 8 x i16>) Subdivide4Argument allows intrinsics such as: - declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 16 x i8>) Tests are included in follow up patches which add intrinsics using these types. Reviewers: sdesmalen, SjoerdMeijer, greened, rovka Reviewed By: sdesmalen Subscribers: rovka, tschuett, jdoerfert, cfe-commits, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67549 llvm-svn: 372380
* [NFC] Test commit, deleting some whitespaceDavid Tellenbach2019-09-201-1/+1
| | | | llvm-svn: 372379
* [llvm-dwarfdump] Adjust Windows path to be acceptable by JSONDjordje Todorovic2019-09-201-7/+4
| | | | | | | | | | Backslash is a special character according to JSON specification, so we should avoid that when printing a file path with the --statistics option. Differential Revision: https://reviews.llvm.org/D67699 llvm-svn: 372378
* [yaml2obj/obj2yaml] - Do not trigger llvm_unreachable when dumping/parsing ↵George Rimar2019-09-203-1/+64
| | | | | | | | | | | | | | relocations and e_machine is unsupported. Currently when e_machine is set to something that is not supported by YAML lib, then tools fail with llvm_unreachable. In this patch I allow them to handle relocations in this case. It can be used to dump and create objects for broken or unsupported targets. Differential revision: https://reviews.llvm.org/D67657 llvm-svn: 372377
* [MachinePipeliner] Improve the TargetInstrInfo API analyzeLoop/reduceLoopCountJames Molloy2019-09-2010-194/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way MachinePipeliner uses these target hooks is stateful - we reduce trip count by one per call to reduceLoopCount. It's a little overfit for hardware loops, where we don't have to worry about stitching a loop induction variable across prologs and epilogs (the induction variable is implicit). This patch introduces a new API: /// Analyze loop L, which must be a single-basic-block loop, and if the /// conditions can be understood enough produce a PipelinerLoopInfo object. virtual std::unique_ptr<PipelinerLoopInfo> analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const; The return value is expected to be an implementation of the abstract class: /// Object returned by analyzeLoopForPipelining. Allows software pipelining /// implementations to query attributes of the loop being pipelined. class PipelinerLoopInfo { public: virtual ~PipelinerLoopInfo(); /// Return true if the given instruction should not be pipelined and should /// be ignored. An example could be a loop comparison, or induction variable /// update with no users being pipelined. virtual bool shouldIgnoreForPipelining(const MachineInstr *MI) const = 0; /// Create a condition to determine if the trip count of the loop is greater /// than TC. /// /// If the trip count is statically known to be greater than TC, return /// true. If the trip count is statically known to be not greater than TC, /// return false. Otherwise return nullopt and fill out Cond with the test /// condition. virtual Optional<bool> createTripCountGreaterCondition(int TC, MachineBasicBlock &MBB, SmallVectorImpl<MachineOperand> &Cond) = 0; /// Modify the loop such that the trip count is /// OriginalTC + TripCountAdjust. virtual void adjustTripCount(int TripCountAdjust) = 0; /// Called when the loop's preheader has been modified to NewPreheader. virtual void setPreheader(MachineBasicBlock *NewPreheader) = 0; /// Called when the loop is being removed. virtual void disposed() = 0; }; The Pipeliner (ModuloSchedule.cpp) can use this object to modify the loop while allowing the target to hold its own state across all calls. This API, in particular the disjunction of creating a trip count check condition and adjusting the loop, improves the code quality in ModuloSchedule.cpp. llvm-svn: 372376
* [CallSiteSplitting] Remove unused includes (NFC).Florian Hahn2019-09-201-5/+0
| | | | llvm-svn: 372375
* Reapply [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-206-8/+62
| | | | | | | | | | | Reapply r372309 Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372374
* [X86] Convert tbm_bextri_u32/tbm_bextri_u64 intrinsics TargetConstant ↵Craig Topper2019-09-202-3/+13
| | | | | | | | | | | | | | | | | argument to a regular Constant during lowering. We reuse an ISD opcode here that can be reached from BMI that doesn't require it to be an immediate. Our isel patterns to match the TBM immediate form require a Constant and not a TargetConstant. We were accidentally getting the Constant due to a quirk of combineBEXTR calling SimplifyDemandedBits. The call to SimplifyDemandedBits ended up constant folding the TargetConstant to a regular Constant. But we should probably instead be asserting if SimplifyDemandedBits on a TargetConstant so we shouldn't rely on this behavior. llvm-svn: 372373
* [llvm-readobj] flush output before crashYuanfang Chen2019-09-201-1/+3
| | | | | | Otherwise the output could be lost. llvm-svn: 372372
* [X86] Use timm in MMX pinsrw/pextrw isel patterns. Add missing test cases.Craig Topper2019-09-202-3/+68
| | | | | | This fixes an isel failure after r372338. llvm-svn: 372371
* [llvm-ar] Removes repetition in the error messageFangrui Song2019-09-202-2/+9
| | | | | | | | | As per bug 40244, fixed an error where the error message was repeated. Differential Revision: https://reviews.llvm.org/D67038 Patch by Yu Jian (wyjw) llvm-svn: 372370
* [Object] Uncapitalize an error messageFangrui Song2019-09-201-1/+1
| | | | | | Test case will be added by my next commit. llvm-svn: 372369
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-202-11/+20
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). llvm-svn: 372368
* llvm-undname: Delete an empty, unused method.Nico Weber2019-09-202-4/+0
| | | | llvm-svn: 372367
* Use getTargetConstant for BLENDI, and add a test to catch it.Sterling Augustine2019-09-202-1/+15
| | | | | | | | | | | | | | | | Summary: This fixes a crasher introduced by r372338. Reviewers: echristo, arsenm Subscribers: jvesely, wdng, nhaehnle, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67785 Tighten up the test case. llvm-svn: 372366
* [X86] Remove the special isBuildVectorOfConstantSDNodes handling from ↵Craig Topper2019-09-201-26/+2
| | | | | | | | | | LowerBUILD_VECTORvXi1. The later code that generates a constant when there are some non-const elements works basically the same and doesn't require there to be any non-const elements. llvm-svn: 372365
* Revert "Fix swig python package path"Haibo Huang2019-09-201-6/+4
| | | | | | | | | | | | | | Summary: This reverts commit 5a115e81cdd40c758b10c382aeffc0c8de6930e2. Reviewers: JDevlieghere, ZeGentzy Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67781 llvm-svn: 372364
* [NFCI] Always initialize const members of AttributeCommonInfoAlex Langford2019-09-201-2/+2
| | | | | | | | Some compilers require that const fields of an object must be explicitly initialized by the constructor. I ran into this issue building with clang 3.8 on Ubuntu 16.04. llvm-svn: 372363
* MachineScheduler: Fix missing dependency with multiple subreg defsMatt Arsenault2019-09-202-0/+98
| | | | | | | | | | | | | | | | | | | | If an instruction had multiple subregister defs, and one of them was undef, this would improperly conclude all other lanes are killed. There could still be other defs of those read-undef lanes in other operands. This would improperly remove register uses from CurrentVRegUses, so the visitation of later operands would not find the necessary register dependency. This would also mean this would fail or not depending on how different subregister def operands were ordered. On an undef subregister def, scan the instruction for other subregister defs and avoid killing those. This possibly should be deferring removing anything from CurrentVRegUses until the entire instruction has been processed instead. llvm-svn: 372362
* [Consumed] Treat by-value class arguments as consuming by default, like ↵Nicholas Allegra2019-09-192-3/+30
| | | | | | | | rvalue refs. Differential Revision: https://reviews.llvm.org/D67743 llvm-svn: 372361
* Fix for stringized function-macro args continued across linesAlex Lorenz2019-09-192-10/+23
| | | | | | | | | | | In case of certain #define'd macros, there's a space just before line continuation that the minimized-source lexer was missing to include, resulting in invalid stringize. Patch by: kousikk (Kousik Kumar) Differential Revision: https://reviews.llvm.org/D67635 llvm-svn: 372360
* Model converted constant expressions as full-expressions.Richard Smith2019-09-194-44/+66
| | | | | | | | | | This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No functionality change intended. llvm-svn: 372359
* [WebAssembly][NFC] Remove unnecessary bracesThomas Lively2019-09-191-2/+1
| | | | llvm-svn: 372358
* [AArch64] Fix formatting (NFC)Evandro Menezes2019-09-191-0/+1
| | | | llvm-svn: 372357
* [CUDA][HIP] Re-apply part of r372318.Michael Liao2019-09-193-4/+25
| | | | | | | | | | - r372318 causes violation of `use-of-uninitialized-value` detected by MemorySanitizer. Once `Viable` field is set to false, `FailureKind` needs setting as well as it will be checked during destruction if `Viable` is not true. - Revert the part trying to skip `std::vector` erasing. llvm-svn: 372356
* Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"Mitch Phillips2019-09-193-30/+9
| | | | | | | | Broke the msan buildbots (see comments on rL372318 for more details). This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02. llvm-svn: 372353
* [ObjC][ARC] Skip debug instructions when computing the insert point ofAkira Hatanaka2019-09-192-0/+43
| | | | | | | | | | | objc_release calls This fixes a bug where the presence of debug instructions would cause ARC optimizer to change the order of retain and release calls. rdar://problem/55319419 llvm-svn: 372352
* Don't false-positive match against binary path.Mitch Phillips2019-09-191-1/+4
| | | | | | | | | | | copy-rel-abs.s uses llvm-objdump to generate output that's then run through FileCheck. llvm-objdump prints the file path at the top of the file, which means that any build path that contains 'zed' will get false-matched. Ensure that 'zed' is only matched after the 'SYMBOL TABLE:' output, preventing this from failing if your build directory is ~/build/sanitized-xxx/, or similar. llvm-svn: 372351
* [AMDGPU] fixed underflow in getOccupancyWithNumVGPRsStanislav Mekhanoshin2019-09-191-1/+1
| | | | | | | | | The function could return zero if an extreme number or registers were used. Minimal possible occupancy is 1. Differential Revision: https://reviews.llvm.org/D67771 llvm-svn: 372350
* llvm-reduce: Follow-up to 372280, now with more-better msan fixingDavid Blaikie2019-09-191-1/+1
| | | | llvm-svn: 372349
* [lsan] Fix deadlock in dl_iterate_phdr.Evgeniy Stepanov2019-09-195-12/+69
| | | | | | | | | | | | | | | | | Summary: Do not grab the allocator lock before calling dl_iterate_phdr. This may cause a lock order inversion with (valid) user code that uses malloc inside a dl_iterate_phdr callback. Reviewers: vitalybuka, hctim Subscribers: jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67738 llvm-svn: 372348
* Don't use invalidated iterators in FlattenCFGPassJakub Kuderski2019-09-192-7/+47
| | | | | | | | | | | | | | | | | | | | Summary: FlattenCFG may erase unnecessary blocks, which also invalidates iterators to those erased blocks. Before this patch, `iterativelyFlattenCFG` could try to increment a BB iterator after that BB has been removed and crash. This patch makes FlattenCFGPass use `WeakVH` to skip over erased blocks. Reviewers: dblaikie, tstellar, davide, sanjoy, asbirlea, grosser Reviewed By: asbirlea Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67672 llvm-svn: 372347
* [Analysis] Allow -scalar-evolution-max-iterations more than onceShoaib Meenai2019-09-192-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | At present, `-scalar-evolution-max-iterations` is a `cl::Optional` option, which means it demands to be passed exactly zero or one times. Our build system makes it pretty tricky to guarantee this. We often accidentally pass the flag more than once (but always with the same value) which results in an error, after which compilation fails: ``` clang (LLVM option parsing): for the -scalar-evolution-max-iterations option: may only occur zero or one times! ``` It seems reasonable to allow -scalar-evolution-max-iterations to be passed more than once. Quoting the [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | documentation ]]: > The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times. > ... > If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained. Original patch by: Enrico Bern Hardy Tanuwidjaja <etanuwid@fb.com> Differential Revision: https://reviews.llvm.org/D67512 llvm-svn: 372346
* [NFC][PowerPC] Fast-isel VSX support testJinsong Ji2019-09-194-15/+8
| | | | | | | We have fixed most of the VSX limitation in Fast-isel, so we can remove the -mattr=-vsx for most testcases now. llvm-svn: 372345
* gn build: Merge r372343GN Sync Bot2019-09-192-0/+2
| | | | llvm-svn: 372344
* [SVFS] Vector Function ABI demangling.Francesco Petrogalli2019-09-197-0/+1003
| | | | | | | | | | | | | | | | This patch implements the demangling functionality as described in the Vector Function ABI. This patch will be used to implement the SearchVectorFunctionSystem (SVFS) as described in the RFC: http://lists.llvm.org/pipermail/llvm-dev/2019-June/133484.html A fuzzer is added to test the demangling utility. Patch by Sumedh Arani <sumedh.arani@arm.com> Differential revision: https://reviews.llvm.org/D66024 llvm-svn: 372343
* [InstCombine] Simplify @llvm.usub.with.overflow+non-zero check (PR43251)Roman Lebedev2019-09-192-18/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is again motivated by D67122 sanitizer check enhancement. That patch seemingly worsens `-fsanitize=pointer-overflow` overhead from 25% to 50%, which strongly implies missing folds. In this particular case, given ``` char* test(char& base, unsigned long offset) { return &base - offset; } ``` it will end up producing something like https://godbolt.org/z/luGEju which after optimizations reduces down to roughly ``` declare void @use64(i64) define i1 @test(i8* dereferenceable(1) %base, i64 %offset) { %base_int = ptrtoint i8* %base to i64 %adjusted = sub i64 %base_int, %offset call void @use64(i64 %adjusted) %not_null = icmp ne i64 %adjusted, 0 %no_underflow = icmp ule i64 %adjusted, %base_int %no_underflow_and_not_null = and i1 %not_null, %no_underflow ret i1 %no_underflow_and_not_null } ``` Without D67122 there was no `%not_null`, and in this particular case we can "get rid of it", by merging two checks: Here we are checking: `Base u>= Offset && (Base u- Offset) != 0`, but that is simply `Base u> Offset` Alive proofs: https://rise4fun.com/Alive/QOs The `@llvm.usub.with.overflow` pattern itself is not handled here because this is the main pattern, that we currently consider canonical. https://bugs.llvm.org/show_bug.cgi?id=43251 Reviewers: spatel, nikic, xbolva00, majnemer Reviewed By: xbolva00, majnemer Subscribers: vsk, majnemer, xbolva00, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67356 llvm-svn: 372341
* [AMDGPU] Unnecessary -amdgpu-scalarize-global-loads=false flag removed from ↵Alexander Timofeev2019-09-193-22/+55
| | | | | | | | | | min/max lit tests. Reviewers: arsenm Differential Revision: https://reviews.llvm.org/D67712 llvm-svn: 372340
* [Float2Int] avoid crashing on unreachable code (PR38502)Sanjay Patel2019-09-196-23/+58
| | | | | | | | | | | | | In the example from: https://bugs.llvm.org/show_bug.cgi?id=38502 ...we hit infinite looping/crashing because we have non-standard IR - an instruction operand is used before defined. This and other unusual constructs are allowed in unreachable blocks, so avoid the problem by using DominatorTree to step around landmines. Differential Revision: https://reviews.llvm.org/D67766 llvm-svn: 372339
* Reapply r372285 "GlobalISel: Don't materialize immarg arguments to intrinsics"Matt Arsenault2019-09-1979-1365/+5010
| | | | | | | | | This reverts r372314, reapplying r372285 and the commits which depend on it (r372286-r372293, and r372296-r372297) This was missing one switch to getTargetConstant in an untested case. llvm-svn: 372338
* [MCA] Improved cost computation for loop carried dependencies in the ↵Andrea Di Biagio2019-09-193-17/+43
| | | | | | | | | | | | | | | | bottleneck analysis. This patch introduces a cut-off threshold for dependency edge frequences with the goal of simplifying the critical sequence computation. This patch also removes the cost normalization for loop carried dependencies. We didn't really need to artificially amplify the cost of loop-carried dependencies since it is already computed as the integral over time of the delay (in cycle). In the absence of backend stalls there is no need for computing a critical sequence. With this patch we early exit from the critical sequence computation if no bottleneck was reported during the simulation. llvm-svn: 372337
* Make appendCallNB lambda mutableChris Bieneman2019-09-191-1/+1
| | | | | | Lambdas are by deafult const so that they produce the same output every time they are run. This lambda needs to set the value on a captured promise which is a mutating operation, so it must be mutable. llvm-svn: 372336
* X86: Add missing test for vshli SimplifyDemandedBitsForTargetNodeMatt Arsenault2019-09-191-0/+58
| | | | | | | This would have caught this regression which triggered the revert of r372285: https://bugs.chromium.org/p/chromium/issues/detail?id=1005750 llvm-svn: 372335
OpenPOWER on IntegriCloud