summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer][IDF] Add a control dependency calculator + a new debug checkerKristof Umann2019-07-057-28/+326
| | | | | | | | | | | | | | | | | | | | | | | I intend to improve the analyzer's bug reports by tracking condition expressions. 01 bool b = messyComputation(); 02 int i = 0; 03 if (b) // control dependency of the bug site, let's explain why we assume val 04 // to be true 05 10 / i; // warn: division by zero I'll detail this heuristic in the followup patch, strictly related to this one however: * Create the new ControlDependencyCalculator class that uses llvm::IDFCalculator to (lazily) calculate control dependencies for Clang's CFG. * A new debug checker debug.DumpControlDependencies is added for lit tests * Add unittests Differential Revision: https://reviews.llvm.org/D62619 llvm-svn: 365197
* [RISCV][NFC] Replace hard-coded CSR duplication with symbolic referencesSam Elliott2019-07-054-39/+36
| | | | | | | | | | | | | | | | Reviewers: asb, lenary Reviewed By: asb, lenary Subscribers: MaskRay, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64139 Patch by James Clarke (jrtc27) llvm-svn: 365195
* Fix MSVC/cppcheck Use::Next isn't initialized warning. NFCI.Simon Pilgrim2019-07-051-1/+1
| | | | llvm-svn: 365194
* [llvm-objcopy] Allow strip symtab from executables and DSOsEugene Leviant2019-07-059-89/+50
| | | | | | Differential revision: https://reviews.llvm.org/D61672 llvm-svn: 365193
* [FileCheck] Fix comment in parseNumericVariableUseThomas Preud'homme2019-07-051-6/+6
| | | | | | | | | | | | | | | | | | | | Summary: Comment explaining the interaction between parsing of numeric variable definition and uses in parseNumericVariableUse is stale since it suggests both use and definition parsing is done in the same function. This was the case in a previous version of the patch committed as 71d3f227a790d6cf39d8c6267940e0dc0c237e11 but is no longer the case. This patch updates the comment accordingly. Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64227 llvm-svn: 365192
* [FileCheck] Factor some parsing checks outThomas Preud'homme2019-07-052-37/+16
| | | | | | | | | | | | | | | | | Summary: Both callers of parseNumericVariableDefinition() perform the same extra check that no character is found after the variable name. This patch factors out this check into parseNumericVariableDefinition(). Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D64226 llvm-svn: 365191
* [FileCheck] Add missing final dot in commentThomas Preud'homme2019-07-051-1/+1
| | | | llvm-svn: 365190
* [NFC] Test commit accessEndre Fulop2019-07-051-1/+1
| | | | llvm-svn: 365189
* [ThinLTO] Attempt to recommit r365040 after caching fixEugene Leviant2019-07-0528-191/+594
| | | | | | | | | | | | | | It's possible that some function can load and store the same variable using the same constant expression: store %Derived* @foo, %Derived** bitcast (%Base** @bar to %Derived**) %42 = load %Derived*, %Derived** bitcast (%Base** @bar to %Derived**) The bitcast expression was mistakenly cached while processing loads, and never examined later when processing store. This caused @bar to be mistakenly treated as read-only variable. See load-store-caching.ll. llvm-svn: 365188
* [docs][llvm-objcopy] Improve some wording.James Henderson2019-07-051-4/+4
| | | | llvm-svn: 365187
* Make joined instances of JoinedOrSeparate flags point to the unaliased args, ↵Nico Weber2019-07-057-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | like all other arg types do This fixes an 8-year-old regression. r105763 made it so that aliases always refer to the unaliased option – but it missed the "joined" branch of JoinedOrSeparate flags. (r162231 then made the Args classes non-virtual, and r169344 moved them from clang to llvm.) Back then, there was no JoinedOrSeparate flag that was an alias, so it wasn't observable. Now /U in CLCompatOptions is a JoinedOrSeparate alias in clang, and warn_slash_u_filename incorrectly used the aliased arg id (using the unaliased one isn't really a regression since that warning checks if the undefined macro contains slash or backslash and only then emits the warning – and no valid use will pass "-Ufoo/bar" or similar). Also, lld has many JoinedOrSeparate aliases, and due to this bug it had to explicitly call `getUnaliasedOption()` in a bunch of places, even though that shouldn't be necessary by design. After this fix in Option, these calls really don't have an effect any more, so remove them. No intended behavior change. (I accidentally fixed this bug while working on PR29106 but then wondered why the warn_slash_u_filename broke. When I figured it out, I thought it would make sense to land this in a separate commit.) Differential Revision: https://reviews.llvm.org/D64156 llvm-svn: 365186
* gn build: Merge r365179Nico Weber2019-07-051-0/+1
| | | | llvm-svn: 365185
* [LLD][ELF] - Update a test after LLVM change.George Rimar2019-07-051-2/+2
| | | | | | Error reporting changed in r365183 llvm-svn: 365184
* [Object/ELF.h] - Improve error reporting.George Rimar2019-07-059-53/+129
| | | | | | | | | | | | | | | | | The errors coming from ELF.h are usually not very useful because they are uninformative. This patch is a first step to improve the situation. I tested this patch with a run of check-llvm and found that few messages are untested. In this patch, I did not add more tests but marked all such cases with a "TODO" comment. For all tested messages I extended the error text to provide more details (see test cases changed). Differential revision: https://reviews.llvm.org/D64014 llvm-svn: 365183
* lld-link: Make /debugtype: option work betterNico Weber2019-07-053-5/+19
| | | | | | | | | | | | | | | | | | | - The code tried to pass false to split()'s KeepEmpty parameter, but instead passed it to MaxSplit. As a result, it would never split on commas. This has been broken since the flag was added in r278056. - The code used getSpelling() for getting the argument's values, but getSpelling() always returns the `/debugtype:` prefix without any values. So if any /debugtype: flag was passed, it always resulted in an "unknown option:" warning. (The warning code then used the correct getValue() for printing the invalid option, so the warning looked kind of like it made sense.) This regressed in r342894. Slightly improve the test coverage of this feature (but since I don't know what this flag actually does, there's still no test for the correct semantics), and add a comment to getSpelling() explaining what it does. llvm-svn: 365182
* Fix a buildbot failure due to the AST's lifetime ending before the testKristof Umann2019-07-051-17/+3
| | | | llvm-svn: 365181
* [X86][SSE] LowerINSERT_VECTOR_ELT - early out for out of range indicesSimon Pilgrim2019-07-052-4/+27
| | | | | | Fixes OSS-Fuzz #15662 llvm-svn: 365180
* [analyzer][Dominators][NFC] Add unit testsKristof Umann2019-07-054-51/+174
| | | | | | Differential Revision: https://reviews.llvm.org/D62611 llvm-svn: 365179
* [ARM] MVE VMOV immediate handlingDavid Green2019-07-058-36/+386
| | | | | | | | | | | | | This adds some handling for VMOVimm, using the same method that NEON uses. We create VMOVIMM/VMVNIMM/VMOVFPIMM nodes based on the immediate, and select them using the now renamed ARMvmovImm/etc. There is also an extra 64bit immediate mode that I have not yet added here. Code by David Sherwood Differential Revision: https://reviews.llvm.org/D63884 llvm-svn: 365178
* [CFG] Add a new function to get the proper condition of a CFGBlockKristof Umann2019-07-053-0/+84
| | | | | | | | | | | | | getTerminatorCondition() returned a condition that may be outside of the block, while the new function returns the proper one: if (A && B && C) {} Return C instead of A && B && C. Differential Revision: https://reviews.llvm.org/D63538 llvm-svn: 365177
* [ARM] MVE fp to int conversionsDavid Green2019-07-053-0/+345
| | | | | | | | This adds the patterns needed for fptosi and sitofp. Differential Revision: https://reviews.llvm.org/D63729 llvm-svn: 365176
* [RISCV] Delete a ctor that is commented out. NFCFangrui Song2019-07-051-2/+0
| | | | llvm-svn: 365175
* Silence gcc warning "control reaches end of non-void function" [NFCI]Mikael Holmen2019-07-051-0/+2
| | | | | | | | | | | | | | Without this fix gcc (7.4) complains with /data/repo/master/clang/lib/CodeGen/CGObjCMac.cpp: In member function 'std::__cxx11::string {anonymous}::CGObjCCommonMac::GetSectionName(llvm::StringRef, llvm::StringRef)': /data/repo/master/clang/lib/CodeGen/CGObjCMac.cpp:4944:1: error: control reaches end of non-void function [-Werror=return-type] } ^ All values in the ObjectFormatType enum are currently handled in the switch but gcc complains anyway. llvm-svn: 365174
* [llvm-objcopy][NFC] Refactor output target parsing v2Seiya Nuta2019-07-054-36/+90
| | | | | | | | | | | | | | | | | | | | | Summary: Use an enum instead of string to hold the output file format in Config.InputFormat and Config.OutputFormat. It's essential to support other output file formats other than ELF. This patch originally has been submitted as D63239. However, there was an use-of-uninitialized-value bug and reverted in r364379 (git commit 4ee933c). This patch includes the fix for the bug by setting Config.InputFormat/Config.OutputFormat in parseStripOptions. Reviewers: espindola, alexshap, rupprecht, jhenderson Reviewed By: jhenderson Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64170 llvm-svn: 365173
* [llvm-objcopy][test] Fix respect-umask.test after D62718/r365162Fangrui Song2019-07-051-14/+3
| | | | llvm-svn: 365172
* [WebAssembly] Delete static_assert(sizeof(SymbolUnion) <= 96) to fix Windows ↵Fangrui Song2019-07-051-5/+0
| | | | | | | | | | builds http://lab.llvm.org:8011/builders/sanitizer-windows/builds/47944/steps/stage%201%20build/logs/stdio Needs to figure out later the size on Windows. llvm-svn: 365171
* Fix patch not passing test casesAlex Brachet2019-07-052-5/+5
| | | | llvm-svn: 365170
* [WebAssembly] Reorder Symbol fields to make it smallerFangrui Song2019-07-051-25/+31
| | | | | | | | | | | | On 64-bit systems, this decreases sizeof(SymbolUnion) from 112 to 96. Add a static_assert to avoid accidental increases in future. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D64208 llvm-svn: 365169
* Temporarily stop failing test caseAlex Brachet2019-07-051-3/+3
| | | | llvm-svn: 365168
* gn build: Merge r365130.Peter Collingbourne2019-07-051-0/+1
| | | | llvm-svn: 365167
* gn build: Merge r365103.Peter Collingbourne2019-07-051-0/+1
| | | | llvm-svn: 365166
* gn build: Merge r365007.Peter Collingbourne2019-07-051-0/+1
| | | | llvm-svn: 365165
* gn build: Merge r365091.Peter Collingbourne2019-07-055-3/+23
| | | | llvm-svn: 365164
* [X86] Add custom isel to select ADD/SUB/OR/XOR/AND to their non-immediate ↵Craig Topper2019-07-043-93/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | forms under optsize when the immediate has additional users. Summary: We attempt to prevent folding immediates with multiple users under optsize. But we only do this from store nodes and X86ISD::ADD/SUB/XOR/OR/AND patterns. We don't do it for ISD::ADD/SUB/XOR/OR/AND even though we count them as users when deciding whether to fold into other nodes. This leads to situations where we block folding to a compare for example, but still fold into an AND or OR as seen in PR27202. Unfortunately touching the isel patterns in tablegen for the ISD::ADD/SUB/XOR/OR/AND opcodes will cause the patterns to be unusable for fast isel. And we don't have a way to make a fast isel only pattern. To workaround this, this patch adds custom isel in front of the isel table that will select the non-immediate forms if the immediate has additional users. This may create some issues for ANDN and NOT matching. And there's room for improvement with unsigned 32 immediates on 64-bit AND. This patch needs more thorough test cases, but I wanted to get feedback on the direction. Please send me any other test cases you've seen in the wild. I think we probably have the same issue with the immediate matching when we fold RMW from X86ISD::ADD/SUB/XOR/OR/AND. And our TEST immedaite shrinking logic. Our cost modeling for immediates that can fit in a sign extended 8-bit immediate on a 16/32/64 bit operation is completely wrong. I also wonder if we should update the ConstantHoisting cost model and block folding for "opaque" constants. But of course constants can still be created by DAG combine and lowering optimizations. Fixes PR27202 Reviewers: spatel, RKSimon, andreadb Reviewed By: RKSimon Subscribers: jsji, hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59909 llvm-svn: 365163
* [llvm-objcopy] Change handling of output file permissionsAlex Brachet2019-07-044-10/+151
| | | | | | | | | | | | | | | | Summary: Address bug [[ https://bugs.llvm.org/show_bug.cgi?id=42082 | 42082 ]] where files were always outputted with 0775 permissions. Now, the output file is given either 0666 or 0777 if the object is executable. Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay Reviewed By: rupprecht, jhenderson, jakehehrlich, MaskRay Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62718 llvm-svn: 365162
* [mips] Refactor expandSeq and expandSeqI methods. NFCSimon Atanasyan2019-07-041-41/+43
| | | | llvm-svn: 365161
* [NFC] Make some ObjectFormatType switches coveringHubert Tong2019-07-042-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes the `default` case from some switches on `llvm::Triple::ObjectFormatType`, and cases for the missing enumerators are then added. For `UnknownObjectFormat`, the action (`llvm_unreachable`) for the `default` case is kept. For the other unhandled cases, `report_fatal_error` is used instead. Reviewers: sfertile, jasonliu, daltenty Reviewed By: sfertile Subscribers: wuzish, aheejin, jsji, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63767 llvm-svn: 365160
* [docs] [tools] Fix see also linksAlex Brachet2019-07-047-7/+7
| | | | | | | | | | | | | | | | Summary: Changes "see also" links to use :manpage: instead of plain text or the form `name|name` which was being treated literally, not as a link. Reviewers: jhenderson, rupprecht Reviewed By: jhenderson Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63970 llvm-svn: 365159
* [pstl] Use utilities from <functional> instead of reinventing the wheelLouis Dionne2019-07-046-100/+42
| | | | llvm-svn: 365158
* Add assert for 'bad' code path in GetUniqueNamespaceDeclarationRaphael Isemann2019-07-041-1/+2
| | | | | | | | | | | | | | | | | Summary: If we call this function with a non-namespace as a second argument (and a nullptr name), we currently only get a nullptr as a return when we hit the "Bad!!!" code path. This patch just adds an assert as this seems to be a programming error in the calling code. Reviewers: shafik Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57880 llvm-svn: 365157
* [NFC][pstl] Do not name each header file in the leading commentLouis Dionne2019-07-0422-22/+22
| | | | | | | With the renaming that will happen, it's just a pain to maintain the right names. llvm-svn: 365156
* Plugins: permit building on Windows ARM64Saleem Abdulrasool2019-07-041-15/+12
| | | | | | | | | | Rather than relying on `sizeof(void *)` to determine the architecture, use the `CMAKE_SYSTEM_PROCESSOR` variable. This should allow us to build for Windows and cross-compile. Without this, we would attempt to build the x64 plugin on ARM64 which would fail due to the `CONTEXT` type being defined for ARM64 rather than `x64`. llvm-svn: 365155
* docs: add documentation for `LIBCXX_INCLUDE_TESTS`Saleem Abdulrasool2019-07-041-0/+6
| | | | | | | | Add some missing documentation for the `LIBCXX_INCLUDE_TESTS` option. Patch by Jean Heyd Meneide! llvm-svn: 365154
* [modules] Add PP callbacks for entering and leaving a submodule.Vassil Vassilev2019-07-042-0/+46
| | | | llvm-svn: 365153
* [NFC][pstl] Run clang-formatLouis Dionne2019-07-043-30/+30
| | | | llvm-svn: 365152
* [clangd] Mark a couple of unimportant flags as hidden. NFCSam McCall2019-07-041-2/+3
| | | | llvm-svn: 365151
* [pstl] Make sure we include the pstl_config header in the glue headersLouis Dionne2019-07-044-0/+7
| | | | llvm-svn: 365150
* [DAGCombiner] Don't combine (addcarry (uaddo X, Y), 0, Carry) -> (addcarry ↵Craig Topper2019-07-042-5/+6
| | | | | | | | | | | | | | | | | | | | | X, Y, Carry) if the Carry comes from the uaddo. Summary: The uaddo won't be removed and the addcarry will still be dependent on the uaddo. So we'll just increase the use count of X and Y and potentially require a COPY. Reviewers: spatel, RKSimon, deadalnix Reviewed By: RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64190 llvm-svn: 365149
* [AMDGPU] Custom lower INSERT_SUBVECTOR v3, v4, v5, v8Tim Renouf2019-07-043-8/+69
| | | | | | | | | | | | | | | | | | | Summary: Since the changes to introduce vec3 and vec5, INSERT_VECTOR for these sizes has been marked "expand", which made LegalizeDAG lower it to loads and stores via a stack slot. The code got optimized a bit later, but the now-unused stack slot was never deleted. This commit avoids that problem by custom lowering INSERT_SUBVECTOR into an EXTRACT_VECTOR_ELT and INSERT_VECTOR_ELT for each element in the subvector to insert. V2: Addressed review comments re test. Differential Revision: https://reviews.llvm.org/D63160 Change-Id: I9e3c13e36f68cfa3431bb9814851cc1f673274e1 llvm-svn: 365148
* [InstCombine] allow undef elements when forming splat from chain of ↵Sanjay Patel2019-07-042-16/+34
| | | | | | | | | | | | | | | | | | insertelements We allow forming a splat (broadcast) shuffle, but we were conservatively limiting that to cases where all elements of the vector are specified. It should be safe from a codegen perspective to allow undefined lanes of the vector because the expansion of a splat shuffle would become the chain of inserts again. Forming splat shuffles can reduce IR and help enable further IR transforms. Motivating bugs: https://bugs.llvm.org/show_bug.cgi?id=42174 https://bugs.llvm.org/show_bug.cgi?id=16739 Differential Revision: https://reviews.llvm.org/D63848 llvm-svn: 365147
OpenPOWER on IntegriCloud