summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-undname: Improve string literal demangling with embedded \0 charsNico Weber2019-04-202-2/+15
| | | | | | | | | - Don't assert when a string looks like a u32 string to the heuristic but doesn't have a length that's 0 mod 4. Instead, classify those as u16 with embedded \0 chars. Found by oss-fuzz. - Print embedded nul bytes as \0 instead of \x00. llvm-svn: 358835
* ftime-trace: Trace the name of the currently active pass as well.Nico Weber2019-04-201-6/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D60782 llvm-svn: 358834
* [JITLink] Add yet more detail to MachO/x86-64 unsupported relocation errors.Lang Hames2019-04-201-1/+4
| | | | | | | | Knowing the address/symbolnum field values makes it easier to identify the unsupported relocation, and provides enough information for the full bit pattern of the relocation to be reconstructed. llvm-svn: 358833
* [JITLink][ORC] Add JITLink to the list of dependencies for ORC.Lang Hames2019-04-201-1/+2
| | | | | | | | | The new ObjectLinkingLayer in ORC depends on JITLink. This should fix the build error at http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9621 llvm-svn: 358832
* [JITLink] Fix a bad formatv format string.Lang Hames2019-04-201-1/+1
| | | | llvm-svn: 358831
* [JITLink] Disable MachO/x86-64 regression test if the X86 target is not built.Lang Hames2019-04-202-0/+3
| | | | llvm-svn: 358830
* Revert r358800. Breaks Obsequi from the test suite.Amara Emerson2019-04-205-153/+32
| | | | | | | The last attempt fixed gcc and consumer-typeset, but Obsequi seems to fail with a different issue. llvm-svn: 358829
* [JITLink] Add llvm-jitlink to the list of available tools in lit.Lang Hames2019-04-201-8/+8
| | | | | | | Should fix the 'llvm-jitlink command not found' errors that are appearing on some builders. llvm-svn: 358828
* [JITLink] Add BinaryFormat to JITLink's dependencies.Lang Hames2019-04-203-2/+4
| | | | | | | | | Hopefully this will fix the missing dependence on llvm::identify_magic that is showing up on some PPC bots. E.g. http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9617 llvm-svn: 358827
* [JITLink] Add more detail to MachO/x86-64 "unsupported relocation" errors.Lang Hames2019-04-201-1/+5
| | | | | | | The extra information here will be helpful in diagnosing errors, like the ones currently occuring on the PPC big-endian bots. :) llvm-svn: 358826
* [JITLink] Add check to JITLink unit test to bail out for unsupported targets.Lang Hames2019-04-203-19/+52
| | | | | | | This should prevent spurious JITLink unit test failures for builds that do not support the target(s) required by the tests. llvm-svn: 358825
* [JITLink] Silence some MSVC implicit cast warnings.Lang Hames2019-04-201-2/+3
| | | | llvm-svn: 358824
* [JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txtLang Hames2019-04-201-0/+1
| | | | llvm-svn: 358823
* [JITLink] Use memset instead of bzero.Lang Hames2019-04-201-2/+2
| | | | llvm-svn: 358822
* [JITLink] Silence a narrowing conversion warning.Lang Hames2019-04-201-1/+1
| | | | llvm-svn: 358821
* [JITLink] Update BuildingAJIT tutorials to account for API changes in r358818.Lang Hames2019-04-202-2/+4
| | | | | | | DynamicLibrarySearchGenerator::GetForCurrentProcess now takes a char (the global prefix) rather than a DataLayout reference. llvm-svn: 358820
* [JITLink] Fix a missing header and bad prototype.Lang Hames2019-04-201-1/+2
| | | | llvm-svn: 358819
* Initial implementation of JITLink - A replacement for RuntimeDyld.Lang Hames2019-04-2040-78/+6035
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: JITLink is a jit-linker that performs the same high-level task as RuntimeDyld: it parses relocatable object files and makes their contents runnable in a target process. JITLink aims to improve on RuntimeDyld in several ways: (1) A clear design intended to maximize code-sharing while minimizing coupling. RuntimeDyld has been developed in an ad-hoc fashion for a number of years and this had led to intermingling of code for multiple architectures (e.g. in RuntimeDyldELF::processRelocationRef) in a way that makes the code more difficult to read, reason about, extend. JITLink is designed to isolate format and architecture specific code, while still sharing generic code. (2) Support for native code models. RuntimeDyld required the use of large code models (where calls to external functions are made indirectly via registers) for many of platforms due to its restrictive model for stub generation (one "stub" per symbol). JITLink allows arbitrary mutation of the atom graph, allowing both GOT and PLT atoms to be added naturally. (3) Native support for asynchronous linking. JITLink uses asynchronous calls for symbol resolution and finalization: these callbacks are passed a continuation function that they must call to complete the linker's work. This allows for cleaner interoperation with the new concurrent ORC JIT APIs, while still being easily implementable in synchronous style if asynchrony is not needed. To maximise sharing, the design has a hierarchy of common code: (1) Generic atom-graph data structure and algorithms (e.g. dead stripping and | memory allocation) that are intended to be shared by all architectures. | + -- (2) Shared per-format code that utilizes (1), e.g. Generic MachO to | atom-graph parsing. | + -- (3) Architecture specific code that uses (1) and (2). E.g. JITLinkerMachO_x86_64, which adds x86-64 specific relocation support to (2) to build and patch up the atom graph. To support asynchronous symbol resolution and finalization, the callbacks for these operations take continuations as arguments: using JITLinkAsyncLookupContinuation = std::function<void(Expected<AsyncLookupResult> LR)>; using JITLinkAsyncLookupFunction = std::function<void(const DenseSet<StringRef> &Symbols, JITLinkAsyncLookupContinuation LookupContinuation)>; using FinalizeContinuation = std::function<void(Error)>; virtual void finalizeAsync(FinalizeContinuation OnFinalize); In addition to its headline features, JITLink also makes other improvements: - Dead stripping support: symbols that are not used (e.g. redundant ODR definitions) are discarded, and take up no memory in the target process (In contrast, RuntimeDyld supported pointer equality for weak definitions, but the redundant definitions stayed resident in memory). - Improved exception handling support. JITLink provides a much more extensive eh-frame parser than RuntimeDyld, and is able to correctly fix up many eh-frame sections that RuntimeDyld currently (silently) fails on. - More extensive validation and error handling throughout. This initial patch supports linking MachO/x86-64 only. Work on support for other architectures and formats will happen in-tree. Differential Revision: https://reviews.llvm.org/D58704 llvm-svn: 358818
* [X86] Disable argument copy elision for arguments passed via pointersCraig Topper2019-04-202-5/+9
| | | | | | | | | | | | | | | | | | | | | Summary: If you pass two 1024 bit vectors in IR with AVX2 on Windows 64. Both vectors will be split in four 256 bit pieces. The four pieces of the first argument will be passed indirectly using 4 gprs. The second argument will get passed via pointers in memory. The PartOffsets stored for the second argument are all in terms of its original 1024 bit size. So the PartOffsets for each piece are 32 bytes apart. So if we consider it for copy elision we'll only load an 8 byte pointer, but we'll move the address 32 bytes. The stack object size we create for the first part is probably wrong too. This issue was encountered by ISPC. I'm working on getting a reduce test case, but wanted to go ahead and get feedback on the fix. Reviewers: rnk Reviewed By: rnk Subscribers: dbabokin, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D60801 llvm-svn: 358817
* [CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.Luqman Aden2019-04-203-44/+45
| | | | | | | | | | | | | | | | | | | Summary: Teach CorrelatedValuePropagation to also handle sub instructions in addition to add. Relatively simple since makeGuaranteedNoWrapRegion already understood sub instructions. Only subtle change is which range is passed as "Other" to that function, since sub isn't commutative. Note that CorrelatedValuePropagation::processAddSub is still hidden behind a default-off flag as IndVarSimplify hasn't yet been fixed to strip the added nsw/nuw flags and causes a miscompile. (PR31181) Reviewers: sanjoy, apilipenko, nikic Reviewed By: nikic Subscribers: hiraditya, jfb, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60036 llvm-svn: 358816
* [ExecutionDomainFix] Optimize a binary search insertionFangrui Song2019-04-201-3/+3
| | | | llvm-svn: 358815
* [llvm-symbolizer] Fix section index at the end of a sectionFangrui Song2019-04-201-2/+1
| | | | | | | | This is very minor issue. The returned section index is only used by DWARFDebugLine as an llvm::upper_bound input and the use case shouldn't cause any behavioral change. llvm-svn: 358814
* [IndVarSimplify] Generate full checks for some LFTR tests; NFCNikita Popov2019-04-207-128/+326
| | | | llvm-svn: 358813
* [IndVarSimplify] Add tests for PR31181; NFCNikita Popov2019-04-201-0/+152
| | | | llvm-svn: 358812
* [ADT] Avoid warning in bsearch testcaseSam McCall2019-04-201-3/+3
| | | | llvm-svn: 358811
* [LLD][ELF] - Fix mistype. NFC.George Rimar2019-04-201-1/+1
| | | | | | | Change the tripple name from aarch64-linux-gnux to -triple=aarch64-linux-gnu llvm-svn: 358810
* [llvm-objdump] Fix End in disassemblyObject after rL358806Fangrui Song2019-04-201-3/+3
| | | | llvm-svn: 358809
* [CVP] Add tests for sub nowrap inference; NFCNikita Popov2019-04-201-0/+601
| | | | | | | | These are baseline tests for D60036. Patch by Luqman Aden. llvm-svn: 358808
* [X86] Fix stack probing on x32 (PR41477)Nikita Popov2019-04-203-8/+69
| | | | | | | | | | Fix for https://bugs.llvm.org/show_bug.cgi?id=41477. On the x32 ABI with stack probing a dynamic alloca will result in a WIN_ALLOCA_32 with a 32-bit size. The current implementation tries to copy it into RAX, resulting in a physreg copy error. Fix this by copying to EAX instead. Also fix incorrect opcodes or registers used in subs. llvm-svn: 358807
* [llvm-objdump] Don't disassemble symbols before SectionAddrFangrui Song2019-04-201-4/+6
| | | | | | | | | This was caught by UBSAN tools/llvm-objdump/X86/macho-disassembly-g-dsym.test tools/llvm-objdump/X86/hex-displacement.test llvm-svn: 358806
* [X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if ↵Craig Topper2019-04-202-24/+41
| | | | | | | | | | the original AND can represented by MOVZX. The MOVZX doesn't require an immediate to be encoded at all. Though it does use a 2 byte opcode so its the same size as a 1 byte immediate. But it has a separate source and dest register so can help avoid copies. llvm-svn: 358805
* [X86] Turn (and (anyextend (shl X, C1), C2)) into (shl (and (anyextend X), ↵Craig Topper2019-04-202-17/+36
| | | | | | | | | (C1 >> C2), C2) if the AND could match a movzx. There's one slight regression in here because we don't check that the immediate already allowed movzx before the shift. I'll fix that next. llvm-svn: 358804
* [llvm-objdump] Simplify --{start,stop}-addressFangrui Song2019-04-201-23/+13
| | | | llvm-svn: 358803
* [TSan] Support fiber API on macOSJulian Lettner2019-04-2015-43/+89
| | | | | | | | | | | | | | Committing on behalf of Yuri Per (yuri). Reviewers: dvyukov, kubamracek, yln Reviewed By: kubamracek Authored By: yuri Differential Revision: https://reviews.llvm.org/D58110 llvm-svn: 358802
* [WebAssembly] Object: Improve error messages on invalid sectionSam Clegg2019-04-202-3/+9
| | | | | | | | Also add a test. Differential Revision: https://reviews.llvm.org/D60836 llvm-svn: 358801
* Revert "Revert "[GlobalISel] Add legalization support for non-power-2 loads ↵Amara Emerson2019-04-195-32/+153
| | | | | | | | | and stores"" We were shifting the wrong component of a split load when trying to combine them back into a single value. llvm-svn: 358800
* [GlobalISel][AArch64] Legalize + select G_FRINTJessica Paquette2019-04-198-2/+661
| | | | | | | | | | Exactly the same as G_FCEIL, G_FABS, etc. Add tests for the fp16/nofp16 behaviour, update arm64-vfloatintrinsics, etc. Differential Revision: https://reviews.llvm.org/D60895 llvm-svn: 358799
* [WebAssembly] Emit the DataCount section when bulk memory is enabledThomas Lively2019-04-193-0/+30
| | | | | | | | | | | | | | | | | | Summary: The DataCount section is necessary for the bulk memory operations memory.init and data.drop to validate, but it is not recognized by engines that do not support bulk memory, so emit the section only if bulk-memory is enabled. Reviewers: aheejin, dschuff, sbc100 Subscribers: jgravelle-google, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60637 llvm-svn: 358798
* [analyzer] Move UninitializedObjectChecker out of alphaKristof Umann2019-04-1913-279/+286
| | | | | | | | | Moved UninitializedObjectChecker from the 'alpha.cplusplus' to the 'optin.cplusplus' package. Differential Revision: https://reviews.llvm.org/D58573 llvm-svn: 358797
* Modules: Adopt template parameters for variable templates to set their decl ↵David Blaikie2019-04-192-7/+6
| | | | | | | | | | | context correctly Exposed by a related bug about visibility of default arguments of nested templates - without the correct decl context, default template parameters of variable templates nested in classes would have incorrect visibility computed. llvm-svn: 358796
* Modules: Search for a visible definition of the decl context when computing ↵David Blaikie2019-04-1915-2/+95
| | | | | | | | | | | | | | | | | | | | | | | | | visibility of a default template parameter The code is/was already correct for the case where a parameter is a parameter of its enclosing lexical DeclContext (functions and classes). But for other templates (alias and variable templates) they don't create their own scope to be members of - in those cases, they parameter should be considered visible if any definition of the lexical decl context is visible. [this should cleanup the failure on the libstdc++ modules buildbot] [this doesn't actually fix the variable template case for a secondary/compounding reason (its lexical decl context is incorrectly considered to be the translation unit)] Test covers all 4 kinds of templates with default args, including a regression test for the still broken variable template case. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D60892 llvm-svn: 358795
* [COFF] Pack Name in Symbol as is done in ELFReid Kleckner2019-04-192-8/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: This assumes all symbols are <4GB long, so we can store them as a 32-bit integer. This reorders the fields so the length appears first, packing with the other bitfield data in the base Symbol object. This saved 70MB / 3.60% of heap allocations when linking browser_tests.exe with no PDB. It's not much as a percentage, but worth doing. I didn't do performance measurements, I don't think it will be measurable in time. Reviewers: ruiu, inglorion, amccarth, aganea Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60297 llvm-svn: 358794
* [WebAssembly] FastISel: Don't fallback to SelectionDAG after BuildMI in ↵Sam Clegg2019-04-192-6/+24
| | | | | | | | | | | | | | | | | selectCall My understanding is that once BuildMI has been called we can't fallback to SelectionDAG. This change moves the fallback for when getRegForValue() fails for that target of an indirect call. This was failing in -fPIC mode when the callee is GlobalValue. Add a test case that tickles this. Differential Revision: https://reviews.llvm.org/D60908 llvm-svn: 358793
* [Tests] Split float test into float and doublesJonas Devlieghere2019-04-194-18/+76
| | | | | | | | As I was waiting for the test suite to complete at 99% I noticed this test taking quite a bit of time. Since it's easy to split I just went ahead and did so. llvm-svn: 358792
* [GVN+LICM] Use line 0 locations for better crash attributionVedant Kumar2019-04-194-14/+14
| | | | | | | | | | | | This is a follow-up to r291037+r291258, which used null debug locations to prevent jumpy line tables. Using line 0 locations achieves the same effect, but works better for crash attribution because it preserves the right inline scope. Differential Revision: https://reviews.llvm.org/D60913 llvm-svn: 358791
* Update GN files to build with r358103Vitaly Buka2019-04-193-2/+14
| | | | llvm-svn: 358790
* Remove the EnableEarlyCSEMemSSA set of options from the legacyEric Christopher2019-04-192-10/+2
| | | | | | | | | and new pass managers. They were default to true and not being used. Differential Revision: https://reviews.llvm.org/D60747 llvm-svn: 358789
* [AArch64] Fix checks for AArch64MCExpr::VK_SABS flag.Eli Friedman2019-04-191-2/+2
| | | | | | | | | | | | | | VK_SABS is part of the SymLoc bitfield in the variant kind which should be compared for equality, not by checking the VK_SABS bit. As far as I know, the existing code happened to produce the correct results in all cases, so this is just a cleanup. Patch by Stephen Crane. Differential Revision: https://reviews.llvm.org/D60596 llvm-svn: 358788
* [GlobalISel] Add IRTranslator support for G_FRINTJessica Paquette2019-04-192-0/+10
| | | | | | | | Add it as a simple intrinsic, update arm64-irtranslator.ll. Differential Revision: https://reviews.llvm.org/D60893 llvm-svn: 358787
* Attempt to fix buildbot failure in commit ↵Amy Huang2019-04-191-1/+1
| | | | | | 1bb57bac959ac163fd7d8a76d734ca3e0ecee6ab. llvm-svn: 358786
OpenPOWER on IntegriCloud