summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [COFF] Make the weak aliases optionalMartin Storsjo2017-08-163-4/+5
| | | | | | | | | | | | | | | | When creating an import library from lld, the cases with Name != ExtName shouldn't end up as a weak alias, but as a real export of the new name, which is what actually is exported from the DLL. This restores the behaviour of renamed exports to what it was in 4.0. The other half of this commit, including test, goes into lld. Differential Revision: https://reviews.llvm.org/D36633 llvm-svn: 310991
* [llvm-dlltool] Fix creating stdcall/fastcall import libraries for i386Martin Storsjo2017-08-164-4/+52
| | | | | | | | | | | | | | | | | | | | | Hook up the -k option (that in the original GNU dlltool removes the @n suffix from the symbol that the final executable ends up linked to). In llvm-dlltool, make sure that functions end up with the undecorate name type if this option is set and they are decorated. In mingw, when creating import libraries from def files instead of creating an import library as a side effect of linking a DLL, the symbol names in the def contain the stdcall/fastcall decoration (but no leading underscore). By setting the undecorate name type, a linker linking to the import library will omit the decoration from the DLL import entry. With this in place, mingw-w64 for i386 built with llvm-dlltool/clang produces import libraries that actually work. Differential Revision: https://reviews.llvm.org/D36548 llvm-svn: 310990
* [COFF] Fix the name type for stdcall functions in import librariesMartin Storsjo2017-08-162-3/+4
| | | | | | | | | | | | | | | | | | | | | Since SVN r303491 and r304573, LLD used the COFFImportLibrary functions from LLVM. These only had two names, Name and ExtName, which wasn't enough to convey all the details of stdcall functions. Stdcall functions got the wrong symbol name in the import library itself in r303491, which is why it was reverted in r304561. When re-landed and fixed in r304573 (after adding a test in r304572), the symbol name itself in the import library ended up right, but the name type of the import library entry was wrong. This had the effect that linking to the import library succeeded (contrary to in r303491, where linking to such an import library failed), but at runtime, the symbol wouldn't be found in the DLL (since the caller linked to the stdcall decorated name). Differential Revision: https://reviews.llvm.org/D36545 llvm-svn: 310989
* [COFF] Add SymbolName as a distinct field in COFFImportFileMartin Storsjo2017-08-162-1/+2
| | | | | | | | | | | The previous Name and ExtName aren't enough to convey all the nuances between weak aliases and stdcall decorated function names. A test for this will be added in LLD. Differential Revision: https://reviews.llvm.org/D36544 llvm-svn: 310988
* [AMDGPU] Eliminate no effect instructions before s_endpgmStanislav Mekhanoshin2017-08-1615-32/+406
| | | | | | Differential Revision: https://reviews.llvm.org/D36585 llvm-svn: 310987
* Fix comments about __OPENCL_MEMORY_SCOPE_* macrosYaxun Liu2017-08-161-1/+1
| | | | llvm-svn: 310986
* Merge debug info when hoist then-else code to if.Dehao Chen2017-08-162-0/+41
| | | | | | | | | | | | | | Summary: When we move then-else code to if, we need to merge its debug info, otherwise the hoisted instruction may have inaccurate debug info attached. Reviewers: aprantl, probinson, dblaikie, echristo, loladiro Reviewed By: aprantl Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D36778 llvm-svn: 310985
* Fix typo in variable name.Lang Hames2017-08-161-1/+1
| | | | llvm-svn: 310984
* PR19668, PR23034: Fix handling of move constructors and deleted copyRichard Smith2017-08-1611-128/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructors when deciding whether classes should be passed indirectly. This fixes ABI differences between Clang and GCC: * Previously, Clang ignored the move constructor when making this determination. It now takes the move constructor into account, per https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may seem recent, but the ABI change was agreed on the Itanium C++ ABI list a long time ago). * Previously, Clang's behavior when the copy constructor was deleted was unstable -- depending on whether the lazy declaration of the copy constructor had been triggered, you might get different behavior. We now eagerly declare the copy constructor whenever its deletedness is unclear, and ignore deleted copy/move constructors when looking for a trivial such constructor. This also fixes an ABI difference between Clang and MSVC: * If the copy constructor would be implicitly deleted (but has not been lazily declared yet), for instance because the class has an rvalue reference member, we would pass it directly. We now pass such a class indirectly, matching MSVC. Based on a patch by Vassil Vassilev, which was based on a patch by Bernd Schmidt, which was based on a patch by Reid Kleckner! This is a re-commit of r310401, which was reverted in r310464 due to ARM failures (which should now be fixed). llvm-svn: 310983
* Add test that we get the correct calling convention and mangling for va_list.Richard Smith2017-08-161-0/+36
| | | | llvm-svn: 310982
* [WebAssembly] Remove infinite loop from reg-stackify testDerek Schuff2017-08-161-1/+3
| | | | | | | | | | | | | r310940 exposed reverse-unreachable code to some optimizers, which caused some of the code in this test to be sunk, changing the input to the pass and breaking the exptectations. Since that change is irrelevant to this particular test, this change just adds an exit node to work around the problem; the test should really be more robust (or be an MIR test?) but this preserves the existing test intent. llvm-svn: 310981
* [Polly] XFAIL ReportLoopHasNoExit tests after r310940Jakub Kuderski2017-08-161-0/+6
| | | | | | | | | | | ReportLoopHasNoExit started failing after r310940 that added infinite loops to postdominators. The change made regions not contain infinite loops anymore. This patch unbreaks the polly tree by XFAILING the ReportLoopHasNoExit test. Full fix is under review in D36776. llvm-svn: 310980
* [VirtRegRewriter] Properly model the register liveness on undef subreg ↵Quentin Colombet2017-08-162-1/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition Undef subreg definition means that the content of the super register doesn't matter at this point. While that's true for virtual registers, this may not hold when replacing them with actual physical registers. Indeed, some part of the physical register may be coalesced with the related virtual register and thus, the values for those parts matter and must be live. The fix consists in checking whether or not subregs of the physical register being assigned to an undef subreg definition are live through that def and insert an implicit use if they are. Doing so, will keep them alive until that point like they should be. E.g., let vreg14 being assigned to R0_R1 then %vreg14:gsub_0<def,read-undef> = COPY %R0 ; <-- R1 is still live here %vreg14:gsub_1<def> = COPY %R1 Before this changes, the rewriter would change the code into: %R0<def> = KILL %R0, %R0_R1<imp-def> ; <-- this tells R1 is redefined %R1<def> = KILL %R1, %R0_R1<imp-def>, %R0_R1<imp-use> ; this value of this R1 ; is believed to come ; from the previous ; instruction Because of this invalid liveness, later pass could make wrong choices and in particular clobber live register as it happened with the register scavenger in llvm.org/PR34107 Now we would generate: %R0<def> = KILL %R0, %R0_R1<imp-def>, %R0_R1<imp-use> ; This tells R1 needs to ; reach this point %R1<def> = KILL %R1, %R0_R1<imp-def>, %R0_R1<imp-use> The bug has been here forever, it got exposed recently because the register scavenger got smarter. Fixes llvm.org/PR34107 llvm-svn: 310979
* Add missing test for warning added in r310803.Richard Smith2017-08-161-0/+9
| | | | llvm-svn: 310978
* Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""Dan Albert2017-08-158-43/+13
| | | | llvm-svn: 310977
* Revert "Add a target for new LTO plugin name tests."Dan Albert2017-08-153-3/+3
| | | | llvm-svn: 310976
* Revert archive-* tests from r310953, there were test failures.Kuba Mracek2017-08-155-5/+5
| | | | llvm-svn: 310974
* Quickfix to the refactoring commit: typo in the link flags variableGeorge Karpenkov2017-08-151-1/+1
| | | | | | name. llvm-svn: 310973
* Do not look through pack expansions when looking for unexpanded parameter packs.Richard Smith2017-08-154-19/+197
| | | | | | | Fixes a selection of rejects-valids when pack-expanding a lambda that itself contains a pack expansion. llvm-svn: 310972
* [sanitizers CMake] NFC Refactor the logic for compiling and generating testsGeorge Karpenkov2017-08-156-239/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | into a function. Most CMake configuration under compiler-rt/lib/*/tests have almost-the-same-but-not-quite functions of the form add_X_[unit]tests for compiling and running the tests. Much of the logic is duplicated with minor variations across different sub-folders. This can harm productivity for multiple reasons: For newcomers, resulting CMake files are very large, hard to understand, and hide the intention of the code. Changes for enabling certain architectures end up being unnecessarily large, as they get duplicated across multiple folders. Adding new sub-projects requires more effort than it should, as a developer has to again copy-n-paste the configuration, and it's not even clear from which sub-project it should be copy-n-pasted. With this change the logic of compile-and-generate-a-set-of-tests is extracted into a function, which hopefully makes writing and reading CMake much easier. Differential Revision: https://reviews.llvm.org/D36116 llvm-svn: 310971
* [InstCombine] Teach canEvaluateZExtd and canEvaluateTruncated to handle ↵Craig Topper2017-08-152-10/+71
| | | | | | | | | | vector shifts with splat shift amount We were only allowing ConstantInt before. This patch allows splat of ConstantInt too. Differential Revision: https://reviews.llvm.org/D36763 llvm-svn: 310970
* Reapply "[GlobalISel] Remove the GISelAccessor API."Quentin Colombet2017-08-1511-241/+76
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r310425, thus reapplying r310335 with a fix for link issue of the AArch64 unittests on Linux bots when BUILD_SHARED_LIBS is ON. Original commit message: [GlobalISel] Remove the GISelAccessor API. Its sole purpose was to avoid spreading around ifdefs related to building global-isel. Since r309990, GlobalISel is not optional anymore, thus, we can get rid of this mechanism all together. NFC. ---- The fix for the link issue consists in adding the GlobalISel library in the list of dependencies for the AArch64 unittests. This dependency comes from the use of AArch64Subtarget that needs to know how to destruct the GISel related APIs when being detroyed. Thanks to Bill Seurer and Ahmed Bougacha for helping me reproducing and understand the problem. llvm-svn: 310969
* configure.py: Drop explicit import of int builtinJan Vesely2017-08-151-6/+0
| | | | | | | | | | I can't reproduce the error that made me add this. Reported-by: Kim Gräsman <kim.grasman@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Kim Gräsman <kim.grasman@gmail.com> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 310968
* [ThinLTO] Fix ThinLTO crash while destroying contextCharles Saternos2017-08-152-6/+17
| | | | | | | | Fix for PR32763 An assert that checks if a Ref was untracked fails during ThinLTO context cleanup. The issue is because lazy loading temporary nodes didn't properly track ValueAsMetadata nodes. This patch ensures that the temporary nodes are properly tracked when they're replaced with the value. llvm-svn: 310967
* Add a target for new LTO plugin name tests.Dan Albert2017-08-153-3/+3
| | | | | | | | | Not all targets will use -plugin with -flto. Pick a fixed target so this works regardless of the default target (regardless of host OS, the toolchain should be picking the correct LTO plugin for a target that supports it). llvm-svn: 310966
* Fix warning about unused variable.Zachary Turner2017-08-151-1/+3
| | | | | | | | | I'm explicitly ignoring the warning by casting to void instead of deleting the local assignment, because it's confusing to see a function that fails when its return value evaluates to true. But when you see that it's a std::error_code, it makes more sense. llvm-svn: 310965
* Extract IRGen's constant-emitter into its own helper class and clean upJohn McCall2017-08-1511-289/+811
| | | | | | | | | | | | the interface. The ultimate goal here is to make it easier to do some more interesting things in constant emission, like emit constant initializers that have ignorable side-effects, or doing the majority of an initialization in-place and then patching up the last few things with calls. But for now this is mostly just a refactoring. llvm-svn: 310964
* Allow the target field of a CK_ToUnion to be more easily recovered.John McCall2017-08-153-13/+36
| | | | llvm-svn: 310963
* Allow StmtVisitor visitation to be parameterized. NFC.John McCall2017-08-151-12/+14
| | | | llvm-svn: 310962
* [LLD COFF/PDB] Incrementally update the build id.Zachary Turner2017-08-158-69/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, our algorithm to compute a build id involved hashing the executable and storing that as the GUID in the CV Debug Record chunk, and setting the age to 1. This breaks down in one very obvious case: a user adds some newlines to a file, rebuilds, but changes nothing else. This causes new line information and new file checksums to get written to the PDB, meaning that the debug info is different, but the generated code would be the same, so we would write the same build over again with an age of 1. Anyone using a symbol cache would have a problem now, because the debugger would open the executable, look at the age and guid, find a matching PDB in the symbol cache and then load it. It would never copy the new PDB to the symbol cache. This patch implements the canonical Windows algorithm for updating a build id, which is to check the existing executable first, and re-use an existing GUID while bumping the age if it already exists. Differential Revision: https://reviews.llvm.org/D36758 llvm-svn: 310961
* Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""Dan Albert2017-08-158-13/+43
| | | | | | | | | | | | | | | | | | | Summary: Relanding https://reviews.llvm.org/D35739 which was reverted because it broke the tests on non-Linux. The tests have been fixed to be platform agnostic, and additional tests have been added to make sure that the plugin has the correct extension on each platform (%pluginext doesn't work in CHECK lines). Reviewers: srhines, pirama Reviewed By: srhines Subscribers: emaste, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D36769 llvm-svn: 310960
* Update NSArray/NSDictionary/NSSet formatters to handle newJason Molenda2017-08-153-467/+546
| | | | | | | | | macOS 10.13 - High Sierra - internal layouts. Patch by Sean Callanan. <rdar://problem/33282015> llvm-svn: 310959
* Switch to consumeError(), since this can crash otherwise.Stephen Hines2017-08-151-1/+1
| | | | | | | | | | | | | | | | | Summary: If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled, this will cause an issue with an unchecked Success. Switching to consumeError() is the correct way to bypass the check. Reviewers: llvm-commits, cfe-commits, arphaman Reviewed By: arphaman Subscribers: arphaman, klimek, pirama Differential Revision: https://reviews.llvm.org/D36728 llvm-svn: 310958
* Revert changes in r310953 for llvm-symbolizer.test. The change causes a test ↵Kuba Mracek2017-08-151-49/+48
| | | | | | failure. llvm-svn: 310956
* [CMake] Fixing an error in STREQUAL usage.Chris Bieneman2017-08-151-1/+1
| | | | llvm-svn: 310955
* Update AMDGPUUsage.rst documentation:Tony Tye2017-08-151-271/+315
| | | | | | | | | | | | 1. Correct description of the kernel initial state for FLAT_SCRATCH_INIT. 2. Add link to GFX9 architecture documentation. 3. Update product names. 4. Rename note record from NT_AMD_AMDGPU_METADATA to NT_AMD_AMDGPU_HSA_METADATA and move description to the AMDHSA coding convention section. 5. Minor typo corrections. Differential Revision: https://reviews.llvm.org/D36549 llvm-svn: 310954
* [llvm] Get rid of "%T" expansionsKuba Mracek2017-08-1568-364/+395
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in llvm. Differential Revision: https://reviews.llvm.org/D36495 llvm-svn: 310953
* Fixup for r310950: Also remove the new instance of %T from html-diags.cKuba Mracek2017-08-151-4/+4
| | | | llvm-svn: 310952
* [clang] Get rid of "%T" expansionsKuba Mracek2017-08-1523-171/+185
| | | | | | | | | | The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in clang. Differential Revision: https://reviews.llvm.org/D36437 llvm-svn: 310950
* [InstCombine] Added support for (X >>s C) << C --> X & (-1 << C)Amjad Aboud2017-08-152-2/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D36743 llvm-svn: 310949
* [clang] Code cleanup in clang/toolingAlexander Shaposhnikov2017-08-152-2/+2
| | | | | | | | | 1. Add missing explicit for SymbolName constructor. 2. Add missing std::move in createRenameReplacements. Differential revision: https://reviews.llvm.org/D36715 llvm-svn: 310948
* [ORC][Kaleidoscope] Update Chapter 1 of BuildingAJIT to incorporate recent ORCLang Hames2017-08-153-84/+109
| | | | | | API changes. llvm-svn: 310947
* PR33082: Improve tracking of unexpanded parameter packs within variadic ↵Richard Smith2017-08-153-39/+117
| | | | | | generic lambdas. llvm-svn: 310946
* [CMake compiler-rt] NFC: Minor CMake refactoring.George Karpenkov2017-08-152-8/+7
| | | | | | | | | Detect ObjC files in `clang_compile` and pass an appropriate flag to a compiler, also change `clang_compile` to a function. Differential Revision: https://reviews.llvm.org/D36727 llvm-svn: 310945
* [compiler-rt CMake] NFC: Minor CMake refactoring.George Karpenkov2017-08-151-9/+6
| | | | | | | | | | Change macro to a function, and use a generic variable instead of branching for handling multi-output build with CMAKE_CONFIGURATION_TYPES. Differential Revision: https://reviews.llvm.org/D36725 llvm-svn: 310944
* [compiler-rt CMake] CMake refactoring: create directories in helper func.George Karpenkov2017-08-152-10/+7
| | | | | | | | | Change macro to a function, move creating test directory into `add_compiler_rt_test`. Differential Revision: https://reviews.llvm.org/D36724 llvm-svn: 310943
* [InstCombine] sink sext after ashrSanjay Patel2017-08-153-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Narrow ops are better for bit-tracking, and in the case of vectors, may enable better codegen. As the trunc test shows, this can allow follow-on simplifications. There's a block of code in visitTrunc that deals with shifted ops with FIXME comments. It may be possible to remove some of that now, but I want to make sure there are no problems with this step first. http://rise4fun.com/Alive/Y3a Name: hoist_ashr_ahead_of_sext_1 %s = sext i8 %x to i32 %r = ashr i32 %s, 3 ; shift value is < than source bit width => %a = ashr i8 %x, 3 %r = sext i8 %a to i32 Name: hoist_ashr_ahead_of_sext_2 %s = sext i8 %x to i32 %r = ashr i32 %s, 8 ; shift value is >= than source bit width => %a = ashr i8 %x, 7 ; so clamp this shift value %r = sext i8 %a to i32 Name: junc_the_trunc %a = sext i16 %v to i32 %s = ashr i32 %a, 18 %t = trunc i32 %s to i16 => %t = ashr i16 %v, 15 llvm-svn: 310942
* [Polly] [GPUJIT] Set min size to 1 on CUDA allocation calls. [NFC]Siddharth Bhat2017-08-151-0/+16
| | | | | | | | | | | | | | | Requesting size 0 allocations from `cuMalloc` / `cuMallocManaged` fails. If there is a size 0 allocation that can be statically proved, the we fail at PPCGCodeGeneration. This is because if size 0 allocation could take place, we should not generate code that tries to use this array. However, there are cases where we cannot statically prove this, and at runtime we get a request for 0 bytes of memory. We choose to allocate size 1 to allow the program to continue running. Differential Revision: https://reviews.llvm.org/D36751 llvm-svn: 310941
* [Dominators] Include infinite loops in PostDominatorTreeJakub Kuderski2017-08-1523-226/+731
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch teaches PostDominatorTree about infinite loops. It is built on top of D29705 by @dberlin which includes a very detailed motivation for this change. What's new is that the patch also teaches the incremental updater how to deal with reverse-unreachable regions and how to properly maintain and verify tree roots. Before that, the incremental algorithm sometimes ended up preserving reverse-unreachable regions after updates that wouldn't appear in the tree if it was constructed from scratch on the same CFG. This patch makes the following assumptions: - A sequence of updates should produce the same tree as a recalculating it. - Any sequence of the same updates should lead to the same tree. - Siblings and roots are unordered. The last two properties are essential to efficiently perform batch updates in the future. When it comes to the first one, we can decide later that the consistency between freshly built tree and an updated one doesn't matter match, as there are many correct ways to pick roots in infinite loops, and to relax this assumption. That should enable us to recalculate postdominators less frequently. This patch is pretty conservative when it comes to incremental updates on reverse-unreachable regions and ends up recalculating the whole tree in many cases. It should be possible to improve the performance in many cases, if we decide that it's important enough. That being said, my experiments showed that reverse-unreachable are very rare in the IR emitted by clang when bootstrapping clang. Here are the statistics I collected by analyzing IR between passes and after each removePredecessor call: ``` # functions: 52283 # samples: 337609 # reverse unreachable BBs: 216022 # BBs: 247840796 Percent reverse-unreachable: 0.08716159869015269 % Max(PercRevUnreachable) in a function: 87.58620689655172 % # > 25 % samples: 471 ( 0.1395104988314885 % samples ) ... in 145 ( 0.27733680163724345 % functions ) ``` Most of the reverse-unreachable regions come from invalid IR where it wouldn't be possible to construct a PostDomTree anyway. I would like to commit this patch in the next week in order to be able to complete the work that depends on it before the end of my internship, so please don't wait long to voice your concerns :). Reviewers: dberlin, sanjoy, grosser, brzycki, davide, chandlerc, hfinkel Reviewed By: dberlin Subscribers: nhaehnle, javed.absar, kparzysz, uabelho, jlebar, hiraditya, llvm-commits, dberlin, david2050 Differential Revision: https://reviews.llvm.org/D35851 llvm-svn: 310940
* test-release.sh: Move test-suite setup to beginning of the scriptTom Stellard2017-08-151-8/+13
| | | | | | | | | | | | | | | | | | | Summary: We want to catch failures early before do the full 3 stage build. The goal here is to avoid running through the whole build process and have it fail at the end (and not create the binary packages), just because some prerequisites failed to install. Reviewers: rovka, hans Reviewed By: hans Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36422 llvm-svn: 310939
OpenPOWER on IntegriCloud