summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add OpenCL 2.0 atomic builtin functions as Clang builtinYaxun Liu2017-08-0421-81/+804
| | | | | | | | | | | | | | | | | | | | | OpenCL 2.0 atomic builtin functions have a scope argument which is ideally represented as synchronization scope argument in LLVM atomic instructions. Clang supports translating Clang atomic builtin functions to LLVM atomic instructions. However it currently does not support synchronization scope of LLVM atomic instructions. Without this, users have to use LLVM assembly code to implement OpenCL atomic builtin functions. This patch adds OpenCL 2.0 atomic builtin functions as Clang builtin functions, which supports generating LLVM atomic instructions with synchronization scope operand. Currently only constant memory scope argument is supported. Support of non-constant memory scope argument will be added later. Differential Revision: https://reviews.llvm.org/D28691 llvm-svn: 310082
* Remove redundant flag.Rafael Espindola2017-08-043-11/+6
| | | | llvm-svn: 310079
* [Support] Remove getPathFromOpenFD, it was unusedReid Kleckner2017-08-044-179/+0
| | | | | | | | | | | | | | Summary: It was added to support clang warnings about includes with case mismatches, but it ended up not being necessary. Reviewers: twoh, rafael Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D36328 llvm-svn: 310078
* Fixing buildbots: do not register check-fuzzer if clang or asan are notGeorge Karpenkov2017-08-041-12/+15
| | | | | | present. llvm-svn: 310077
* Drop Windows support from libFuzzer tests.George Karpenkov2017-08-049-55/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D36205 llvm-svn: 310076
* Port libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.George Karpenkov2017-08-0473-445/+347
| | | | | | | | | | | | | | | | | | | | | This revision ports all libFuzzer tests apart from the unittest to LIT. The advantages of doing so include: - Tests being self-contained - Much easier debugging of a single test - No need for using a two-stage compilation The unit-test is still compiled using CMake, but it does not need a freshly built compiler. NOTE: The previous two-stage bot configuration will NOT work, as in the second stage build LLVM_USE_SANITIZER is set, which disables ASAN from being built. Thus bots will be reconfigured in the next few commits. Differential Revision: https://reviews.llvm.org/D36295 llvm-svn: 310075
* [Inliner] Fix a typo in option description. NFC.Easwaran Raman2017-08-041-1/+1
| | | | llvm-svn: 310073
* [ARM] Use searchable-table for banked registersJaved Absar2017-08-041-44/+6
| | | | | | | | | | | | | This is a continuation of https://reviews.llvm.org/D36219 This patch uses reverse mapping (encoding->name) in ARMInstPrinter::printBankedRegOperand to get rid of hard-coded values (as pointed out by @olista01). Reviewed by: @fhahn, @rovka, @olista01 Differential Revision: https://reviews.llvm.org/D36260 llvm-svn: 310072
* [ArgPromotion] Preserve alignment of byval argument in new allocaReid Kleckner2017-08-042-10/+31
| | | | | | | | | | | The frontend may have requested a higher alignment for any reason, and downstream optimizations may already have taken advantage of it. We should keep the same alignment when moving the allocation from the parameter area to the local variable area. Fixes PR34038 llvm-svn: 310071
* clang-format: [JS] support fields with case/switch/default labels.Martin Probst2017-08-042-0/+20
| | | | | | | | | | | | | | | | | | | | | Summary: `case:` and `default:` would normally parse as labels for a `switch` block. However in TypeScript, they can be used in field declarations, e.g.: interface I { case: string; } This change special cases parsing them in declaration lines to avoid wrapping them. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36148 llvm-svn: 310070
* [ConstantInt] Use ConstantInt::getValue instead of ↵Craig Topper2017-08-043-5/+5
| | | | | | | | Constant::getUniqueInteger in a few places where we obviously have a ConstantInt. NFC getUniqueInteger will ultimately call ConstantInt::getValue, but calling ConstantInt::getValue should be inlined. llvm-svn: 310069
* [AArch64] Fix an assertion for pre-index generation with unscaled loads/stores.Chad Rosier2017-08-042-2/+132
| | | | | | | Differential Revision: https://reviews.llvm.org/D36248 PR34035 llvm-svn: 310066
* Adjust the hotness threshold from 99.9% to 99%.Dehao Chen2017-08-041-1/+1
| | | | | | | | | | | | | | Summary: We originally set the hotness threshold as 99.9% to be consistent with gcc FDO. But because the inline heuristic is different between 2 compilers: llvm uses bottom-up algorithm while gcc uses priority based. The LLVM algorithm tends to inline too much early that prevents hot callsites from further inlined into its caller. Due to this restriction, we think it is reasonable to lower the hotness threshold to give priority to those that are really hot. Our experiments show that this change would improve performance on large applications. Note that the inline heuristic has great room for further tuning. Once the inline heuristics are refined, we could adjust this threshold to allow inlining for less hot callsites. Reviewers: davidxl, tejohnson, eraman Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D36317 llvm-svn: 310065
* [InstCombine] Fold single-use variable into assert.Benjamin Kramer2017-08-041-2/+2
| | | | | | Avoids unused variable warnings in Release builds. No functional change. llvm-svn: 310064
* [InstCombine] Remove the (not (sext)) case from foldBoolSextMaskToSelect and ↵Craig Topper2017-08-042-28/+9
| | | | | | | | | | | | | | | | | | | inline the remaining code to match visitOr Summary: The (not (sext)) case is really (xor (sext), -1) which should have been simplified to (sext (xor, 1)) before we got here. So we shouldn't need to handle it. With that taken care of we only need to two cases so don't need the swap anymore. This makes us in sync with the equivalent code in visitOr so inline this to match. Reviewers: spatel, eli.friedman, majnemer Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36240 llvm-svn: 310063
* [InstCombine] Use ConstantInt::getFalse to reduce some code. NFCCraig Topper2017-08-041-2/+1
| | | | llvm-svn: 310062
* [ThinLTO] Add FunctionAttrs to ThinLTO indexCharles Saternos2017-08-0414-44/+142
| | | | | | Adds function attributes to index: ReadNone, ReadOnly, NoRecurse, NoAlias. This attributes will be used for future ThinLTO optimizations that will propagate function attributes across modules. llvm-svn: 310061
* [InstCombine] narrow lshr with constantSanjay Patel2017-08-045-10/+32
| | | | | | | | | | | | | | | | | | | Name: narrow_shift Pre: C1 < 8 %zx = zext i8 %x to i32 %l = lshr i32 %zx, C1 => %narrowC = trunc i32 C1 to i8 %ns = lshr i8 %x, %narrowC %l = zext i8 %ns to i32 http://rise4fun.com/Alive/jIV This isn't directly applicable to PR34046 as written, but we need to have more narrowing folds like this to be sure that rotate patterns are recognized. llvm-svn: 310060
* [AMDGPU][MC] Enabled expressions as operandsDmitry Preobrazhensky2017-08-043-17/+22
| | | | | | | | | | See bug 33579: https://bugs.llvm.org//show_bug.cgi?id=33579 Reviewers: vpykhtin, SamWot, arsenm Differential Revision: https://reviews.llvm.org/D36091 llvm-svn: 310059
* [DAGCombiner] Extending pattern detection for vector shuffle.Simon Pilgrim2017-08-046-123/+114
| | | | | | | | | | If all the operands of a BUILD_VECTOR extract elements from same vector then split the vector efficiently based on the maximum vector access index. Committed on behalf of @jbhateja (Jatin Bhateja) Differential Revision: https://reviews.llvm.org/D35788 llvm-svn: 310058
* Revert r304953 for release 5.0.0Stefan Maksimovic2017-08-046-110/+1
| | | | | | | | | | This is causing failures when compiling clang with -O3 as one of the structures used by clang is passed by value and uses the fastcc calling convention. Faliures manifest for stage2 mips build. llvm-svn: 310057
* [ForwardOpTree] Refactor out forwardSpeculatable(). NFC.Michael Kruse2017-08-041-61/+88
| | | | | | | | | | The method forwardSpeculatable forwards speculatively executable instructions and is currently the only way to forward an instruction. In the future we intend to add more methods. llvm-svn: 310056
* [DSE] Merge stores when the later store only writes to memory locations the ↵Filipe Cabecinhas2017-08-045-5/+480
| | | | | | | | | | | | | | | | | | | | | | early store also wrote to. Summary: This fixes PR31777. If both stores' values are ConstantInt, we merge the two stores (shifting the smaller store appropriately) and replace the earlier (and larger) store with an updated constant. In the future we should also support vectors of integers. And maybe float/double if we can. Reviewers: hfinkel, junbuml, jfb, RKSimon, bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30703 llvm-svn: 310055
* [InstCombine] Canonicalize clamp of float types to minmax in fast mode.Nikolai Bozhenov2017-08-046-55/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit allows matchSelectPattern to recognize clamp of float arguments in the presence of FMF the same way as already done for integers. This case is a little different though. With integers, given the min/max pattern is recognized, DAGBuilder starts selecting MIN/MAX "automatically". That is not the case for float, because for them only full FMINNAN/FMINNUM/FMAXNAN/FMAXNUM ISD nodes exist and they do care about NaNs. On the other hand, some backends (e.g. X86) have only FMIN/FMAX nodes that do not care about NaNS and the former NAN/NUM nodes are illegal thus selection is not happening. So I decided to do such kind of transformation in IR (InstCombiner) instead of complicating the logic in the backend. Reviewers: spatel, jmolloy, majnemer, efriedma, craig.topper Reviewed By: efriedma Subscribers: hiraditya, javed.absar, n.bozhenov, llvm-commits Patch by Andrei Elovikov <andrei.elovikov@intel.com> Differential Revision: https://reviews.llvm.org/D33186 llvm-svn: 310054
* Add some tests for cast+clamp/min/max before D33186.Nikolai Bozhenov2017-08-043-85/+216
| | | | | | | | | | | | | | | | | | | | | Summary: - add more tests - pr27236.ll: rename %tmpN -> %N because otherwise a FileCheck variable for newly appeared unnamed value would use the same name as tmpN (as generated by update_test_checks.py) - run update_test_checks.py Reviewers: efriedma Reviewed By: efriedma Subscribers: n.bozhenov, llvm-commits Patch by Andrei Elovikov <andrei.elovikov@intel.com> Differential Revision: https://reviews.llvm.org/D35002 llvm-svn: 310053
* [PM] Make the new-pm passes behave more like the legacy passesPhilip Pfaffe2017-08-043-2/+11
| | | | | | | | | | | | | | | | | | | | Summary: Testing the new-pm passes becomes much easier once they behave more like the old passes in terms of the order in which Scops are processed and printed. This requires three changes: - ScopInfo: Use an ordered map to store scops - ScopInfo: Iterate and print Scops in reverse order to match legacy PM behaviour - ScopDetection: print function name in ScopAnalysisPrinter Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser Subscribers: pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D36303 llvm-svn: 310052
* [clang-tidy] Add missing documents for "IgnoreMacros" option.Haojian Wu2017-08-044-0/+29
| | | | llvm-svn: 310051
* [clang-tidy] Ignore macros in make-unique check.Haojian Wu2017-08-045-2/+71
| | | | | | | | | | | | | | | | Summary: The check doesn't fully support smart-ptr usages inside macros, which may cause incorrect fixes, or even crashes, ignore them for now. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D36264 llvm-svn: 310050
* [ELF] - Move getSymbols() methods to InputFile.George Rimar2017-08-043-24/+17
| | | | | | | | It can help to detemplate code. Differential revision: https://reviews.llvm.org/D35936 llvm-svn: 310049
* [AMDGPU] Fixed MSVC build breakFlorian Gross2017-08-041-0/+1
| | | | | | | | | | Error was: field of type 'llvm::ArgDescriptor' has private default constructor const AMDGPUFunctionArgInfo AMDGPUArgumentUsageInfo::ExternFunctionInfo{}; ^ llvm-svn: 310048
* [Driver] Error if ARM mode was selected explicitly for M-profile CPUs.Florian Hahn2017-08-043-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: M-class profiles do not support ARM execution mode, so providing -marm/-mno-thumb does not make sense in combination with -mcpu/-march options that support the M-profile. This is a follow-up patch to D35569 and it seemed pretty clear that we should emit an error in the driver in this case. We probably also should warn/error if the provided -mcpu/-march options do not match, e.g. -mcpu=cortex-m0 -march=armv8-a is invalid, as cortex-m0 does not support armv8-a. But that should be a separate patch I think. Reviewers: echristo, richard.barton.arm, rengolin, labrinea, charles.baylis Reviewed By: rengolin Subscribers: aemerson, javed.absar, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D35826 llvm-svn: 310047
* [ELF] - Remove ScriptLexer::Error field and check ErrorCount instead.George Rimar2017-08-044-27/+24
| | | | | | | | | | | | D35945 introduces change when there is useless to check Error flag in few places, but ErrorCount must be checked instead. But then we probably can just check ErrorCount always. That should simplify things. Patch do that. Differential revision: https://reviews.llvm.org/D36266 llvm-svn: 310046
* [ELF] - Fix "--symbol-ordering-file doesn't work with linker scripts"George Rimar2017-08-047-31/+102
| | | | | | | | | | | | | | | This is PR33889, Patch adds support of combination of linkerscript and -symbol-ordering-file option. If no sorting commands are present in script inside section declaration and no --sort-section option specified, code uses sorting from ordering file if any exist. Differential revision: https://reviews.llvm.org/D35843 llvm-svn: 310045
* [mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SPZoran Jovanovic2017-08-042-14/+118
| | | | | | | | | | | | Author: milena.vujosevic.janicic The patch extends size reduction pass for MicroMIPS. The following instructions are examined and transformed, if possible: ADDIU instruction is transformed into 16-bit instruction ADDIUSP ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP Usage of u_int64_t replaced by uint64_t to avoid issues because of which previous patch version was reverted: Differential Revision: https://reviews.llvm.org/D34511 llvm-svn: 310044
* [Polly][PM] Register polly passes with the opt tool for the new-pm pathPhilip Pfaffe2017-08-041-0/+11
| | | | | | | | | | | | | | Summary: When polly is linked into the tools because of the LLVM_POLLY_LINK_INTO_TOOLS option being set, we need to register its passes with the PassBuilder. Because polly is linked in, we can directly call its callback registration method, which registers the appropriate callbacks with the new PM's PassBuilder. This essentially follows exactly the way it worked with the legacy PM. Reviewers: grosser, chandlerc, bollu Reviewed By: grosser Subscribers: pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D36273 llvm-svn: 310043
* [ELF] Explicitly write null bytes in string tablesJames Henderson2017-08-042-0/+13
| | | | | | | | | | | | | | Following r309829, if a string table appears in an executable segment, the strings will not be null terminated. This is a problem, for example, for the .dynstr section when using -no-rosegment. The strings end up being terminated with 0xcc because prior to this patch, LLD did not explicitly write the null terminators. This change fixes that by always writing the null terminators. Reviewers: rafael Differential Revision: https://reviews.llvm.org/D36267 llvm-svn: 310042
* Fix typo and update documentation.Manuel Klimek2017-08-041-3/+16
| | | | | | The hasDeclaration documentation was outdated after r288366. llvm-svn: 310041
* [ELF] - Replace parallelForEach with ranged form.George Rimar2017-08-043-14/+12
| | | | | | | | Makes code a bit more convinent to write/read. Differential revision: https://reviews.llvm.org/D36089 llvm-svn: 310040
* [NFC] Fix r310036: Appease clang-formatPhilip Pfaffe2017-08-041-1/+0
| | | | llvm-svn: 310039
* [mips] Fix typo (missed space) in the warning messageSimon Atanasyan2017-08-042-2/+2
| | | | llvm-svn: 310038
* [mips] Code formatting fix. NFCSimon Atanasyan2017-08-041-1/+1
| | | | llvm-svn: 310037
* [NFC] ScopPass: Remove unused AnalysisKey from OwningInnerAnalysisManagerProxyPhilip Pfaffe2017-08-041-4/+0
| | | | llvm-svn: 310036
* [clang-tidy] Support initializer-list constructor cases in ↵Haojian Wu2017-08-043-10/+120
| | | | | | | | | | | | | | modernize-make-unique. Reviewers: alexfh Reviewed By: alexfh Subscribers: malcolm.parsons, JDevlieghere, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D36016 llvm-svn: 310035
* Do not declare a variable which is used only in assert. NFCMax Kazantsev2017-08-041-2/+1
| | | | llvm-svn: 310034
* [msan] Switch the pvalloc overflow test to a lit testBenjamin Kramer2017-08-042-6/+43
| | | | | | | | | | | | The test was not passing on targets where allocator_may_return_null defaults to true. Change the test to a lit test so that we can test both situations. Patch by Kostya Kortchinsky! Differential Revision: https://reviews.llvm.org/D36302 llvm-svn: 310033
* [IRCE] Handle loops with step different from 1/-1Max Kazantsev2017-08-042-65/+570
| | | | | | | | This patch generalizes IRCE to handle IV steps that are not equal to 1 or -1. Differential Revision: https://reviews.llvm.org/D35539 llvm-svn: 310032
* [AMDGPU] Preserve inverted bit in SI_IF in presence of SI_KILLStanislav Mekhanoshin2017-08-043-5/+106
| | | | | | | | | | In case if SI_KILL is in between of the SI_IF and SI_END_CF we need to preserve the bits actually flipped by if rather then restoring the original mask. Differential Revision: https://reviews.llvm.org/D36299 llvm-svn: 310031
* Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary ↵NAKAMURA Takumi2017-08-041-6/+2
| | | | | | | | file name." It generates MODULE-XXXXXXXXXXXX-%%%%%%%%.pcm, then GlobalModuleIndex.cpp is confused with the suffix ".pcm" llvm-svn: 310030
* Avoid comparison between signed and unsigned in SCEVExitLimitForget testsMax Kazantsev2017-08-041-3/+3
| | | | llvm-svn: 310029
* [AVR] Update target machine to use new constructor parametersDylan McKay2017-08-042-5/+10
| | | | | | The required parameters were changed in r309911. llvm-svn: 310028
OpenPOWER on IntegriCloud