summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Implement General Dynamic style TLSDESC for x86-64Fangrui Song2019-05-296-41/+172
| | | | | | | | | | | This handles two initial relocation types R_X86_64_GOTPC32_TLSDESC and R_X86_64_TLSDESC_CALL, as well as the GD->LE and GD->IE relaxations. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D62513 llvm-svn: 361911
* [X86] Fix x86-64 call *foo@tlsdesc(%rax) and support R_386_TLSGOTDESC ↵Fangrui Song2019-05-296-29/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | R_386_TLS_DESC_CALL D18885 emitted 5 bytes for call *foo@tlsdesc(%rax). It should use the 2-byte form instead and let R_X86_64_TLSDESC_CALL apply to the beginning of the call instruction. The 2-byte form was deliberately chosen to make ->LE and ->IE relaxation work: 0: 48 8d 05 00 00 00 00 lea 0x0(%rip),%rax # 7 <.text+0x7> 3: R_X86_64_GOTPC32_TLSDESC a-0x4 7: ff 10 callq *(%rax) 7: R_X86_64_TLSDESC_CALL a => 0: 48 c7 c0 fc ff ff ff mov $0xfffffffffffffffc,%rax 7: 66 90 xchg %ax,%ax Also change the symbol type to STT_TLS when VK_TLSCALL or VK_TLSDESC is seen. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D62512 llvm-svn: 361910
* [builtins] Move the compare2f definition outside of the macroPetr Hosek2019-05-291-11/+19
| | | | | | | | | This should hopefully address the error we're seeing in older versions of Clang. Differential Revision: https://reviews.llvm.org/D62554 llvm-svn: 361909
* [AArch64] auto-generate complete test checks; NFCSanjay Patel2019-05-291-9/+11
| | | | llvm-svn: 361908
* Revise the google-objc-global-variable-declaration check to match the style ↵Stephane Moore2019-05-292-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | guide. Summary: Revise the google-objc-global-variable-declaration check to match the style guide. This commit updates the check as follows: (1) Do not emit fixes for extern global constants. (2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers). https://google.github.io/styleguide/objcguide.html#prefixes Contributed by yaqiji. Reviewers: Wizard, benhamilton, stephanemoore Reviewed By: benhamilton, stephanemoore Subscribers: mgorny, cfe-commits, yaqiji Tags: #clang Differential Revision: https://reviews.llvm.org/D62045 llvm-svn: 361907
* [AArch64] auto-generate complete test checks; NFCSanjay Patel2019-05-291-9/+29
| | | | llvm-svn: 361906
* Fix failure of lit test dependent-libs.cuYaxun Liu2019-05-291-2/+4
| | | | llvm-svn: 361905
* [WebAssembly] Add signatures for RINT builtinsThomas Lively2019-05-291-0/+6
| | | | | | | | | | | | Reviewers: azakai, dschuff Subscribers: sbc100, jgravelle-google, hiraditya, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62564 llvm-svn: 361904
* [Driver] Search the toolchain dir with -print-file-namePetr Hosek2019-05-292-0/+24
| | | | | | | | | | This is useful when looking for directories or files relative to the toolchain root, e.g. include/c++/v1. This change also adds a test to make sure this functionality doesn't regress in the future. Differential Revision: https://reviews.llvm.org/D62558 llvm-svn: 361903
* [ScopBuilder] Move buildInvariantEquivalenceClasses function from ScopInfo. NFC.Michael Kruse2019-05-284-36/+48
| | | | | | | | | | | | Refactor Scop and ScopBuilder class. Move buildInvariantEquivalenceClasses function from Scop class to ScopBuilder class. Patch by: Dominik Adamski <adamski.dominik@gmail.com> Differential Revision: https://reviews.llvm.org/D62351 llvm-svn: 361902
* [RegUsageInfoCollector] Don't mark as saved registers that don't have ↵Quentin Colombet2019-05-282-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subregister lanes To determine the list of clobbered registers, the RegUsageInfoCollector pass uses the list of callee saved registers provided by the target and then augments it with the list of registers which have all their subregisters saved. It then basically does the difference between all the registers and the saved registers to come up with what is clobbered (plus it checks that the register is defined within that functions). The patch fixes a bug where when register does not have any subregister lane, hence when checking if any of its subregister are not saved, we would find none and think the register is saved as well. That's obviously wrong. The code was actually kind of checking for something like that with the CoveredBySubRegs bit. What this bit says is that a register is completely covered by its subregisters. We required that this bit was set, to check that a register was saved by its subregister lanes, since without this bit, we potentially would miss to check some part of the register. However, this bit is used de facto on registers that don't have any subregisters (e.g., on ARM) and the code was not prepared for that. This patch fixes this by checking that a register has subregisters before declaring it saved when none of its lanes are modified. llvm-svn: 361901
* [ORC] Track JIT symbol states more explicitly.Lang Hames2019-05-284-153/+160
| | | | | | | | | | | | | Prior to this patch, JITDylibs inferred symbol states (whether a symbol was newly added, materializing, resolved, or ready to run) via a combination of (1) bits in the JITSymbolFlags member, and (2) the state of some internal JITDylib data structures. This patch explicitly tracks symbol states by adding a new SymbolState member to the symbol table entries, and removing the 'Lazy' and 'Materializing' bits from JITSymbolFlags. This is a first step towards adding additional states representing initialization phases (e.g. eh-frame registration, registration with the language runtime, and static initialization). llvm-svn: 361899
* Fix IPv6 support on lldb-server platformAntonio Afonso2019-05-286-87/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a general fix for the ConnectionFileDescriptor class but my main motivation was to make lldb-server working with IPv6. The connect URI can use square brackets ([]) to wrap the interface part of the URI (e.g.: <scheme>://[<interface>]:<port>). For IPv6 addresses this is a must since its ip can include colons and it will overlap with the port colon otherwise. The URIParser class parses the square brackets correctly but the ConnectionFileDescriptor doesn't generate them for IPv6 addresses making it impossible to connect to the gdb server when using this protocol. How to reproduce the issue: ``` $ lldb-server p --server --listen [::1]:8080 ... $ lldb (lldb) platform select remote-macosx (lldb) platform connect connect://[::1]:8080 (lldb) platform process -p <pid> error: unable to launch a GDB server on 'computer' ``` The server was actually launched we were just not able to connect to it. With this fix lldb will correctly connect. I fixed this by wrapping the ip portion with []. Reviewers: labath Reviewed By: labath Subscribers: xiaobai, mgorny, jfb, lldb-commits, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D61833 llvm-svn: 361898
* [X86] Fix the Sema checks for getmant builtins to only allow 4 and 8 for ↵Craig Topper2019-05-282-7/+12
| | | | | | | | | rounding immediates. These don't support embedded rounding so we shouldn't be setting HasRC. That way we only allow current direction and suppress all exceptions. llvm-svn: 361897
* [tools] Introduce llvm-lipoAlexander Shaposhnikov2019-05-288-0/+320
| | | | | | | | | | | This diff starts the implementation of llvm-lipo which is supposed to be a drop-in replacement for the well-known tool lipo. Test plan: make check-all Differential revision: https://reviews.llvm.org/D61927 llvm-svn: 361896
* Fix r361893 to also update a recently-added test.Richard Smith2019-05-281-163/+163
| | | | llvm-svn: 361895
* Fix test that used raw string literals. Doesn't work in C++03Marshall Clow2019-05-281-2/+2
| | | | llvm-svn: 361894
* Defer creating fields for captures until we finish building theRichard Smith2019-05-2810-174/+142
| | | | | | | | | | | | | | | capturing expression or statement. No functionality change yet. The intent is that we will also delay building the initialization expression until the enclosing context, so that: a) we build the initialization expression in the right context, and b) we can elide captures that are not odr-used, as suggested by P0588R1. This also consolidates some duplicated code building capture fields into a single place. llvm-svn: 361893
* Simplify clang::Capture. No functionality change intended.Richard Smith2019-05-281-56/+46
| | | | | | | We don't need to pack flags into the bottom bits of pointers here; we have plenty of trailing bits in this type. llvm-svn: 361892
* If capturing a variable fails, add a capture anyway (and mark itRichard Smith2019-05-289-67/+107
| | | | | | invalid) so that we can avoid repeated diagnostics for the same capture. llvm-svn: 361891
* Move code to mark a variable as odr-used adjacement to all the relatedRichard Smith2019-05-284-35/+41
| | | | | | | | code. No functional change intended. llvm-svn: 361890
* Add debuginfo-tests that use cdb on WindowsReid Kleckner2019-05-287-5/+90
| | | | | | | | | | | | | | | | | | | | | | | This is an initial prototype of how we can run debugger integration tests on Windows. cdb and windbg share a command language and debugger engine. Visual Studio has its own, but we should at least be able to use cdb as the basis for optimized debug info integration tests. There's a lot of work to do here still. For example: - Make fewer assumptions about the SDK location - Don't assume x64 (important, I need x86 testing) - More environment isolation, have lit setup vcvars instead of passing LIB and INCLUDE down. - Write a .py file to replace the grep+sed RUN line But, this seemed like a good enough concept to commit as is, since it's useful to me already. Reviewers: aprantl, zturner Differential Revision: https://reviews.llvm.org/D54187 llvm-svn: 361889
* [AArch64][GlobalISel] Select FCMPSri/FCMPDri when comparing against 0.0Jessica Paquette2019-05-282-13/+83
| | | | | | | | | | | Add support for selecting FCMPSri and FCMPDri when comparing against 0.0, and factor out opcode selection for G_FCMP into its own function. Add a test to show that we don't do this with other immediates. Differential Revision: https://reviews.llvm.org/D62539 llvm-svn: 361888
* Fix an incorrect 'Throws' in the regex code. Add a test for the new ↵Marshall Clow2019-05-282-1/+39
| | | | | | behavior. Reviewed as https://reviews.llvm.org/D61828. Thanks to Mark for the catch and the fix. llvm-svn: 361887
* [SymbolFileDWARF] Remove unused member (NFC)Jonas Devlieghere2019-05-282-4/+2
| | | | | | Removes the unused debug line instance. llvm-svn: 361886
* [Driver] Fix -working-directory issuesMichael J. Spencer2019-05-284-28/+29
| | | | | | | | | | | | | | | | Currently the `-working-directory` option does not actually impact the working directory for all of the clang driver, it only impacts how files are looked up to make sure they exist. This means that that clang passes the wrong paths to -fdebug-compilation-dir and -coverage-notes-file. This patch fixes that by changing all the places in the driver where we convert to absolute paths to use the VFS, and then calling setCurrentWorkingDirectory on the VFS. This also changes the default VFS for `Driver` to use a virtualized working directory, instead of changing the process's working directory. Differential Revision: https://reviews.llvm.org/D62271 llvm-svn: 361885
* [WebAssembly] Support for atomic fencesHeejin Ahn2019-05-284-4/+154
| | | | | | | | | | | | | | | | Summary: This adds support for translation of LLVM IR fence instruction. We convert a singlethread fence to a pseudo compiler barrier which becomes 0 instructions in final binary, and a thread fence to an idempotent atomicrmw instruction to a memory address. Reviewers: dschuff, jfb, sunfish, tlively Subscribers: sbc100, jgravelle-google, llvm-commits Differential Revision: https://reviews.llvm.org/D50277 llvm-svn: 361884
* [clangd] Add SourceManager accessor to ParsedAST. NFCSam McCall2019-05-289-26/+27
| | | | llvm-svn: 361883
* [PGO] Handle cases of failing to split critical edgesRong Xu2019-05-282-44/+123
| | | | | | | | | | | Fix PR41279 where critical edges to EHPad are not split. The fix is to not instrument those critical edges. We used to be able to know the size of counters right after MST is computed. With this, we have to pre-collect the instrument BBs to know the size, and then instrument them. Differential Revision: https://reviews.llvm.org/D62439 llvm-svn: 361882
* Revert "[CorrelatedValuePropagation] Fix prof branch_weights metadata ↵Nikita Popov2019-05-282-180/+56
| | | | | | | | | | | | handling for SwitchInst" This reverts commit 53f2f3286572cb879b3861d7c15480e4d830dd3b. As reported on D62126, this causes assertion failures if the switch has incorrect branch_weights metadata, which may happen as a result of other transforms not handling it correctly yet. llvm-svn: 361881
* [CUDA][HIP] Emit dependent libs for host onlyYaxun Liu2019-05-282-1/+12
| | | | | | | | | | | | | Recently D60274 was introduced to allow lld to handle dependent libs. However current usage of dependent libs (e.g. pragma comment(lib, *) in windows header files) are intended for host only. Emitting the metadata in device IR causes link error in device path. Until there is a way to different it dependent libs for device or host, metadata for dependent libs should be emitted for host only. This patch enforces that. Differential Revision: https://reviews.llvm.org/D62483 llvm-svn: 361880
* AMDGPU: Temporary drop s_mul_hi_i/u32 patternsKonstantin Zhuravlyov2019-05-282-11/+2
| | | | | | | | It introduces performance regressions in several applications. This has already been submitted downstream. llvm-svn: 361879
* [clang] Handle lrint/llrint builtinsAdhemerval Zanella2019-05-284-12/+37
| | | | | | | | | | | | As for other floating-point rounding builtins that can be optimized when build with -fno-math-errno, this patch adds support for lrint and llrint. It currently only optimize for AArch64 backend. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D62019 llvm-svn: 361878
* [AArch64] Handle ISD::LRINT and ISD::LLRINTAdhemerval Zanella2019-05-286-8/+89
| | | | | | | | | | | This patch optimizes ISD::LRINT and ISD::LLRINT to frintx plus fcvtzs. It currently only handles the scalar version. Reviewed By: SjoerdMeijer, mstorsjo Differential Revision: https://reviews.llvm.org/D62018 llvm-svn: 361877
* Revert r361842 as it breaks LLDB :: tools/lldb-mi/exec/exec-finish.testAlexandre Ganea2019-05-287-235/+141
| | | | llvm-svn: 361876
* [CodeGen] Add lrint/llrint builtinsAdhemerval Zanella2019-05-2825-3/+847
| | | | | | | | | | | | | | | | | This patch add the ISD::LRINT and ISD::LLRINT along with new intrinsics. The changes are straightforward as for other floating-point rounding functions, with just some adjustments required to handle the return value being an interger. The idea is to optimize lrint/llrint generation for AArch64 in a subsequent patch. Current semantic is just route it to libm symbol. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D62017 llvm-svn: 361875
* [DAGCombine] (x - C) - y -> (x - y) - C fold. Try 2Roman Lebedev2019-05-283-3/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: Again only vectors affected. Frustrating. Let me take a look into that.. https://rise4fun.com/Alive/AAq This is a recommit, originally committed in rL361856, but reverted to investigate test-suite compile-time hangs. Reviewers: RKSimon, craig.topper, spatel Reviewed By: RKSimon Subscribers: javed.absar, JDevlieghere, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62294 llvm-svn: 361874
* [DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1 -> add (xor y, -1), x ↵Roman Lebedev2019-05-284-51/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fold. Try 2 Summary: This prevents regressions in next patch, and somewhat recovers from the regression to AMDGPU test in D62223. It is indeed not great that we leave vector decrement, don't transform it into vector add all-ones.. https://rise4fun.com/Alive/ZRl This is a recommit, originally committed in rL361855, but reverted to investigate test-suite compile-time hangs. Reviewers: RKSimon, craig.topper, spatel, arsenm Reviewed By: RKSimon, arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, javed.absar, dstuttard, tpr, t-tye, kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62263 llvm-svn: 361873
* [DAGCombiner][X86][AArch64][SPARC][SystemZ] y - (x + C) -> (y - x) - C ↵Roman Lebedev2019-05-286-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fold. Try 2 Summary: Direct sibling of D62223 patch. While i don't have a direct motivational pattern for this, it would seem to make sense to handle both patterns (or none), for symmetry? The aarch64 changes look neutral; sparc and systemz look like improvement (one less instruction each); x86 changes - 32bit case improves, 64bit case shows that LEA no longer gets constructed, which may be because that whole test is `-mattr=+slow-lea,+slow-3ops-lea` https://rise4fun.com/Alive/ffh This is a recommit, originally committed in rL361853, but reverted to investigate test-suite compile-time hangs. Reviewers: RKSimon, craig.topper, spatel, t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, jyknight, javed.absar, kristof.beyls, fedor.sergeev, jrtc27, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62252 llvm-svn: 361872
* [DAGCombiner][X86][AArch64][AMDGPU] (x + C) - y -> (x - y) + C fold. Try 2Roman Lebedev2019-05-289-91/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main motivation is shown by all these `neg` instructions that are now created. In particular, the `@reg32_lshr_by_negated_unfolded_sub_b` test. AArch64 test changes all look good (`neg` created), or neutral. X86 changes look neutral (vectors), or good (`neg` / `xor eax, eax` created). I'm not sure about `X86/ragreedy-hoist-spill.ll`, it looks like the spill is now hoisted into preheader (which should still be good?), 2 4-byte reloads become 1 8-byte reload, and are elsewhere, but i'm not sure how that affects that loop. I'm unable to interpret AMDGPU change, looks neutral-ish? This is hopefully a step towards solving [[ https://bugs.llvm.org/show_bug.cgi?id=41952 | PR41952 ]]. https://rise4fun.com/Alive/pkdq (we are missing more patterns, i'll submit them later) This is a recommit, originally committed in rL361852, but reverted to investigate test-suite compile-time hangs. Reviewers: craig.topper, RKSimon, spatel, arsenm Reviewed By: RKSimon Subscribers: bjope, qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, javed.absar, dstuttard, tpr, t-tye, kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62223 llvm-svn: 361871
* Fix GDB pretty printer for Optional after r354246David Blaikie2019-05-281-2/+1
| | | | llvm-svn: 361870
* Change ELF tools to allow multiple sections per file.Peter Collingbourne2019-05-283-30/+85
| | | | | | | | | This is how multi-partition combined output files are going to look. If we see multiple sections, the tools will just read the first one. Differential Revision: https://reviews.llvm.org/D62349 llvm-svn: 361869
* [AMDGPU] Correct the handling of inlineasm output registers.Michael Liao2019-05-282-2/+21
| | | | | | | | | | | | | | | | Summary: - There's a regression due to the cross-block RC assignment. Use the proper way to derive the output register RC in inline asm. Reviewers: rampitec, alex-t Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, eraman, hiraditya, llvm-commits, yaxunl Tags: #llvm Differential Revision: https://reviews.llvm.org/D62537 llvm-svn: 361868
* [OpenMP] Set pragma start loc to `#pragma` locJoel E. Denny2019-05-2853-2674/+2674
| | | | | | | | | | | | | | | This patch adjusts `PragmaOpenMPHandler` to set the location of `tok::annot_pragma_openmp` to the `#pragma` location instead of the `omp` location so that the former becomes the start location of the OpenMP AST node. This can be useful when, for example, rewriting a directive using Clang's Rewrite facility. Most of this patch updates tests for changes to locations in diagnostics and `-ast-dump` output. Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman Differential Revision: https://reviews.llvm.org/D61509 llvm-svn: 361867
* [compiler-rt] Fix cmake warningsShoaib Meenai2019-05-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | - Fix cmake BOOL misspellings - Set cmake policy for CMP0075 to NEW As requested by smeenai I've compared CMAkeCache.txt in master with and without this patch and the only changes are to the variable types I fixed: $ diff build-b1-master/CMakeCache.txt build-b1-compiler-rt-fix-cmake-warnings/CMakeCache.txt 503c503 < COMPILER_RT_BAREMETAL_BUILD:STRING=OFF --- > COMPILER_RT_BAREMETAL_BUILD:BOOL=OFF 550c550 < COMPILER_RT_HWASAN_WITH_INTERCEPTORS:STRING=ON --- > COMPILER_RT_HWASAN_WITH_INTERCEPTORS:BOOL=ON Patch by Wink Saville <wink@saville.com>. Differential Revision: https://reviews.llvm.org/D61203 llvm-svn: 361866
* Revert DAGCombine "hoist binop with const" foldsRoman Lebedev2019-05-2816-231/+196
| | | | | | | | | | Appear to introduce test-suite compile-time hang. http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/22825 This reverts r361852,r361853,r361854,r361855,r361856 llvm-svn: 361865
* [InstCombine] Add tests for signed saturating always overflow; NFCNikita Popov2019-05-281-0/+52
| | | | llvm-svn: 361864
* [InstCombine] Clean up saturing math overflow optimizations; NFCNikita Popov2019-05-281-29/+20
| | | | | | | Reduce duplication and make it easier to handle signed always-overflows conditions in the future. llvm-svn: 361863
* Fix 'warning: suggest explicit braces to avoid ambiguous ‘else’ ↵Alexandre Ganea2019-05-281-10/+20
| | | | | | | [-Wdangling-else]' with GCC 7.3 See: https://github.com/google/googletest/issues/1119 llvm-svn: 361862
* Fix 'warning: format specifies type 'int' but the argument has type 'MIuint' ↵Alexandre Ganea2019-05-281-1/+1
| | | | | | (aka 'unsigned long long') [-Wformat]' with Clang 8.0 llvm-svn: 361861
OpenPOWER on IntegriCloud