summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] clang-format (NFC)Heejin Ahn2018-09-0551-723/+819
| | | | | | | | | | | | Summary: This patch runs clang-format on all wasm-only files. Reviewers: aardappel, dschuff, sunfish, tlively Subscribers: MatzeB, sbc100, jgravelle-google, llvm-commits Differential Revision: https://reviews.llvm.org/D51447 llvm-svn: 341439
* [hwasan] print thread IDs when reporting a bug (also had to fix ↵Kostya Serebryany2018-09-056-36/+80
| | | | | | pthread_create on Linux) llvm-svn: 341438
* Allow all supportable non-type attributes to be used with #pragma clang ↵Richard Smith2018-09-053-132/+63
| | | | | | | | | | | | | | | | | attribute. Summary: We previously disallowed use of undocumented attributes with #pragma clang attribute, but the justification for doing so was weak and it prevented many reasonable use cases. Reviewers: aaron.ballman, arphaman Subscribers: cfe-commits, rnk, benlangmuir, dexonsmith, erik.pilkington Differential Revision: https://reviews.llvm.org/D51507 llvm-svn: 341437
* Fix -Wunused-private-variable on non-WindowsReid Kleckner2018-09-051-0/+2
| | | | | | | I didn't want to use ifdefs in headers, but I'll do it to pacify a warning. llvm-svn: 341436
* [hwasan] use real TLS on linux to store the current thread -- this way we ↵Kostya Serebryany2018-09-051-7/+11
| | | | | | can call t->Destroy in __hwasan_thread_exit, same as on Android llvm-svn: 341435
* [Windows] Convert from UTF-8 to UTF-16 when writing to a Windows consoleReid Kleckner2018-09-054-27/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Calling WriteConsoleW is the most reliable way to print Unicode characters to a Windows console. If binary data gets printed to the console, attempting to re-encode it shouldn't be a problem, since garbage in can produce garbage out. This breaks printing strings in the local codepage, which WriteConsoleA knows how to handle. For example, this can happen when user source code is encoded with the local codepage, and an LLVM tool quotes it while emitting a caret diagnostic. This is unfortunate, but well-behaved tools should validate that their input is UTF-8 and escape non-UTF-8 characters before sending them to raw_fd_ostream. Clang already does this, but not all LLVM tools do this. One drawback to the current implementation is printing a string a byte at a time doesn't work. Consider this LLVM code: for (char C : MyStr) outs() << C; Because outs() is now unbuffered, we wil try to convert each byte to UTF-16, which will fail. However, this already didn't work, so I think we may as well update callers that do that as we find them to print complete portions of strings. You can see a real example of this in my patch to SourceMgr.cpp Fixes PR38669 and PR36267. Reviewers: zturner, efriedma Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D51558 llvm-svn: 341433
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-054-16/+8
| | | | llvm-svn: 341432
* [hwasan] remove stale Thread:: data members. While doing so noticed that ↵Kostya Serebryany2018-09-045-14/+14
| | | | | | GetThreadStackAndTls was always called with 'at_initialization=true', fixed that. llvm-svn: 341431
* [hwasan] add a unique id to a thread and add debug prints for thread ↵Kostya Serebryany2018-09-044-1/+24
| | | | | | creation/destruction llvm-svn: 341428
* [InstCombine] fix xor-or-xor fold to check uses and handle commutesSanjay Patel2018-09-043-62/+43
| | | | | | | | | | | | I'm probably missing some way to use m_Deferred to remove the code duplication, but that can be a follow-up. The improvement in demand_shrink_nsw.ll is an example of missing the fold because the pattern matching was deficient. I didn't try to follow the bits in that test, but Alive says it's correct: https://rise4fun.com/Alive/ugc llvm-svn: 341426
* Change TestCompletion to only ever look inside of BaseDirFrederic Riss2018-09-041-7/+3
| | | | | | | | | | | | | | | | | | TestCompletion was failing quite frequently on our Linux bots. Some tracing revealed that when we are iterating BaseDir we are not getting all the entries. More specifically, we are sometimes missing the entry corresponding to the TestCompletion directory that the first test in DirCompletionAbsolute is looking for. BaseDir is the directory where lit is creating all the temporary files. The semantics of opendir/readdir are unclear when it comes to iterating over a directory that changes contents, but it seems like on Linux you might fail to list an entry even if it was there before opendir and is still present throughout the iteration. Changing the test to only look inside of the test- specific directory seems to fix the instability. This commit also removes some assertions that were added to try to track down this issue. llvm-svn: 341425
* [InstCombine] update tests checks; NFCSanjay Patel2018-09-041-7/+18
| | | | llvm-svn: 341424
* [WebAssembly] Fixed stale assert message in WebAssemblyMCInstLowerWouter van Oortmerssen2018-09-041-1/+1
| | | | llvm-svn: 341423
* [ThinLTO] Fix memory corruption in ThinLTOCodeGenerator when CodeGenOnly was ↵Steven Wu2018-09-042-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified Summary: Issue occurs when doing ThinLTO with CodeGenOnly flag. TMBuilder.TheTriple is assigned to by multiple threads in an unsafe way resulting in double-free of std::string memory. Pseudocode: if (CodeGenOnly) { // Perform only parallel codegen and return. ThreadPool Pool; int count = 0; for (auto &ModuleBuffer : Modules) { Pool.async([&](int count) { ... /// Now call OutputBuffer = codegen(*TheModule); /// Which turns into initTMBuilder(moduleTMBuilder, Triple(TheModule.getTargetTriple())); /// Which turns into TMBuilder.TheTriple = std::move(TheTriple); // std::string = "....." /// So, basically std::string assignment to same string on multiple threads = memory corruption } return; } Patch by Alex Borcan Reviewers: llvm-commits, steven_wu Reviewed By: steven_wu Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D51651 llvm-svn: 341422
* [ODRHash] Extend hash to support all Type's.Richard Trieu2018-09-049-29/+1362
| | | | llvm-svn: 341421
* [sanitizer] optimize internal_memset for the most performance critical case ↵Kostya Serebryany2018-09-041-0/+12
| | | | | | (16-byte-aligned) llvm-svn: 341420
* [llvm-strip] Allow copying relocation sections without symbol tables.Jordan Rupprecht2018-09-042-6/+54
| | | | | | | | | | | | | | | | | | | | | Summary: Fixes the error "Link field value 0 in section .rela.plt is invalid" when copying/stripping certain binaries. Minimal repro: ``` $ cat /tmp/a.c int main() { return 0; } $ clang -static /tmp/a.c -o /tmp/a $ llvm-strip /tmp/a -o /tmp/b llvm-strip: error: Link field value 0 in section .rela.plt is invalid. ``` Reviewers: jakehehrlich, alexshap Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51493 llvm-svn: 341419
* Revert r341373, since it fails on some targets.Tim Shen2018-09-044-42/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D51354 llvm-svn: 341418
* Revert "Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions"Zhaoshi Zheng2018-09-046-53/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reland r341269. Use std::stable_sort when sorting constant condidates. Reverting commit, r341365: Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions One of the tests is failing 50% of the time when expensive checks are enabled. Not sure how deep the problem is so just reverting while the author can investigate so that the bots stop repeatedly failing and blaming things incorrectly. Will respond with details on the original commit. Original commit, r341269: [Constant Hoisting] Hoisting Constant GEP Expressions Leverage existing logic in constant hoisting pass to transform constant GEP expressions sharing the same base global variable. Multi-dimensional GEPs are rewritten into single-dimensional GEPs. https://reviews.llvm.org/D51396 Differential Revision: https://reviews.llvm.org/D51654 llvm-svn: 341417
* [LV] First order recurrence phis should not be treated as uniformAnna Thomas2018-09-042-0/+27
| | | | | | | | | | | | | | This is fix for PR38786. First order recurrence phis were incorrectly treated as uniform, which caused them to be vectorized as uniform instructions. Patch by Ayal Zaks and Orivej Desh! Reviewed by: Anna Differential Revision: https://reviews.llvm.org/D51639 llvm-svn: 341416
* [InstCombine] add tests for xor-or-xor fold; NFCSanjay Patel2018-09-041-29/+186
| | | | | | | | There are 2 bugs shown here that were untested before: 1. We fail to perform the fold in 1/2 the possible commuted variants. 2. When the fold is done, it disregards extra uses. llvm-svn: 341415
* [WebAssembly][NFC] Add colon to label in testThomas Lively2018-09-041-1/+1
| | | | llvm-svn: 341414
* [AMDGPU] Legalize VGPR Rsrc operands for MUBUF instructionsScott Linder2018-09-045-67/+701
| | | | | | | | | Emit a waterfall loop in the general case for a potentially-divergent Rsrc operand. When practical, avoid this by using Addr64 instructions. Differential Revision: https://reviews.llvm.org/D50982 llvm-svn: 341413
* Fix a memory leak after rL341386.Hiroshi Yamauchi2018-09-041-1/+1
| | | | | | | | | | | | Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51658 llvm-svn: 341412
* [WebAssembly][NFC] Fix formatting and testsThomas Lively2018-09-042-7/+9
| | | | | | | | | | | | Summary: Small fixes Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51656 llvm-svn: 341411
* [InstCombine] make ((X & C) ^ C) form consistent for vectorsSanjay Patel2018-09-042-6/+4
| | | | | | It would be better to create a 'not' here, but that's not possible yet. llvm-svn: 341410
* [Hexagon] Don't packetize new-value stores with any other storesKrzysztof Parzyszek2018-09-042-0/+32
| | | | llvm-svn: 341409
* When a relocation to an undefined symbol is an R_X86_64_PC32, an inputSterling Augustine2018-09-041-1/+1
| | | | | | | | | | | | section will not have an input file. Don't crash under those circumstances. Neither clang nor llvm-mc generates R_X86_64_PC32 relocations due to https://reviews.llvm.org/D43383, which makes it hard to write a test case. However, gcc does generate such relocations. I want to get a fix in now, but will figure out a way to actually exercise this code path as soon as I can. llvm-svn: 341408
* [NFC] Improve clarity in emitInstrCountChangedRemarkJessica Paquette2018-09-041-1/+4
| | | | | | | | | Add a "CouldOnlyImpactOneFunction" bool that's true when we pass in a function. Just cleaning up a little bit, since I'm going to add in the per-function remarks soon from D51467. llvm-svn: 341407
* NFC: expand memset inline arm64 coverageJF Bastien2018-09-041-15/+212
| | | | | | I'm looking at some codegen optimization in this area and want to make sure I understand the current codegen and don't regress it. This patch simply expands the two existing tests to capture more of the current code generation when it comes to heap-based and stack-based small memset on arm64. The tested code is already pretty good, notably when it comes to using STP, FP stores, FP immediate generation, and folding one of the stores into a stack spill when possible. The uses of STUR could be improved, and some more pairing could occur. Straying from bzero patterns currently yield suboptimal code, and I expect a variety of small changes could make things way better. llvm-svn: 341406
* [InstCombine] simplify code for xor folds; NFCISanjay Patel2018-09-041-40/+23
| | | | | | | | | This is just a cleanup step. The TODO comments show what is wrong with the 'and' version of the fold. Fixing this should be part of recommitting: rL300977 llvm-svn: 341405
* [CMake] Don't use -rtlib=compiler-rt with -nodefaultlibs.Charles Davis2018-09-042-2/+1
| | | | | | | | | | | | | | | Summary: This switch only has an effect at link time. It changes the default compiler support library to `compiler-rt`. With `-nodefaultlibs`, this library won't get linked anyway; Clang actually warns about that. Reviewers: mstorsjo, rnk Subscribers: dberris, mgorny, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51645 llvm-svn: 341404
* [COFF] Allow exporting all symbols from system libraries specfied with ↵Martin Storsjo2018-09-044-4/+33
| | | | | | | | | | | | | | | -wholearchive: When building a shared libc++.dll, it pulls in libc++abi.a statically with the --wholearchive flag. If such a build is done with --export-all-symbols, it's reasonable to assume that everything from that library also should be exported with the same rules as normal local object files, even though we normally avoid autoexporting things from libc++abi.a in other cases when linking a DLL (user code). Differential Revision: https://reviews.llvm.org/D51529 llvm-svn: 341403
* [MinGW] Move code for indicating "potentially not DSO local" into ↵Martin Storsjo2018-09-044-25/+25
| | | | | | | | | | | | | | | shouldAssumeDSOLocal. NFC. On Windows, if shouldAssumeDSOLocal returns false, it's either a dllimport reference, or a reference that we should treat as non-local and create a stub for. Clean up AArch64Subtarget::ClassifyGlobalReference a little while touching the flag handling relating to dllimport. Differential Revision: https://reviews.llvm.org/D51590 llvm-svn: 341402
* [MinGW] [AArch64] Add stubs for potential automatic dllimported variablesMartin Storsjo2018-09-046-8/+132
| | | | | | | | | | | The runtime pseudo relocations can't handle the AArch64 format PC relative addressing in adrp+add/ldr pairs. By using stubs, the potentially dllimported addresses can be touched up by the runtime pseudo relocation framework. Differential Revision: https://reviews.llvm.org/D51452 llvm-svn: 341401
* Fix unused variable warningReid Kleckner2018-09-041-2/+2
| | | | llvm-svn: 341400
* [libomptarget] Remove `Devices` from `RTLInfoTy`Sergey Dmitriev2018-09-042-6/+1
| | | | | | | | This patch removes unused field `Devices` from `RTLInfoTy`. Differential Revision: https://reviews.llvm.org/D51653 llvm-svn: 341399
* [SimpleLoopUnswitch] remove a chain of dead blocks at onceFedor Sergeev2018-09-042-19/+75
| | | | | | | | | | | | | | | | | | | | | | Recent change to deleteDeadBlocksFromLoop was not enough to fix all the problems related to dead blocks after nontrivial unswitching of switches. We need to delete all the dead blocks that were created during unswitching, otherwise we will keep having problems with phi's or dead blocks. This change removes all the dead blocks that are reachable from the loop, not trying to track whether these blocks are newly created by unswitching or not. While not completely correct, we are unlikely to get loose but reachable dead blocks that do not belong to our loop nest. It does fix all the failures currently known, in particular PR38778. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D51519 llvm-svn: 341398
* [Codegen] Fix test added in rL341380: AArch64SelectionDAGTest needs to link ↵Jordan Rupprecht2018-09-041-0/+1
| | | | | | against Analysis lib. llvm-svn: 341397
* Set console mode when -fansi-escape-codes is enabled David Bolvansky2018-09-041-0/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Windows console now supports supports ANSI escape codes, but we need to enable it using SetConsoleMode with ENABLE_VIRTUAL_TERMINAL_PROCESSING flag. Fixes https://bugs.llvm.org/show_bug.cgi?id=38817 Tested on Windows 10, screenshot: https://i.imgur.com/bqYq0Uy.png Reviewers: zturner, chandlerc Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51611 llvm-svn: 341396
* [CMake] Provide a custom target to install LLVM librariesPetr Hosek2018-09-041-0/+21
| | | | | | | | | This simplifies installing all LLVM libraries when doing component build; now you can include llvm-libraries in distribution components. Differential Revision: https://reviews.llvm.org/D51603 llvm-svn: 341395
* [InstCombine] improve xor+and/or testsSanjay Patel2018-09-041-90/+172
| | | | | | | | | | | The tests attempted to check for commuted variants of these folds, but complexity-based canonicalization meant we had no coverage for at least 1/2 of the cases. Also, the folds correctly check hasOneUse(), but there was no coverage for that. llvm-svn: 341394
* AMDGPU: Fix DAG divergence not reporting flat loadsMatt Arsenault2018-09-042-4/+34
| | | | | | Match behavior in DAG of r340343 llvm-svn: 341393
* DAG: Factor out helper function for odd vector sizesMatt Arsenault2018-09-041-22/+28
| | | | llvm-svn: 341392
* Fix build failures after rL341386.Hiroshi Yamauchi2018-09-041-0/+8
| | | | | | | | | | | | Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51647 llvm-svn: 341391
* clang-cl: Pass /Brepro to linker if it was passed to the compilerNico Weber2018-09-042-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D51635 llvm-svn: 341390
* [WebAssembly] Fix operand rewriting in inline asm lowering.Dan Gohman2018-09-042-5/+3
| | | | | | | | | | | Use MachineOperand::ChangeToImmediate rather than reassigning MachineOperands to new values created from MachineOperand::CreateImm, so that their parent pointers are preserved. This fixes "Instruction has operand with wrong parent set" errors reported by the MachineVerifier. llvm-svn: 341389
* [CMake] Remove variable reference that isn't used.Charles Davis2018-09-041-1/+1
| | | | | | | | | | | | | | | Summary: This variable is never defined, so its value is always empty. Since `libunwind` is needed to build the C++ ABI library in the first place, it should never be linked to the C++ ABI library anyway. Reviewers: mstorsjo, rnk Subscribers: mgorny, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51644 llvm-svn: 341388
* Terminate debugger if an assert was hitDavid Bolvansky2018-09-041-10/+10
| | | | | | | | | | | | Reviewers: JDevlieghere, teemperor, #lldb Reviewed By: JDevlieghere Subscribers: clayborg, lemo, lldb-commits Differential Revision: https://reviews.llvm.org/D51604 llvm-svn: 341387
* [PGO] Control Height ReductionHiroshi Yamauchi2018-09-0411-0/+3983
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Control height reduction merges conditional blocks of code and reduces the number of conditional branches in the hot path based on profiles. if (hot_cond1) { // Likely true. do_stg_hot1(); } if (hot_cond2) { // Likely true. do_stg_hot2(); } -> if (hot_cond1 && hot_cond2) { // Hot path. do_stg_hot1(); do_stg_hot2(); } else { // Cold path. if (hot_cond1) { do_stg_hot1(); } if (hot_cond2) { do_stg_hot2(); } } This speeds up some internal benchmarks up to ~30%. Reviewers: davidxl Reviewed By: davidxl Subscribers: xbolva00, dmgreen, mehdi_amini, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D50591 llvm-svn: 341386
OpenPOWER on IntegriCloud