summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[CStringSyntaxChecker] Check strlcat sizeof check"George Karpenkov2018-08-232-67/+4
| | | | | | | | This reverts commit 3073790e87378fea9a68fb052185fec9596ef135. The check is not correct, strlact(dest, "mystr", sizeof(dest)) is fine. llvm-svn: 340501
* Revert "[CStringSyntaxChecker] Reduces space around error message for strlcat."George Karpenkov2018-08-232-2/+2
| | | | | | This reverts commit 6b43b80320722da41ca6ef7a3b57cc300fb83094. llvm-svn: 340500
* MC: Teach the COFF object writer to write address-significance tables.Peter Collingbourne2018-08-225-3/+136
| | | | | | | | | The format is the same as in ELF: a sequence of ULEB128-encoded symbol indexes. Differential Revision: https://reviews.llvm.org/D51047 llvm-svn: 340499
* win: Omit ".exe" from clang and clang-cl driver-level diagnostics.Nico Weber2018-08-221-3/+3
| | | | | | | Like https://reviews.llvm.org/D51133 but for clang. https://reviews.llvm.org/D51134 llvm-svn: 340498
* win: Omit ".exe" from lld warning and error messages.Nico Weber2018-08-227-6/+16
| | | | | | | | | | | This is a minor follow-up to https://reviews.llvm.org/D49189. On Windows, lld used to print "lld-link.exe: error: ...". Now it just prints "lld-link: error: ...". This matches what link.exe does (it prints "LINK : ...") and makes lld's output less dependent on the host system. https://reviews.llvm.org/D51133 llvm-svn: 340487
* Revert "[ASTImporter] Add test for ↵Raphael Isemann2018-08-222-68/+0
| | | | | | | | ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt" This test breaks llvm-clang-x86_64-expensive-checks-win. llvm-svn: 340483
* lld-link: Separate 'undefined symbol' errors with just one newline, not two.Nico Weber2018-08-223-10/+9
| | | | | | | | | | | | | newline() in ErrorHandler.cpp already tries to insert newlines between messages that contain embedded newlines, so getSymbolLocations() shouldn't return a string that ends in a newline -- else we end up with two newlines between error messages. Makes lld-link's output look more like ld.lld output. https://reviews.llvm.org/D51117 llvm-svn: 340482
* Fix two RUN: lines that were unintentionally spelled "RN:".Nico Weber2018-08-221-3/+3
| | | | | | https://reviews.llvm.org/D51140 llvm-svn: 340481
* [ValueTracking] Teach computeNumSignBits to understand min/max clamp ↵Craig Topper2018-08-222-1/+115
| | | | | | | | | | patterns with constant/splat values If we have a min/max pair we can do a better job of counting sign bits if we look at them together. This is similar to what is done in the SelectionDAG version of computeNumSignBits for ISD::SMAX/SMIN. Differential Revision: https://reviews.llvm.org/D51112 llvm-svn: 340480
* [NFC] Add tags file to .gitignoreGeorge Karpenkov2018-08-221-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D50109 llvm-svn: 340479
* [X86] Teach combineLoopSADPattern to handle cases where there is no loop and ↵Craig Topper2018-08-222-112/+53
| | | | | | | | | | | | | | the add has two absolute difference inputs Previously we asumed a vector reduction add is part of a loop and one of the input is a phi. But the code in SelectionDAGBuilder that sets vector reduction flag handles more cases than that. It just requires that the use chain ends in a horizontal reduction. And there are no other uses. This means it can handle unrolled reduction loops. If the initial value of the reduction was 0, an unrolled loop would begin with a vector reduction add that has two sad inputs. Previously we would only transform one side of the add, but for this case we need to transform both sides. I've created a lambda to reuse some of the code for both sides. And fixed the variables names to remove reference to "phi". Differential Revision: https://reviews.llvm.org/D50817 llvm-svn: 340478
* [X86] Add test cases for D50817. NFCCraig Topper2018-08-221-0/+162
| | | | llvm-svn: 340477
* [NFC] Refactor simplification of pow()Evandro Menezes2018-08-221-1/+1
| | | | llvm-svn: 340476
* [analyzer] Track non-zero values in ReturnVisitorGeorge Karpenkov2018-08-223-28/+52
| | | | | | | | | | | | | Tracking those can help to provide much better diagnostics in many cases. In general, most of the visitor machinery should be refactored to allow tracking the origin of arbitrary values. rdar://36039765 Differential Revision: https://reviews.llvm.org/D51131 llvm-svn: 340475
* [analyzer] Track the problematic subexpression in UndefResultCheckerGeorge Karpenkov2018-08-221-0/+4
| | | | | | | | This is tested in a subsequent commit, which allows tracking those values. Differential Revision: https://reviews.llvm.org/D51139 llvm-svn: 340474
* [analyzer] [NFC] Minor refactoring of BugReporterVisitorsGeorge Karpenkov2018-08-221-15/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D51130 llvm-svn: 340473
* [WebAssembly] Arbitrary BUILD_VECTOR and remove i64x2.mulThomas Lively2018-08-225-6/+257
| | | | | | | | | | | | | | | | | | Summary: This CL adds support for arbitrary BUILD_VECTORS, i.e. not splats and not consts. This is the last feature needed to properly lower v2i64 multiplies without a i64x2.mul instruction (which is not in the spec), so i64x2.mul is removed as well. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51082 Remove unnecessary condition and fix whitespace llvm-svn: 340472
* [Driver] Check normalized triples for multiarch runtime pathPetr Hosek2018-08-2214-7/+23
| | | | | | | | | | | | | | | | | | | | Previously we only used target triple as provided which matches the GCC behavior, but it also means that all clients have to be consistent in their spelling of target triples since e.g. x86_64-linux-gnu and x86_64-unknown-linux-gnu will result in Clang driver looking at two different paths when searching for runtime libraries. Unfortunatelly, as it turned out many clients aren't consistent in their spelling of target triples, e.g. many Linux distributions use the shorter spelling but config.guess and rustc insist on using the normalized variant which is causing issues. To avoid having to ship multiple copies of runtimes for different triple spelling or rely on symlinks which are not portable, we should also check the normalized triple when constructing paths for multiarch runtimes. Differential Revision: https://reviews.llvm.org/D50547 llvm-svn: 340471
* [hwasan] make error reporting look more like in asan, print the memory tag ↵Kostya Serebryany2018-08-223-28/+50
| | | | | | around the buggy access, simplify one test llvm-svn: 340470
* [SelectionDAG] unroll unsupported vector FP ops earlier to avoid libcalls on ↵Sanjay Patel2018-08-223-292/+107
| | | | | | | | | | | | | | | | undef elements (PR38527) This solves the motivating case from: https://bugs.llvm.org/show_bug.cgi?id=38527 If we are legalizing an FP vector op that maps to 1 of the LLVM intrinsics that mimic libm calls, but we're going to end up with scalar libcalls for that vector type anyway, then we should unroll the vector op into scalars before widening. This avoids libcalls because we've lost the knowledge that some of the scalar elements are undef. Differential Revision: https://reviews.llvm.org/D50791 llvm-svn: 340469
* [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmtRaphael Isemann2018-08-222-0/+68
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51121 llvm-svn: 340468
* [ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.Raphael Isemann2018-08-222-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs. This is because we import the `S` struct into the `test.cpp` context and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to import is generated by clang directly in the target context. This means we actually never test the importing of ArrayInitLoopExpr with this test, which becomes obvious when looking at the missing test coverage for the respective VisitArrayInitLoopExpr method. This patch moves the copy-assignment of our struct to the `S.cpp` context, which means that `test.cpp` now actually has to import the ArrayInitLoopExpr. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51115 llvm-svn: 340467
* [ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code.Raphael Isemann2018-08-221-32/+0
| | | | | | | | | | | | | | | | | | Summary: `CXXNamedCastExpr` importing is already handled in the respective `VisitCXXNamedCastExpr` method. So this code here can never be reached under normal circumstances and we might as well remove it. This patch shouldn't change any observable behavior of the ASTImporter. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51110 llvm-svn: 340466
* [ASTImporter] Add test for ObjCTypeParamDeclRaphael Isemann2018-08-222-0/+16
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51059 llvm-svn: 340465
* [ASTImporter] Add test for SwitchStmtRaphael Isemann2018-08-222-0/+65
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51056 llvm-svn: 340464
* [ASTImporter] Add test for ObjCAutoreleasePoolStmtRaphael Isemann2018-08-222-0/+14
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51123 llvm-svn: 340463
* [NFC] Expand test cases for simplifying pow()Evandro Menezes2018-08-221-14/+116
| | | | llvm-svn: 340462
* [MemorySSA] Invalidate optimized Defs upon moving them; NFCGeorge Burgess IV2018-08-222-5/+15
| | | | | | | | | | | | | | | | | We're currently getting this behavior implicitly, since we determine if a Def's optimization is valid based on the ID of its defining access. This is incorrect, though I wouldn't be surprised if this was masked in part by that we're using a WeakVH to track what Defs are optimized to. (Not to mention that we don't move Defs super often, AFAICT). I'll submit a patch to fix this shortly. This also includes a minor refactor to reduce duplication a bit. No test is included, since like said, this already happens to be our behavior. I'll add a test for this with my fix to the other bug mentioned above. llvm-svn: 340461
* Add include directory for libxml on macOSStephane Sezer2018-08-221-2/+1
| | | | | | | | | | | | | | | | | Summary: Builds fail because libxml/xmlreader.h isn't found. Adding the include directory to the include list fixes the issue. This is what we already do on non-macOS platforms in the same file. Reviewers: clayborg, xiaobai, lanza Reviewed By: clayborg, lanza Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D50918 llvm-svn: 340460
* Thread safety analysis: Allow relockable scopesAaron Puchert2018-08-222-2/+192
| | | | | | | | | | | | | | | | | | | Summary: It's already allowed to prematurely release a scoped lock, now we also allow relocking it again, possibly even in another mode. This is the second attempt, the first had been merged as r339456 and reverted in r339558 because it caused a crash. Reviewers: delesley, aaron.ballman Reviewed By: delesley, aaron.ballman Subscribers: hokein, cfe-commits Differential Revision: https://reviews.llvm.org/D49885 llvm-svn: 340459
* [ARM] Lower llvm.ctlz.i32 to a libcall when clz is not available.Eli Friedman2018-08-224-4/+26
| | | | | | | | | | The inline sequence is very long (about 70 bytes on Thumb1), so it's not really a good idea to inline it, especially when optimizing for size. Differential Revision: https://reviews.llvm.org/D47917 llvm-svn: 340458
* [BinaryFormat] Add MessagePack reader/writerScott Linder2018-08-2210-0/+2361
| | | | | | | | | | | | | | Add support for reading and writing MessagePack, a binary object serialization format which aims to be more compact than text formats like JSON or YAML. The specification can be found at https://github.com/msgpack/msgpack/blob/master/spec.md Will be used for encoding metadata in AMDGPU code objects. Differential Revision: https://reviews.llvm.org/D44429 llvm-svn: 340457
* [SafeStack] Handle unreachable code with safe stack coloring.Eli Friedman2018-08-222-1/+26
| | | | | | | | | Instead of asserting that the function doesn't have any unreachable code, just ignore it for the purpose of computing liveness. Differential Revision: https://reviews.llvm.org/D51070 llvm-svn: 340456
* bpf: fix an assertion in BPFAsmBackend applyFixup()Yonghong Song2018-08-221-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug https://bugs.llvm.org/show_bug.cgi?id=38643 In BPFAsmBackend applyFixup(), there is an assertion for FixedValue to be 0. This may not be true, esp. for optimiation level 0. For example, in the above bug, for the following two static variables: @bpf_map_lookup_elem = internal global i8* (i8*, i8*)* inttoptr (i64 1 to i8* (i8*, i8*)*), align 8 @bpf_map_update_elem = internal global i32 (i8*, i8*, i8*, i64)* inttoptr (i64 2 to i32 (i8*, i8*, i8*, i64)*), align 8 The static variable @bpf_map_update_elem will have a symbol offset of 8 and a FK_SecRel_8 with FixupValue 8 will cause the assertion if llvm is built with -DLLVM_ENABLE_ASSERTIONS=ON. The above relocations will not exist if the program is compiled with optimization level -O1 and above as the compiler optimizes those static variables away. In the below error message, -O2 is suggested as this is the common practice. Note that FixedValue = 0 in applyFixup() does exist and is valid, e.g., for the global variable my_map in the above bug. The bpf loader will process them properly for map_id's before loading the program into the kernel. The static variables, which are not optimized away by compiler, may have FK_SecRel_8 relocation with non-zero FixedValue. The patch removed the offending assertion and will issue a hard error as below if the FixedValue in applyFixup() is not 0. $ llc -march=bpf -filetype=obj fixup.ll LLVM ERROR: Unsupported relocation: try to compile with -O2 or above, or check your static variable usage Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 340455
* [WebAssembly] Don't write SP back when prolog is generated only for EHHeejin Ahn2018-08-224-5/+54
| | | | | | | | | | | | | | | Summary: When we don't actually have stack-allocated variables but need SP only to support EH, we don't need to write SP back in the epilog, because we don't bump down the stack pointer. Reviewers: dschuff Subscribers: jgravelle-google, sbc100, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51114 llvm-svn: 340454
* [AST] Add a test for attribute intersectionPhilip Reames2018-08-221-0/+18
| | | | | | Already works, but I initially convinced myself it doesn't, so add a test which shows it does. :) llvm-svn: 340453
* [NFC] Test commitAaron Puchert2018-08-221-2/+2
| | | | llvm-svn: 340452
* [ARM] Avoid injecting constant islands in movw+movt pairs on WindowsMartin Storsjo2018-08-222-0/+918
| | | | | | | | | | | | | | | | On Windows, movw+movt pairs with relocations are handled with a single relocation that covers them both. Therefore we can't inject anything between these instructions, otherwise the relocation (which in LLVM only is treated as the movw instruction's relocation, while the movt instruction's relocation is dropped) will end up bogus. These instructions are bundled up until right before the constant islands pass, making this effectively the only place that can split them apart. Differential Revision: https://reviews.llvm.org/D51032 llvm-svn: 340451
* [ARM] Move machine operand target flags to ARMBaseInstrInfoMartin Storsjo2018-08-224-35/+35
| | | | | | | | This makes sure the flags are available for use for thumb MIR as well. A test that requires this will be added in the next commit. llvm-svn: 340450
* [clangd] send diagnostic categories only when 'categorySupport'Alex Lorenz2018-08-2213-13/+57
| | | | | | | | | | | | capability was given by the client After r339738 Clangd started sending categories with each diagnostic, but that broke the eglot client. This commit puts the categories behind a capability to fix that breakage. Differential Revision: https://reviews.llvm.org/D51077 llvm-svn: 340449
* Add unit test for StringLexerRaphael Isemann2018-08-222-0/+142
| | | | | | | | | | | | Reviewers: labath, #lldb Reviewed By: labath Subscribers: jloser, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50298 llvm-svn: 340448
* [Hexagon] Enable interleaving in loop vectorizerKrzysztof Parzyszek2018-08-223-2/+59
| | | | llvm-svn: 340447
* [ARM] Handle all-ones mask explicitly in targetShrinkDemandedConstant.Eli Friedman2018-08-222-4/+46
| | | | | | | | | | | This avoids a potential infinite loop setting and unsetting bits in the mask. Reduced from a failure on the polly-aosp bot. Differential Revision: https://reviews.llvm.org/D51066 llvm-svn: 340446
* Update MemorySSA in LoopSimplifyCFG.Alina Sbirlea2018-08-223-4/+25
| | | | | | | | | | | | | | Summary: Add MemorySSA as a dependency to LoopSimplifyCFG and preserve it. Disabled by default until all passes preserve MemorySSA. Reviewers: bogner, chandlerc Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits Differential Revision: https://reviews.llvm.org/D50911 llvm-svn: 340445
* Update MemorySSA in LoopInstSimplify.Alina Sbirlea2018-08-222-6/+39
| | | | | | | | | | | | | | Summary: Add MemorySSA as a depency to LoopInstInstSimplify and preserve it. Disabled by default until all passes preserve MemorySSA. Reviewers: chandlerc Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits Differential Revision: https://reviews.llvm.org/D50906 llvm-svn: 340444
* [AA] Remove a needless variable [NFC]Philip Reames2018-08-221-3/+1
| | | | | | There's no need to track a seperate variable for argmemonly aliasing. This falls out naturally of the modinfo union. Note that we may return earlier than we would have earlier if all arguments are explicitly readnone. The overall result doesn't change, just how we get there. llvm-svn: 340443
* [hwasan] remove stale data fieldKostya Serebryany2018-08-221-1/+0
| | | | llvm-svn: 340442
* [X86] Replace (32/64 - n) shift amounts with (neg n) since the shift amount ↵Craig Topper2018-08-224-147/+255
| | | | | | | | | | | | | | is masked in hardware Inspired by what AArch64 does for shifts, this patch attempts to replace shift amounts with neg if we can. This is done directly as part of isel so its as late as possible to avoid breaking some BZHI patterns since those patterns need an unmasked (32-n) to be correct. To avoid manual load folding and custom instruction selection for the negate. I've inserted new nodes in the DAG above the shift node in topological order. Differential Revision: https://reviews.llvm.org/D48789 llvm-svn: 340441
* [AST] Minor whitespace cleanup [NFC]Philip Reames2018-08-221-11/+7
| | | | llvm-svn: 340440
* Currently clang does not emit unused static constants. GCC emits theseElizabeth Andrews2018-08-226-1/+27
| | | | | | | | | | | | | | | | constants by default when there is no optimization. GCC's option -fno-keep-static-consts can be used to not emit unused static constants. In Clang, since default behavior does not keep unused static constants, -fkeep-static-consts can be used to emit these if required. This could be useful for producing identification strings like SVN identifiers inside the object file even though the string isn't used by the program. Differential Revision: https://reviews.llvm.org/D40925 llvm-svn: 340439
OpenPOWER on IntegriCloud