summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: ensure that libcalls are always AAPCS CCSaleem Abdulrasool2016-09-073-9/+171
| | | | | | | The original commit was too aggressive about marking LibCalls as AAPCS. The libcalls contain libc/libm/libunwind calls which are not AAPCS, but C. llvm-svn: 280833
* X86: Fold tail calls into conditional branches where possible (PR26302)Hans Wennborg2016-09-078-17/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When branching to a block that immediately tail calls, it is possible to fold the call directly into the branch if the call is direct and there is no stack adjustment, saving one byte. Example: define void @f(i32 %x, i32 %y) { entry: %p = icmp eq i32 %x, %y br i1 %p, label %bb1, label %bb2 bb1: tail call void @foo() ret void bb2: tail call void @bar() ret void } before: f: movl 4(%esp), %eax cmpl 8(%esp), %eax jne .LBB0_2 jmp foo .LBB0_2: jmp bar after: f: movl 4(%esp), %eax cmpl 8(%esp), %eax jne bar .LBB0_1: jmp foo I don't expect any significant size savings from this (on a Clang bootstrap I saw 288 bytes), but it does make the code a little tighter. This patch only does 32-bit, but 64-bit would work similarly. Differential Revision: https://reviews.llvm.org/D24108 llvm-svn: 280832
* ELF: add version script void function test caseEd Maste2016-09-071-2/+21
| | | | | | | | | | | | After r280733 we use LLVM's demangler in lld. As a result we no longer have a discrepancy between f() and f(void) on FreeBSD (due to an issue with FreeBSD's system demangler). Restore a test case for a void arg function. Differential Revision: https://reviews.llvm.org/D24305 llvm-svn: 280831
* [lib/LTO] Add a way to run a custom pipelineDavide Italiano2016-09-075-1/+84
| | | | | | Differential Revision: https://reviews.llvm.org/D24095 llvm-svn: 280830
* AMDGPU: Add hidden kernel arguments to runtime metadataYaxun Liu2016-09-073-114/+1483
| | | | | | | | OpenCL kernels have hidden kernel arguments for global offset and printf buffer. For consistency, these hidden argument should be included in the runtime metadata. Also updated kernel argument kind metadata. Differential Revision: https://reviews.llvm.org/D23424 llvm-svn: 280829
* [clang-offload-bundler] Fix some Clang-tidy modernize-use-override and ↵Eugene Zelenko2016-09-071-80/+120
| | | | | | | | Include What You Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D24165 llvm-svn: 280828
* Add missing include. White space.Vassil Vassilev2016-09-071-1/+2
| | | | llvm-svn: 280827
* Add MS __nop intrinsic to intrin.hReid Kleckner2016-09-072-0/+6
| | | | | | | | | | | | | | | Summary: There was no definition for __nop function - added inline assembly. Patch by Albert Gutowski! Reviewers: rnk, thakis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24286 llvm-svn: 280826
* Parsing MS pragma intrinsicReid Kleckner2016-09-075-2/+82
| | | | | | | | | | | | | | | Parse pragma intrinsic, display warning if the function isn't a builtin function in clang and suggest including intrin.h. Patch by Albert Gutowski! Reviewers: aaron.ballman, rnk Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D23944 llvm-svn: 280825
* [include-fixer] Support finding headers for the symbol under cursor.Haojian Wu2016-09-075-12/+111
| | | | | | | | | | | | | | Summary: * Add a `query-symbol` option to query symbol without parsing the source file. * Update Vim & Emacs integration scripts. Reviewers: bkramer, massberg Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24075 llvm-svn: 280824
* [powerpc] Disable ManyThreadsWithStatsStressTest test for ppc64Bill Seurer2016-09-071-0/+4
| | | | | | | | Since r279664 this test causes frequent failures of test runs for ppc64le and occasional failures for ppc64be which makes buildbot results unreliable. If the underlying problem is fixed it can be re-enabled. llvm-svn: 280823
* [codeview] Add new directives to record inlined call site line infoReid Kleckner2016-09-0723-176/+741
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we were trying to represent this with the "contains" list of the .cv_inline_linetable directive, which was not enough information. Now we directly represent the chain of inlined call sites, so we know what location to emit when we encounter a .cv_loc directive of an inner inlined call site while emitting the line table of an outer function or inlined call site. Fixes PR29146. Also fixes PR29147, where we would crash when .cv_loc directives crossed sections. Now we write down the section of the first .cv_loc directive, and emit an error if any other .cv_loc directive for that function is in a different section. Also fixes issues with discontiguous inlined source locations, like in this example: volatile int unlikely_cond = 0; extern void __declspec(noreturn) abort(); __forceinline void f() { if (!unlikely_cond) abort(); } int main() { unlikely_cond = 0; f(); unlikely_cond = 0; } Previously our tables gave bad location information for the 'abort' call, and the debugger wouldn't snow the inlined stack frame for 'f'. It is important to emit good line tables for this code pattern, because it comes up whenever an asan bug occurs in an inlined function. The __asan_report* stubs are generally placed after the normal function epilogue, leading to discontiguous regions of inlined code. Reviewers: majnemer, amccarth Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24014 llvm-svn: 280822
* Use llvm's demangler.Rafael Espindola2016-09-075-4424/+4
| | | | | | | LLVM now has a copy of libcxxabi demangler, so lldb doesn't need to keep one too. llvm-svn: 280821
* [LoopInterchange] Improve debug output. NFC.Chad Rosier2016-09-071-6/+6
| | | | llvm-svn: 280820
* [LoopInterchange] Improve debug output. NFC.Chad Rosier2016-09-071-4/+6
| | | | llvm-svn: 280819
* [LSV] Use the original loads' names for the extractelement instructions.Justin Lebar2016-09-073-37/+39
| | | | | | | | | | | | | | | | Summary: LSV replaces multiple adjacent loads with one vectorized load and a bunch of extractelement instructions. This patch makes the extractelement instructions' names match those of the original loads, for (hopefully) improved readability. Reviewers: asbirlea, tstellarAMD Subscribers: arsenm, mzolotukhin Differential Revision: https://reviews.llvm.org/D23748 llvm-svn: 280818
* [x86] move combines of 'select of 2 constants' to its own function; NFCSanjay Patel2016-09-071-92/+103
| | | | | | There are missing folds here and possibly folds that could be made generic. llvm-svn: 280817
* Fix typo in test - it should be masking bits0-15 not bit16Simon Pilgrim2016-09-071-1/+1
| | | | llvm-svn: 280816
* [MS] Fix 'this' type when calling virtual methods with inallocaReid Kleckner2016-09-072-9/+40
| | | | | | | | | | | | | | If the virtual method comes from a secondary vtable, then the type of the 'this' parameter should be i8*, and not a pointer to the complete class. In the MS ABI, the 'this' parameter on entry points to the vptr containing the virtual method that was called, so we use i8* instead of the normal type. We had a mismatch where the CGFunctionInfo of the call didn't match the CGFunctionInfo of the declaration, and this resulted in some assertions, but now both sides agree the type of 'this' is i8*. Fixes one issue raised in PR30293 llvm-svn: 280815
* Regenerate vector bitcast folding tests using update_test_checks.py.Andrea Di Biagio2016-09-073-108/+125
| | | | | | | Two tests have been merged together, regenerated and then moved to a more appropriate directory. No functional change. llvm-svn: 280814
* [X86][SSE] Added or combine tests for known bits of vectorsSimon Pilgrim2016-09-071-0/+51
| | | | | | Part of the yak shaving for D24253 llvm-svn: 280813
* [asan] Reify ErrorNewDeleteSizeMismatchFilipe Cabecinhas2016-09-075-23/+58
| | | | | | | | | | | | Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23874 llvm-svn: 280812
* Disable MSVC warnings on ISL.Michael Kruse2016-09-071-0/+11
| | | | | | | | Disable some Visual C++ warnings on ISL. These are not reported by GCC/Clang in the ISL build system. We do not intend to fix them in the Polly in-tree copy, hence disable these warnings. llvm-svn: 280811
* [X86][SSE] Added and+or+zext combine tests for known bits of vectorsSimon Pilgrim2016-09-071-0/+32
| | | | | | Part of the yak shaving for D24253 llvm-svn: 280810
* [X86][SSE] Added and+or combine tests currently failing with vectorsSimon Pilgrim2016-09-071-1/+28
| | | | | | | | (and (or x, C), D) -> D if (C & D) == D Part of the yak shaving for D24253 llvm-svn: 280809
* [ARM] Lower UDIV+UREM to UDIV+MLS (and the same for SREM)Pablo Barrio2016-09-072-1/+61
| | | | | | | | | | | | | | | Summary: This saves a library call to __aeabi_uidivmod. However, the processor must feature hardware division in order to benefit from the transformation. Reviewers: scott-0, jmolloy, compnerd, rengolin Subscribers: t.p.northover, compnerd, aemerson, rengolin, samparker, llvm-commits Differential Revision: https://reviews.llvm.org/D24133 llvm-svn: 280808
* [InstCombine][SSE4a] Fix assertion failure in the insertq/insertqi combining ↵Andrea Di Biagio2016-09-072-3/+21
| | | | | | | | | | | logic. This fixes a similar issue to the one already fixed by r280804 (revieved in D24256). Revision 280804 fixed the problem with unsafe dyn_casts in the extrq/extrqi combining logic. However, it turns out that even the insertq/insertqi logic was affected by the same problem. llvm-svn: 280807
* [EfficiencySanitizer] [MIPS64] Enables esan clang driver options for MIPS64Sagar Thakur2016-09-072-1/+5
| | | | | | | Reviewed by bruening Differential: D23800 llvm-svn: 280806
* Enable test on windows.Rafael Espindola2016-09-071-1/+1
| | | | | | It looks like it was disable just because we were missing a demangler. llvm-svn: 280805
* [InstCombine][SSE4a] Fix assertion failure caused by unsafe dyn_casts on the ↵Andrea Di Biagio2016-09-072-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | operands of extrq/extrqi intrinsic calls. This patch fixes an assertion failure caused by unsafe dynamic casts on the constant operands of sse4a intrinsic calls to extrq/extrqi The combine logic that simplifies sse4a extrq/extrqi intrinsic calls currently checks if the input operands are constants. Internally, that logic relies on dyn_casts of values returned by calls to method Constant::getAggregateElement. However, method getAggregateElemet may return nullptr if the constant element cannot be retrieved. So, all the dyn_casts can potentially fail. This is what happens for example if a constexpr value is passed in input to an extrq/extrqi intrinsic call. This patch fixes the problem by using a dyn_cast_or_null (instead of a simple dyn_cast) on the result of each call to Constant::getAggregateElement. Added reproducible test cases to x86-sse4a.ll. Differential Revision: https://reviews.llvm.org/D24256 llvm-svn: 280804
* [ELF] - Sort command line options. NFC.George Rimar2016-09-071-3/+3
| | | | llvm-svn: 280803
* Revert "[EfficiencySanitizer] Adds shadow memory parameters for 40-bit ↵Renato Golin2016-09-071-34/+9
| | | | | | | | | | | virtual memory address." This reverts commit r280796, as it broke the AArch64 bots for no reason. The tests were passing and we should try to keep them passing, so a proper review should make that happen. llvm-svn: 280802
* [ELF] - Linkerscript: create multiple output sections for inputs with ↵George Rimar2016-09-074-71/+45
| | | | | | | | | | | | | | | different attributes. Previously we combined sections by name if linkerscript was used. For that we had to disable SHF_MERGE handling temporarily, but then found that implementing it properly will require additional complexity layers like subsections or something. At the same time looks we can live with multiple output sections approach for now. That patch do this change. Differential revision: https://reviews.llvm.org/D24127 llvm-svn: 280801
* [OpenCL] Fix pipe built-in functions return type.Alexey Bader2016-09-072-0/+18
| | | | | | | | | | | | | | | By default return type of call expressions calling built-in functions is set to bool. Fixes https://llvm.org/bugs/show_bug.cgi?id=30219. Reviewers: Anastasia Subscribers: dmitry, cfe-commits, yaxunl Differential Revision: https://reviews.llvm.org/D24136 llvm-svn: 280800
* [ELF] - Fix for: PR29093 - version script does not support [chars] wildcardsGeorge Rimar2016-09-073-6/+115
| | | | | | | | | | | | | | | | | | | | | | | | GNU ld supports [chars] wildcards in version scripts, to match a single instance of any of the chars. Here is an extern example from libstdc++'s version script in FreeBSD: extern "C++" { ... std::locale::_[T-Za-z]*; std::[A-Zm]*; std::n[^u]*; std::nu[^m]*; std::num[^e]*; ... } Patch adds support for scripts above. This is PR29093. Differential revision: https://reviews.llvm.org/D23803 llvm-svn: 280799
* [mips] Disable the TImode shift libcalls for 32-bit targets.Vasileios Kalintiris2016-09-074-9/+16
| | | | | | | | | | | | | | Summary: The o32 ABI doesn't not support the TImode helpers. For the time being, disable just the shift libcalls as they break recursive builds on MIPS. Reviewers: sdardis Subscribers: llvm-commits, sdardis Differential Revision: https://reviews.llvm.org/D24259 llvm-svn: 280798
* [ELF] - Enable testcases that uses demangler to run under windows and escape ↵George Rimar2016-09-072-9/+9
| | | | | | | | | | | | | | quotes around "C++". Previously testcases were enabled only for shell. r280733 added c++ itanium demangler to lld and we can enable them fully. Also this change make quotes to be escaped: extern "C++" -> extern \"C++\", which worked before just because we are dropping tokens quotes internally at this moment. llvm-svn: 280797
* [EfficiencySanitizer] Adds shadow memory parameters for 40-bit virtual ↵Sagar Thakur2016-09-071-9/+34
| | | | | | | | | | | memory address. Adding 40-bit shadow memory parameters because MIPS64 uses 40-bit virtual memory addresses. Reviewed by bruening Differential: D23801 llvm-svn: 280796
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-09-0713-36/+175
| | | | | | | | | | | | | | | With this patch 10 out of 13 tests are passing. Following is the list of failing tests: struct-simple.cpp workingset-signal-posix.cpp mmap-shadow-conflict.c Reviewed by bruening Differential: D23799 llvm-svn: 280795
* [SimplifyCFG] Followup fix to r280790James Molloy2016-09-071-1/+3
| | | | | | In failure cases it's not guaranteed that the PHI we're inspecting is actually in the successor block! In this case we need to bail out early, and never query getIncomingValueForBlock() as that will cause an assert. llvm-svn: 280794
* Fix unittest compilation on windowsPavel Labath2016-09-074-4/+4
| | | | | | | | After the reformat, the unittests do not compile due to missing due to redefinition errors between PosixApi.h and ucrt/direct.h. This is a bit of a shot in the dark, as I have not tested it on windows, but I am restoring the original include order, so it should hopefully fix it. llvm-svn: 280793
* [SimplifyCFG] Update workaround for PR30188 to also include loadsJames Molloy2016-09-072-2/+36
| | | | | | | | I should have realised this the first time around, but if we're avoiding sinking stores where the operands come from allocas so they don't create selects, we also have to do the same for loads because SROA will be just as defective looking at loads of selected addresses as stores. Fixes PR30188 (again). llvm-svn: 280792
* [CMake] Use CMake's default RPATH for the unit testsDiana Picus2016-09-071-5/+3
| | | | | | | | | | | | | | | In the top-level CMakeLists.txt, we set CMAKE_BUILD_WITH_INSTALL_RPATH to ON, and then for the unit tests we set it to <test>/../../lib. This works for tests that live in unittest/<whatever>, but not for those that live in subdirectories e.g. unittest/Transforms/IPO or unittest/ExecutionEngine/Orc. When building with BUILD_SHARED_LIBRARIES, such tests don't manage to find their libraries. Since the tests are run from the build directory, it makes sense to set their RPATH for the build tree, rather than the install tree. This is the default in CMake since 2.6, so all we have to do is set CMAKE_BUILD_WITH_INSTALL_RPATH to OFF for the unit tests. llvm-svn: 280791
* [SimplifyCFG] Check PHI uses more accuratelyJames Molloy2016-09-072-1/+28
| | | | | | | | PR30292 showed a case where our PHI checking wasn't correct. We were checking that all values were used by the same PHI before deciding to sink, but we weren't checking that the incoming values for that PHI were what we expected. As a result, we had to bail out after block splitting which caused us to never reach a steady state in SimplifyCFG. Fixes PR30292. llvm-svn: 280790
* [PowerPC] Fix address-offset folding for plain addiHal Finkel2016-09-072-15/+78
| | | | | | | | | | | | | | | | | | | | | | | When folding an addi into a memory access that can take an immediate offset, we were implicitly assuming that the existing offset was zero. This was incorrect. If we're dealing with an addi with a plain constant, we can add it to the existing offset (assuming that doesn't overflow the immediate, etc.), but if we have anything else (i.e. something that will become a relocation expression), we'll go back to requiring the existing immediate offset to be zero (because we don't know what the requirements on that relocation expression might be - e.g. maybe it is paired with some addis in some relevant way). On the other hand, when dealing with a plain addi with a regular constant immediate, the alignment restrictions (from the TOC base pointer, etc.) are irrelevant. I've added the test case from PR30280, which demonstrated the bug, but also demonstrates a missed optimization opportunity (i.e. we don't need the memory accesses at all). Fixes PR30280. llvm-svn: 280789
* Support ABSOLUE keyword in symbol assignmentsEugene Leviant2016-09-073-30/+62
| | | | | | | | | | | | This patch allows making section defined symbols absolute: .foo : { begin_foo = ABSOLUTE(.); *(.foo) } Differential revision: https://reviews.llvm.org/D24135 llvm-svn: 280788
* OpenCL: Defining __ENDIAN_LITTLE__ and fix target endiannessMatt Arsenault2016-09-075-22/+9
| | | | | | | | | OpenCL requires __ENDIAN_LITTLE__ be set for little endian targets. The default for targets was also apparently big endian, so AMDGPU was incorrectly reported as big endian. Set this from the triple so targets don't have another place to set the endianness. llvm-svn: 280787
* Fix whitespace issuesMatt Arsenault2016-09-071-2/+1
| | | | | | ^M and extra space llvm-svn: 280786
* AVX512F: FMA intrinsic + FNEG - sequence optimizationElena Demikhovsky2016-09-072-110/+117
| | | | | | | | | | | The previous commit (r280368 - https://reviews.llvm.org/D23313) does not cover AVX-512F, KNL set. FNEG(x) operation is lowered to (bitcast (vpxor (bitcast x), (bitcast constfp(0x80000000))). It happens because FP XOR is not supported for 512-bit data types on KNL and we use integer XOR instead. I added pattern match for integer XOR. Differential Revision: https://reviews.llvm.org/D24221 llvm-svn: 280785
* AMDGPU: Make some scalar instructions commutableMatt Arsenault2016-09-071-2/+9
| | | | llvm-svn: 280784
OpenPOWER on IntegriCloud