summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [AMDGPU] Fix build broken in r292688.Eugene Zelenko2017-01-211-0/+1
| | | | llvm-svn: 292699
* [SLP] Delete useless helper. NFC.Michael Kuperstein2017-01-211-14/+10
| | | | | | | The helper contained a branch for a special case that is unnecessary, and a cast. llvm-svn: 292698
* [libFuzzer] Use CXX to set compiler to useVitaly Buka2017-01-211-1/+2
| | | | | | | | | | Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28976 llvm-svn: 292697
* Add a catch-all line for detecting dyld in the inferior processJason Molenda2017-01-212-0/+5
| | | | | | | shlibs so we don't miss dyld. <rdar://problem/30128580> llvm-svn: 292696
* [libFuzzer] fix gcc buildKostya Serebryany2017-01-211-1/+0
| | | | llvm-svn: 292695
* [NVPTX] Auto-upgrade some NVPTX intrinsics to LLVM target-generic code.Justin Lebar2017-01-215-129/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Specifically, we upgrade llvm.nvvm.: * brev{32,64} * clz.{i,ll} * popc.{i,ll} * abs.{i,ll} * {min,max}.{i,ll,u,ull} * h2f These either map directly to an existing LLVM target-generic intrinsic or map to a simple LLVM target-generic idiom. In all cases, we check that the code we generate is lowered to PTX as we expect. These builtins don't need to be backfilled in clang: They're not accessible to user code from nvcc. Reviewers: tra Subscribers: majnemer, cfe-commits, llvm-commits, jholewinski Differential Revision: https://reviews.llvm.org/D28793 llvm-svn: 292694
* [NVPTX] Move getDivF32Level, usePrecSqrtF32, and useF32FTZ into out of ↵Justin Lebar2017-01-213-46/+75
| | | | | | | | | | | | | | | | | | DAGToDAG and into TargetLowering. Summary: DADToDAG has access to TargetLowering, but not vice versa, so this is the more general location for these functions. NFC Reviewers: tra Subscribers: jholewinski, llvm-commits Differential Revision: https://reviews.llvm.org/D28795 llvm-svn: 292693
* [ConstantFolding] Constant-fold llvm.sqrt(x) like other intrinsics.Justin Lebar2017-01-212-15/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently we return undef, but we're in the process of changing the LangRef so that llvm.sqrt behaves like the other math intrinsics, matching the return value of the standard libcall but not setting errno. This change is legal even without the LangRef change because currently calling llvm.sqrt(x) where x is negative is spec'ed to be UB. But in practice it's also safe because we're simply constant-folding fewer inputs: Inputs >= -0 get constant-folded as before, but inputs < -0 now aren't constant-folded, because ConstantFoldFP aborts if the host math function raises an fp exception. Reviewers: hfinkel, efriedma, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28929 llvm-svn: 292692
* [ValueTracking] Clarify comments on CannotBeOrderedLessThanZero and ↵Justin Lebar2017-01-211-5/+17
| | | | | | | | | | | | SignBitMustBeZero. Reviewers: hfinkel, efriedma, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28926 llvm-svn: 292691
* [NVPTX] Add explicit check for llvm.sqrt.f32 to intrinsics.ll.Justin Lebar2017-01-211-0/+8
| | | | | | Test-only change. llvm-svn: 292690
* Fix recent build errorsEric Fiselier2017-01-213-3/+8
| | | | llvm-svn: 292689
* [AMDGPU] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-01-218-198/+270
| | | | | | other minor fixes (NFC). llvm-svn: 292688
* [APFloat] Add asserts and descriptions. NFC.Tim Shen2017-01-211-1/+6
| | | | llvm-svn: 292687
* [libFuzzer] use print+exit(1) instead of assert to report an errorKostya Serebryany2017-01-212-3/+5
| | | | llvm-svn: 292685
* Implement P0513R0 - "Poisoning the Hash"Eric Fiselier2017-01-2131-653/+1470
| | | | | | | | | | | | | | | | | | | | | Summary: Exactly what the title says. This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it. See http://wg21.link/P0513R0 for more info. If there are no comments in the next couple of days I'll commit this Reviewers: mclow.lists, K-ballo, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28938 llvm-svn: 292684
* [libFuzzer] re-enable LLVMFuzzer-RepeatedMemcmp test, cleanup the test ↵Kostya Serebryany2017-01-212-20/+15
| | | | | | runner nearby llvm-svn: 292683
* [InstCombine] auto-generate checks; NFCSanjay Patel2017-01-202-34/+75
| | | | llvm-svn: 292682
* [libFuzzer] call __sanitizer_dump_coverage via EFKostya Serebryany2017-01-202-1/+4
| | | | llvm-svn: 292681
* [PPC] Give unaligned memory access lower cost on processor that supports itGuozhi Wei2017-01-203-1/+31
| | | | | | | | | | Newer ppc supports unaligned memory access, it reduces the cost of unaligned memory access significantly. This patch handles this case in PPCTTIImpl::getMemoryOpCost. This patch fixes pr31492. Differential Revision: https://reviews.llvm.org/D28630 llvm-svn: 292680
* [ThinLTO] Don't perform computeDeadSymbols during O0 link, as the result is ↵Mehdi Amini2017-01-201-13/+13
| | | | | | never used (NFC) llvm-svn: 292679
* [NewGVN] Optimize processing for instructions found trivially dead.Davide Italiano2017-01-201-3/+19
| | | | | | | | | | | Don't call `isTriviallyDeadInstructions()` once we discover that an instruction is dead. Instead, set DFS number zero (as suggested by Danny) and forget about it (this also speeds up things as we won't try to reprocess that block). Differential Revision: https://reviews.llvm.org/D28930 llvm-svn: 292676
* GlobalISel: prevent heap use-after-free when looking up VReg.Tim Northover2017-01-201-1/+3
| | | | | | | | Translating the constant can create more VRegs, which can invalidate the reference into the DenseMap. So we have to look up the value again after all that's happened. llvm-svn: 292675
* LowerTypeTests: Simplify; always create SizeM1 with type IntPtrTy, move ↵Peter Collingbourne2017-01-204-13/+8
| | | | | | initialization out of if statement. llvm-svn: 292674
* Fix failing lld pdb test.Zachary Turner2017-01-201-9/+11
| | | | llvm-svn: 292673
* Add indirect call promotion to SamplePGODehao Chen2017-01-204-7/+82
| | | | | | | | | | | | | | Summary: This patch adds metadata for indirect call promotion in the sample profile loader. Reviewers: xur, davidxl, dnovillo Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28923 llvm-svn: 292672
* [Basic] Remove the 32-bit x86 and ARM targets for FuchsiaPetr Hosek2017-01-201-6/+0
| | | | | | | | The 32-bit architectures are no longer supported by Fuchsia. Differential Revision: https://reviews.llvm.org/D28974 llvm-svn: 292671
* [libFuzzer] Don't use `#ifdef` for defined macros, instead use `#if`.Marcos Pividori2017-01-201-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D28972 llvm-svn: 292670
* [libFuzzer] Use clang as linker on Windows, to properly include sanitizer ↵Marcos Pividori2017-01-201-0/+15
| | | | | | | | | | | | | | | | | | | libraries. In order to use sanitizers on Windows, we need to link against many runtime libraries which will depend on the target being created (executable or dll) and the c runtime library used (MT/MD). By default, cmake uses link.exe for linking, which fails because we don't specify the appropiate dependencies. As we don't want to consider all of that possible situations which depends on the implementation of the compiler-rt, the simplest option is to change the rules for linking executables and shared libraries, using the compiler instead of link.exe. Clang driver will consider the sanitizer flags, and automatically provide the required libraries to the linker. Differential Revision: https://reviews.llvm.org/D27869 llvm-svn: 292669
* [libFuzzer] Properly use compiler options supported on Windows.Marcos Pividori2017-01-201-1/+1
| | | | | | | | Replace "-g" by "-gline-tables-only". "-g" is not supported by clang-cl. Differential Revision: https://reviews.llvm.org/D27868 llvm-svn: 292668
* [ThinLTO] The "codegen only" path didn't honor the recently added file-based APIMehdi Amini2017-01-201-15/+19
| | | | llvm-svn: 292667
* Improve PGO support for the new inlinerEaswaran Raman2017-01-2013-31/+408
| | | | | | | | | | | | | | | | | | | | | | | | This adds the following to the new PM based inliner in PGO mode: * Use block frequency analysis to derive callsite's profile count and use that to adjust thresholds of hot and cold callsites. * Incrementally update the BFI of the caller after a callee gets inlined into it. This incremental update is only within an invocation of the run method - BFI is not preserved across calls to run. Update the function entry count of the callee after inlining it into a caller. * I've tuned the thresholds for the hot and cold callsites using a hacked up version of the old inliner that explicitly computes BFI on a set of internal benchmarks and spec. Once the new PM based pipeline stabilizes (IIRC Chandler mentioned there are known issues) I'll benchmark this again and adjust the thresholds if required. Inliner PGO support. Differential revision: https://reviews.llvm.org/D28331 llvm-svn: 292666
* [pdb] Write the Named Stream mapping to Yaml and binary.Zachary Turner2017-01-2022-44/+175
| | | | | | Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
* [pdb] Merge NamedStreamMapBuilder and NamedStreamMap.Zachary Turner2017-01-2011-123/+88
| | | | | | | | | | | While the builder pattern has proven useful for certain other larger types, in this case it was hampering the ability to use the data structure, as for runtime access we need a map that we can efficiently read from and write to. So the two are merged into a single data structure that can efficiently be read to, written from, deserialized from bytes, and serialized to bytes. llvm-svn: 292664
* [PDB] Rename some files to be more intuitive.Zachary Turner2017-01-2019-89/+88
| | | | llvm-svn: 292663
* IRGen: Start using the WriteThinLTOBitcode pass.Peter Collingbourne2017-01-203-3/+17
| | | | | | | | This is the final change necessary to support CFI with ThinLTO. Differential Revision: https://reviews.llvm.org/D28843 llvm-svn: 292662
* IPO, LTO: Plumb the summary from the LTO API into the pass manager.Peter Collingbourne2017-01-206-11/+47
| | | | | | Differential Revision: https://reviews.llvm.org/D28840 llvm-svn: 292661
* [ValueTracking] recognize variations of 'clamp' to improve codegen (PR31693)Sanjay Patel2017-01-203-27/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By enhancing value tracking, we allow an existing min/max canonicalization to kick in and improve codegen for several targets that have min/max instructions. Unfortunately, recognizing min/max in value tracking may cause us to hit a hack in InstCombiner::visitICmpInst() more often: http://lists.llvm.org/pipermail/llvm-dev/2017-January/109340.html ...but I'm hoping we can remove that soon. Correctness proofs based on Alive: Name: smaxmin Pre: C1 < C2 %cmp2 = icmp slt i8 %x, C2 %min = select i1 %cmp2, i8 %x, i8 C2 %cmp3 = icmp slt i8 %x, C1 %r = select i1 %cmp3, i8 C1, i8 %min => %cmp2 = icmp slt i8 %x, C2 %min = select i1 %cmp2, i8 %x, i8 C2 %cmp1 = icmp sgt i8 %min, C1 %r = select i1 %cmp1, i8 %min, i8 C1 Name: sminmax Pre: C1 > C2 %cmp2 = icmp sgt i8 %x, C2 %max = select i1 %cmp2, i8 %x, i8 C2 %cmp3 = icmp sgt i8 %x, C1 %r = select i1 %cmp3, i8 C1, i8 %max => %cmp2 = icmp sgt i8 %x, C2 %max = select i1 %cmp2, i8 %x, i8 C2 %cmp1 = icmp slt i8 %max, C1 %r = select i1 %cmp1, i8 %max, i8 C1 ---------------------------------------- Optimization: smaxmin Done: 1 Optimization is correct! ---------------------------------------- Optimization: sminmax Done: 1 Optimization is correct! Name: umaxmin Pre: C1 u< C2 %cmp2 = icmp ult i8 %x, C2 %min = select i1 %cmp2, i8 %x, i8 C2 %cmp3 = icmp ult i8 %x, C1 %r = select i1 %cmp3, i8 C1, i8 %min => %cmp2 = icmp ult i8 %x, C2 %min = select i1 %cmp2, i8 %x, i8 C2 %cmp1 = icmp ugt i8 %min, C1 %r = select i1 %cmp1, i8 %min, i8 C1 Name: uminmax Pre: C1 u> C2 %cmp2 = icmp ugt i8 %x, C2 %max = select i1 %cmp2, i8 %x, i8 C2 %cmp3 = icmp ugt i8 %x, C1 %r = select i1 %cmp3, i8 C1, i8 %max => %cmp2 = icmp ugt i8 %x, C2 %max = select i1 %cmp2, i8 %x, i8 C2 %cmp1 = icmp ult i8 %max, C1 %r = select i1 %cmp1, i8 %max, i8 C1 ---------------------------------------- Optimization: umaxmin Done: 1 Optimization is correct! ---------------------------------------- Optimization: uminmax Done: 1 Optimization is correct! llvm-svn: 292660
* [Altivec] Change vec_sl to a << (b % (sizeof(a) * 8))Tim Shen2017-01-202-31/+49
| | | | | | | | | | | | | | | | | For a << b (as original vec_sl does), if b >= sizeof(a) * 8, the behavior is undefined. However, Power instructions do define the behavior, which is equivalent to a << (b % (sizeof(a) * 8)). This patch changes altivec.h to use a << (b % (sizeof(a) * 8)), to ensure the consistent semantic of the instructions. Then it combines the generated multiple instructions back to a single shift. This patch handles left shift only. Right shift, on the other hand, is more complicated, considering arithematic/logical right shift. Differential Revision: https://reviews.llvm.org/D28037 llvm-svn: 292659
* docs: Document that !absolute_symbol { all-ones, all-ones } means the full set.Peter Collingbourne2017-01-201-2/+5
| | | | llvm-svn: 292657
* [ThinLTO] Drop non-prevailing non-ODR weak to declarationsTeresa Johnson2017-01-207-23/+119
| | | | | | | | | | | | | | | Summary: Allow non-ODR weak/linkonce non-prevailing copies to be marked as available_externally in the index. Add support for dropping these to declarations in the backend. Reviewers: mehdi_amini, pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28806 llvm-svn: 292656
* [InstCombine] add tests to show missed canonicalization of min/max; NFCSanjay Patel2017-01-201-0/+71
| | | | | | | | | | | Unfortunately, recognizing these in value tracking may cause us to hit a hack in InstCombiner::visitICmpInst() more often: http://lists.llvm.org/pipermail/llvm-dev/2017-January/109340.html ...but besides being the obviously Right Thing To Do, there's a clear codegen win from identifying these patterns for several targets. llvm-svn: 292655
* LowerTypeTests: Implement importing of type identifiers.Peter Collingbourne2017-01-203-2/+285
| | | | | | | | | To import a type identifier we read the summary and create external references to the symbols defined when exporting. Differential Revision: https://reviews.llvm.org/D28546 llvm-svn: 292654
* [globalisel] Fix an unused variable warning when NDEBUG is defined.Daniel Sanders2017-01-201-1/+1
| | | | llvm-svn: 292653
* [libFuzzer] add an assert to protect against LLVMFuzzerInitialize changing ↵Kostya Serebryany2017-01-204-0/+22
| | | | | | argv[0] llvm-svn: 292652
* AMDGPU/R600: Serialize vector trunc stores to private ASJan Vesely2017-01-206-18/+59
| | | | | | | | | | | Add DUMMY_CHAIN SDNode to denote stores of interest Bugzilla: https://llvm.org/bugs/show_bug.cgi?id=28915 Bugzilla: https://llvm.org/bugs/show_bug.cgi?id=30411 Differential Revision: https://reviews.llvm.org/D27964 llvm-svn: 292651
* [sanitizer] [asan] Use macros to simplify weak aliases on Windows.Marcos Pividori2017-01-207-70/+77
| | | | | | | | | This patch adds some useful macros for dealing with pragma directives on Windows. Also, I add appropriate documentation for future users. Differential Revision: https://reviews.llvm.org/D28525 llvm-svn: 292650
* NewGVN: Remove pr31686.ll, it is tested by pr31594.ll, which is much smaller ↵Daniel Berlin2017-01-201-2016/+0
| | | | | | and simpler llvm-svn: 292649
* NewGVN: Fix PR 31686 and PR 31698 by rewriting store leader handling.Daniel Berlin2017-01-206-39/+2098
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This rewrites store expression/leader handling. We no longer use the value operand as the leader, instead, we store it separately. We also now store the stored value as part of the expression, and compare it when comparing stores for equality. This enables us to get rid of a bunch of our previous hacks and machinations, as the existing machinery takes care of everything *except* updating the stored value on classes. The only time we have to update it is if the storecount goes to 0, and when we do, we destroy it. Since we no longer use the value operand as the leader, during elimination, we have to use the value operand. Doing this also fixes a bunch of store forwarding cases we were missing. Any value operand we use is guaranteed to either be updated by previous eliminations, or minimized by future ones. (IE the fact that we don't use the most dominating value operand when it's not a constant does not affect anything). Sadly, this change also exposes that we didn't pay attention to the output of the pr31594.ll test, as it also very clearly exposes the same store leader bug we are fixing here. (I added pr31682.ll anyway, but maybe we think that's too large to be useful) On the plus side, propagate-ir-flags.ll now passes due to the corrected store forwarding. This change was 3 stage'd on darwin and linux, with the full test-suite. Reviewers: davide Subscribers: llvm-commits llvm-svn: 292648
* LowerTypeTests: Compute SizeM1BitWidth in exportTypeId. NFCI.Peter Collingbourne2017-01-201-7/+6
| | | | | | This avoids needing to store it in a separate field in TypeIdLowering. llvm-svn: 292647
* [libFuzzer] experimental support for 'equivalance fuzzing'Kostya Serebryany2017-01-2010-7/+243
| | | | llvm-svn: 292646
OpenPOWER on IntegriCloud