summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [COFF] Add exported functions to gfids table for /guard:cfReid Kleckner2018-11-272-12/+69
| | | | | | | | | | | | | | | | | | | | | | | Summary: MSVC does this, and we should to. The .gfids table is a table of RVAs, so it's impossible for a DLL to indicate that an imported symbol is address taken. Therefore, exports appear to be listed as address taken by the DLL that exports them. This fixes an issue that Firefox ran into here: https://bugzilla.mozilla.org/show_bug.cgi?id=1485016#c12 In Firefox, the export directive came from a .def file, but we need to do this for any kind of export. Reviewers: dmajor, hans, amccarth, alex Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54723 llvm-svn: 347623
* Fix filtering of sanitizer_common unittest architectures on Darwin.Kuba Mracek2018-11-271-1/+1
| | | | llvm-svn: 347622
* [WebAssembly] Remove `using` statements from header files. NFC.Sam Clegg2018-11-2710-45/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D54758 llvm-svn: 347621
* [Common] Threads: use function_ref instead of std::functionFangrui Song2018-11-271-1/+1
| | | | | | | | | | | | | | | | | The benefits are: a) Performance (very minor): it removes a heap allocation of the std::function constructor (template<class F> function(F f)) b) Clarity: it suggests that the callable's lifetime should end after the callee returns. Such callback is widely used in llvm. lld also uses it a lot. Reviewers: ruiu, rnk, pcc Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54813 llvm-svn: 347620
* Revert "[CMake] Streamline code signing for debugserver and pass ↵Davide Italiano2018-11-276-122/+74
| | | | | | | | entitlements to extended llvm_codesign" It breaks the lldb cmake bots. llvm-svn: 347619
* [InstCombine] add tests for rotate/bswap equality; NFCSanjay Patel2018-11-271-0/+23
| | | | llvm-svn: 347618
* [clang][slh] add attribute for speculative load hardeningZola Bridges2018-11-279-14/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The prior diff had to be reverted because there were two tests that failed. I updated the two tests in this diff clang/test/Misc/pragma-attribute-supported-attributes-list.test clang/test/SemaCXX/attr-speculative-load-hardening.cpp ----- Summary from Previous Diff (Still Accurate) ----- LLVM IR already has an attribute for speculative_load_hardening. Before this commit, when a user passed the -mspeculative-load-hardening flag to Clang, every function would have this attribute added to it. This Clang attribute will allow users to opt into SLH on a function by function basis. This can be applied to functions and Objective C methods. Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54915 llvm-svn: 347617
* Fix debug build breakJF Bastien2018-11-261-2/+3
| | | | | | Comment out an assertion from D54543 which failed with error: no member named 'Range' in '(anonymous namespace)::PassAsArgInfo'. llvm-svn: 347616
* [FileSystem] Ignore nanoseconds when comparing oso_mod_timeJonas Devlieghere2018-11-263-7/+19
| | | | | | | | | | | After a recent change in LLVM the TimePoint encoding become more precise, exceeding the precision of the TimePoint obtained from the DebugMap. This patch adds a flag to the GetModificationTime helper in the FileSystem to return the modification time with less precision. Thanks to Davide for bisecting this failure on the LLDB bots. llvm-svn: 347615
* Notify the linker when a TU compiled with split-stack has a function without ↵Sterling Augustine2018-11-263-4/+46
| | | | | | | | a prologue. More context here: https://go-review.googlesource.com/c/go/+/148819/ llvm-svn: 347614
* Remove trailing empty lineVitaly Buka2018-11-261-1/+0
| | | | llvm-svn: 347613
* [stack-safety] Analysis documentationVitaly Buka2018-11-263-0/+71
| | | | | | | | | | | | | | | | Summary: Basic documentation of the Stack Safety Analysis. It will be improved during review and upstream of an implementation. Reviewers: kcc, eugenis, vlad.tsyrklevich, glider Reviewed By: vlad.tsyrklevich Subscribers: arphaman, llvm-commits Differential Revision: https://reviews.llvm.org/D53336 llvm-svn: 347612
* [stack-safety] Inter-Procedural Analysis implementationVitaly Buka2018-11-268-11/+993
| | | | | | | | | | | | | | | | Summary: IPA is implemented as module pass which produce map from Function or Alias to StackSafetyInfo for a single function. From prototype by Evgenii Stepanov and Vlad Tsyrklevich. Reviewers: eugenis, vlad.tsyrklevich, pcc, glider Subscribers: hiraditya, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D54543 llvm-svn: 347611
* [stack-safety] Empty local passes for Stack Safety Global AnalysisVitaly Buka2018-11-266-0/+95
| | | | | | | | | | Reviewers: eugenis, vlad.tsyrklevich Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D54541 llvm-svn: 347610
* AArch64ISelLowering: Remove a return-of-assignment to allow NRVODavid Blaikie2018-11-261-1/+1
| | | | | | Patch by Arthur O'Dwyer! llvm-svn: 347609
* Remove duplicate _LIBCPP_INLINE_VISIBILITY attributes.Eric Fiselier2018-11-261-60/+60
| | | | | | | This attribute should appear only on the first declaration. This patch cleans up <string> by removing the attribute on redeclarations. llvm-svn: 347608
* Add new passes to X86 pipeline testsMircea Trofin2018-11-264-0/+10
| | | | | | | | | | | | | | Summary: Fixes test failures introduced by rL347596. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54916 llvm-svn: 347607
* [X86] Add dependency from X86 to ProfileData after rL347596Fangrui Song2018-11-261-1/+1
| | | | llvm-svn: 347606
* [ICP] Remove incompatible attributes at indirect-call promoted callsites.Xin Tong2018-11-262-2/+59
| | | | | | | | | | | | | | Summary: Removing ncompatible attributes at indirect-call promoted callsites, not removing it results in at least a IR verification error. Reviewers: davidxl, xur, mssimpso Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54913 llvm-svn: 347605
* [InstCombine] add helper function to reduce code duplication; NFCSanjay Patel2018-11-261-24/+19
| | | | llvm-svn: 347604
* [stack-safety] Local analysis implementationVitaly Buka2018-11-264-8/+929
| | | | | | | | | | | | | | | | Summary: Analysis produces StackSafetyInfo which contains information with how allocas and parameters were used in functions. From prototype by Evgenii Stepanov and Vlad Tsyrklevich. Reviewers: eugenis, vlad.tsyrklevich, pcc, glider Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D54504 llvm-svn: 347603
* [stack-safety] Empty local passes for Stack Safety Local AnalysisVitaly Buka2018-11-268-1/+144
| | | | | | | | | | Reviewers: eugenis, vlad.tsyrklevich Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D54502 llvm-svn: 347602
* [cfi] Help sanstats to find binary if they are not at the original locationVitaly Buka2018-11-262-1/+17
| | | | | | | | | | | | | | | | | Summary: By default sanstats search binaries at the same location where they were when stats was collected. Sometime you can not print report immediately or you need to move post-processing to another workstation. To support this use-case when original binary is missing sanstats will fall-back to directory with sanstats file. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53857 llvm-svn: 347601
* [cfi] Make sanstats print address of the checkVitaly Buka2018-11-262-14/+15
| | | | | | | | | | | | Summary: Help with off-line symbolization or other type debugging. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53606 llvm-svn: 347600
* [AArch64] Refactor the scheduling predicates (3/3) (NFC)Evandro Menezes2018-11-264-52/+31
| | | | | | | | | Refactor the scheduling predicates based on `MCInstPredicate`. In this case, `AArch64InstrInfo::hasExtendedReg()`. Differential revision: https://reviews.llvm.org/D54822 llvm-svn: 347599
* [AArch64] Refactor the scheduling predicates (2/3) (NFC)Evandro Menezes2018-11-265-80/+60
| | | | | | | | | Refactor the scheduling predicates based on `MCInstPredicate`. In this case, `AArch64InstrInfo::hasShiftedReg()`. Differential revision: https://reviews.llvm.org/D54820 llvm-svn: 347598
* [AArch64] Refactor the scheduling predicates (1/3) (NFC)Evandro Menezes2018-11-269-81/+90
| | | | | | | | | Refactor the scheduling predicates based on `MCInstPredicate`. In this case, `AArch64InstrInfo::isScaledAddr()` Differential revision: https://reviews.llvm.org/D54777 llvm-svn: 347597
* Support for inserting profile-directed cache prefetchesMircea Trofin2018-11-2613-0/+662
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Support for profile-driven cache prefetching (X86) This change is part of a larger system, consisting of a cache prefetches recommender, create_llvm_prof (https://github.com/google/autofdo), and LLVM. A proof of concept recommender is DynamoRIO's cache miss analyzer. It processes memory access traces obtained from a running binary and identifies patterns in cache misses. Based on them, it produces a csv file with recommendations. The expectation is that, by leveraging such recommendations, we can reduce the amount of clock cycles spent waiting for data from memory. A microbenchmark based on the DynamoRIO analyzer is available as a proof of concept: https://goo.gl/6TM2Xp. The recommender makes prefetch recommendations in terms of: * the binary offset of an instruction with a memory operand; * a delta; * and a type (nta, t0, t1, t2) meaning: a prefetch of that type should be inserted right before the instrution at that binary offset, and the prefetch should be for an address delta away from the memory address the instruction will access. For example: 0x400ab2,64,nta and assuming the instruction at 0x400ab2 is: movzbl (%rbx,%rdx,1),%edx means that the recommender determined it would be beneficial for a prefetchnta instruction to be inserted right before this instruction, as such: prefetchnta 0x40(%rbx,%rdx,1) movzbl (%rbx, %rdx, 1), %edx The workflow for prefetch cache instrumentation is as follows (the proof of concept script details these steps as well): 1. build binary, making sure -gmlt -fdebug-info-for-profiling is passed. The latter option will enable the X86DiscriminateMemOps pass, which ensures instructions with memory operands are uniquely identifiable (this causes ~2% size increase in total binary size due to the additional debug information). 2. collect memory traces, run analysis to obtain recommendations (see above-referenced DynamoRIO demo as a proof of concept). 3. use create_llvm_prof to convert recommendations to reference insertion locations in terms of debug info locations. 4. rebuild binary, using the exact same set of arguments used initially, to which -mllvm -prefetch-hints-file=<file> needs to be added, using the afdo file obtained at step 3. Note that if sample profiling feedback-driven optimization is also desired, that happens before step 1 above. In this case, the sample profile afdo file that was used to produce the binary at step 1 must also be included in step 4. The data needed by the compiler in order to identify prefetch insertion points is very similar to what is needed for sample profiles. For this reason, and given that the overall approach (memory tracing-based cache recommendation mechanisms) is under active development, we use the afdo format as a syntax for capturing this information. We avoid confusing semantics with sample profile afdo data by feeding the two types of information to the compiler through separate files and compiler flags. Should the approach prove successful, we can investigate improvements to this encoding mechanism. Reviewers: davidxl, wmi, craig.topper Reviewed By: davidxl, wmi, craig.topper Subscribers: davide, danielcdh, mgorny, aprantl, eraman, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D54052 llvm-svn: 347596
* AMDGPU: Record SGPR spills when restoring tooMatt Arsenault2018-11-261-1/+3
| | | | | | | | | | | | It's possible in some cases to have a restore present without a corresponding spill. Due to an apparent bug in D54366 <https://reviews.llvm.org/D54366>, only the restore for a register was emitted. It's probably always a bug for this to happen, but due to how SGPR spilling is implemented, this makes the issues appear worse than it is. llvm-svn: 347595
* ELF: ICF: Include contents of referenced sections in initial partitioning ↵Peter Collingbourne2018-11-261-2/+27
| | | | | | | | | | | | | | hash. NFCI. On my machine this reduced median link time of lld-speed-test/chrome from 2.68s to 2.41s. It also reduces link time of Chrome for Android with a prototype compiler change that causes the compiler to create large numbers of identical (modulo relocations) sections from >15 minutes to a few seconds. Differential Revision: https://reviews.llvm.org/D54773 llvm-svn: 347594
* [LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use ↵Craig Topper2018-11-2610-516/+256
| | | | | | | | | | | | SplitVecOp_TruncateHelper for FP_TO_SINT/UINT. SplitVecOp_TruncateHelper tries to promote the result type while splitting FP_TO_SINT/UINT. It then concatenates the result and introduces a truncate to the original result type. But it does this without inserting the AssertZExt/AssertSExt that the regular result type promotion would insert. Nor does it turn FP_TO_UINT into FP_TO_SINT the way normal result type promotion for these operations does. This is bad on X86 which doesn't support FP_TO_SINT until AVX512. This patch disables the use of SplitVecOp_TruncateHelper for these operations and just lets normal promotion handle it. I've tweaked a couple things in X86ISelLowering to avoid a few obvious regressions there. I believe all the changes on X86 are improvements. The other targets look neutral. Differential Revision: https://reviews.llvm.org/D54906 llvm-svn: 347593
* [ThinLTO] Consolidate cache key computation between new/old LTO APIsTeresa Johnson2018-11-264-92/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The old legacy LTO API had a separate cache key computation, which was a subset of the cache key computation in the new LTO API (from what I can tell this is largely just because certain features such as CFI, dsoLocal, etc are only utilized via the new LTO API). However, having separate computations is unnecessary (much of the code is duplicated), and can lead to bugs when adding new optimizations if both cache computation algorithms aren't updated properly - it's much easier to maintain if we have a single facility. This patch refactors the old LTO API code to use the cache key computation from the new LTO API. To do this, we set up an lto::Config object and fill in the fields that the old LTO was hashing (the others will just use the defaults). There are two notable changes: - I added a Freestanding flag to the LTO Config. Currently this is only used by the legacy LTO API. In the patch that added it (D30791) I had asked about adding it to the new LTO API, but it looks like that was not addressed. This should probably be discussed as a follow up to this change, as it is orthogonal. - The legacy LTO API had some code that was hashing the GUID of all preserved symbols defined in the module. I looked back at the history of this (which was added with the original hashing in the legacy LTO API in D18494), and there is a comment in the review thread that it was added in preparation for future internalization. We now do the internalization of course, and that is handled in the new LTO API cache key computation by hashing the recorded linkage type of all defined globals. Therefore I didn't try to move over and keep the preserved symbols handling. Reviewers: steven_wu, pcc Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, dang, llvm-commits Differential Revision: https://reviews.llvm.org/D54635 llvm-svn: 347592
* [SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking ↵Craig Topper2018-11-262-6/+5
| | | | | | | | | | through an add/or We might find a target specific node that needs to be unwrapped after we look through an add/or. Otherwise we get inconsistent results if one pointer is just X86WrapperRIP and the other is (add X86WrapperRIP, C) Differential Revision: https://reviews.llvm.org/D54818 llvm-svn: 347591
* [X86] Add test case for D54818Craig Topper2018-11-261-0/+26
| | | | llvm-svn: 347590
* Add basic_string::__resize_default_init (from P1072)Eric Fiselier2018-11-263-12/+116
| | | | | | | | | | | This patch adds an implementation of __resize_default_init as described in P1072R2. Additionally, it uses it in filesystem to demonstrate its intended utility. Once P1072 lands, or if it changes it's interface, I will adjust the internal libc++ implementation to match. llvm-svn: 347589
* Revert "[clang][slh] add attribute for speculative load hardening"Zola Bridges2018-11-268-107/+13
| | | | | | This reverts commit 801eaf91221ba6dd6996b29ff82659ad6359e885. llvm-svn: 347588
* [COFF] ICF: use parallelForEach{,N}Fangrui Song2018-11-261-4/+5
| | | | | | | | | | | | | | Summary: They have an additional `ThreadsEnabled` check, which does not matter much. Reviewers: pcc, ruiu, rnk Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54812 llvm-svn: 347587
* [clang][slh] add attribute for speculative load hardeningZola Bridges2018-11-268-13/+107
| | | | | | | | | | | | | | | | | | Summary: LLVM IR already has an attribute for speculative_load_hardening. Before this commit, when a user passed the -mspeculative-load-hardening flag to Clang, every function would have this attribute added to it. This Clang attribute will allow users to opt into SLH on a function by function basis. This can be applied to functions and Objective C methods. Reviewers: chandlerc, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54555 llvm-svn: 347586
* [libcxx] Fix XFAILs for aligned allocation testsLouis Dionne2018-11-268-132/+152
| | | | | | | | | | In r339743, I marked several aligned allocation tests as downright unsupported on macosx in an attempt to unbreak the build. It turns out that marking them as unuspported whenever we're on OS X is way too coarse grained. This commit marks the tests as XFAIL with more granularity. llvm-svn: 347585
* [CodeGen] Support custom format of stack mapsThan McIntosh2018-11-267-11/+38
| | | | | | | | | | | | | | | | | | | | | | | Summary: Add a hook to the GCMetadataPrinter for emitting stack maps in custom format. The hook will be called at stack map generation time. The default stack map format is used if there is no hook. For this to be useful a few data structures and accessors are exposed from the StackMaps class, so the custom printer can access the stack map data. This patch authored by Cherry Zhang <cherryyz@google.com>. Reviewers: thanm, apilipenko, reames Reviewed By: reames Subscribers: reames, apilipenko, nemanjai, javed.absar, kbarton, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D53892 llvm-svn: 347584
* [OPENMP][NVPTX]Emit default locations with the correct Exec|RuntimeAlexey Bataev2018-11-265-44/+220
| | | | | | | | | | | modes. If the region is inside target|teams|distribute region, we can emit the locations with the correct info for execution mode and runtime mode. Patch adds this ability to the NVPTX codegen to help the optimizer to produce better code. llvm-svn: 347583
* [clang][slh] Forward mSLH only to Clang CC1Zola Bridges2018-11-262-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: -mno-speculative-load-hardening isn't a cc1 option, therefore, before this change: clang -mno-speculative-load-hardening hello.cpp would have the following error: error: unknown argument: '-mno-speculative-load-hardening' This change will only ever forward -mspeculative-load-hardening which is a CC1 option based on which flag was passed to clang. Also added a test that uses this option that fails if an error like the above is ever thrown. Thank you ericwf for help debugging and fixing this error. Reviewers: chandlerc, EricWF Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54763 llvm-svn: 347582
* Delete dead code introduced in r347354.Erich Keane2018-11-261-4/+0
| | | | | | | | | ParentTy is never used other than an assignment, and since it is a pointer, there is no side effect. Some versions of GCC notice and warn on this. Change-Id: I37dc1a18c7b58040419afb803621de13d8904a8f llvm-svn: 347581
* [libcxx] Fix XFAIL for aligned deallocation test with trunk ClangLouis Dionne2018-11-261-6/+15
| | | | | | | | | | | The test was marked as failing whenever the deployment target was 10.12 or older, but in reality the test passes when the deployment target is 10.12 on recent Clangs. This happens because only older clangs do not honor the -faligned-allocation flag, which disables any availability error related to aligned allocation support, regardless of the deployment target. llvm-svn: 347580
* [lit] Fully qualify lit_config to avoid runtime crashes.Davide Italiano2018-11-261-1/+1
| | | | llvm-svn: 347579
* [Cmake] Add missing dependency to `count`.Davide Italiano2018-11-261-0/+1
| | | | llvm-svn: 347578
* [NFC] Replace magic numbers with CodeGenOpt enumsSam Parker2018-11-261-6/+6
| | | | | | | Use enum values from llvm/Support/CodeGen.h for the optimisation levels in CompilerInvocation. llvm-svn: 347577
* AMDGPU: Cleanup / relax tests for future changesMatt Arsenault2018-11-264-48/+32
| | | | llvm-svn: 347576
* [ASTImporter] Set MustBuildLookupTable on PrimaryContextGabor Marton2018-11-261-1/+1
| | | | | | | | | | | | Summary: SetMustBuildLookupTable() must always be called on a primary context. Reviewers: labath, shafik, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411 Differential Revision: https://reviews.llvm.org/D54863 llvm-svn: 347575
* [clangd] Do not drop diagnostics from macrosIlya Biryukov2018-11-262-2/+25
| | | | | | if they still end up being in the main file. llvm-svn: 347574
OpenPOWER on IntegriCloud