summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format plugin: Add missing NL (new line) at EOF (end of file)Hans Wennborg2017-09-221-0/+6
| | | | | | | | | | | | clang-format.exe removes trailing new lines at end of file. However, if no NL is found at EOF one should be added. Patch by Teodor MICU! Differential Revision: https://reviews.llvm.org/D37732 llvm-svn: 314033
* [InstCombine] Teach foldICmpUsingKnownBits to simplify SLE/SGE/ULE/UGE to ↵Craig Topper2017-09-222-8/+12
| | | | | | | | equality comparisons when the min/max ranges intersect in a single value. This is the inverse of what we do for SGT/SLT/UGT/ULT. llvm-svn: 314032
* [InstCombine] Add test cases for known bits simplifications for comparisons ↵Craig Topper2017-09-221-0/+143
| | | | | | | | that don't depend on constant RHS. NFC This shows some missing simplifications for sge/sle/uge/ule relative to their non-equality counterparts. llvm-svn: 314031
* [InstCombine] Remove a FIXME from a test that was fixed in r314025.Craig Topper2017-09-221-1/+0
| | | | llvm-svn: 314030
* [CodeGen][ObjC] Build the global block structure before emitting theAkira Hatanaka2017-09-225-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | body of global block invoke functions. This commit fixes an infinite loop in IRGen that occurs when compiling the following code: void FUNC2() { static void (^const block1)(int) = ^(int a){ if (a--) block1(a); }; } This is how IRGen gets stuck in the infinite loop: 1. GenerateBlockFunction is called to emit the body of "block1". 2. GetAddrOfGlobalBlock is called to get the address of "block1". The function calls getAddrOfGlobalBlockIfEmitted to check whether the global block has been emitted. If it hasn't been emitted, it then tries to emit the body of the block function by calling GenerateBlockFunction, which goes back to step 1. This commit prevents the inifinite loop by building the global block in GenerateBlockFunction before emitting the body of the block function. rdar://problem/34541684 Differential Revision: https://reviews.llvm.org/D38118 llvm-svn: 314029
* Fixed broken links in docs.Ilya Biryukov2017-09-222-2/+2
| | | | | | Replaced references to `llvm.org/klaus` with `git.llvm.org/klaus`. llvm-svn: 314028
* [x86] remove over-specified platform from test configSanjay Patel2017-09-221-27/+92
| | | | llvm-svn: 314027
* [PowerPC] Mark P9 scheduling model completeStefan Pintilie2017-09-224-266/+503
| | | | | | | | | | | | This patch just adds the missing information to the P9 scheduling model to allow the model to be marked as complete. The model has been verified against P9 documentation. The model was verified with utils/schedcover.py. Differential Revision: https://reviews.llvm.org/D35695 llvm-svn: 314026
* [InstCombine] Add constant splat handling to one of the ICMP_SLT/SGT cases ↵Craig Topper2017-09-222-8/+44
| | | | | | in foldICmpUsingKnownBits. llvm-svn: 314025
* [x86] shiftRightAlgebraic -> shiftRightArithmetic; NFCSanjay Patel2017-09-221-2/+2
| | | | | | | x86 re-education camp is in session. The LLVM LangRef agrees with x86 too. The DAG nodes are undocumented and ambiguous as always. :) llvm-svn: 314024
* [x86] swap order of srl (and X, C1), C2 when it saves sizeSanjay Patel2017-09-229-288/+331
| | | | | | | | | | | | | | The (non-)obvious win comes from saving 3 bytes by using the 0x83 'and' opcode variant instead of 0x81. There are also better improvements based on known-bits that allow us to eliminate the mask entirely. As noted, this could be extended. There are potentially other wins from always shifting first, but doing that reveals a tangle of problems in other pattern matching. We do this transform generically in instcombine, but we often have icmp IR that doesn't match that pattern, so we must account for this in the backend. Differential Revision: https://reviews.llvm.org/D38181 llvm-svn: 314023
* [clang] Fix isExternC matcher docsAlexander Shaposhnikov2017-09-222-10/+21
| | | | | | | | | | | The wording in the documentation for the matcher isExternC appears to be misleading since this matcher is applicable to functions and variables as well. This diff changes the comment and regenerates the html file. Differential revision: https://reviews.llvm.org/D38151 llvm-svn: 314022
* Fix fuchsia builds broken by r313999Francis Ricci2017-09-222-0/+5
| | | | llvm-svn: 314021
* [clangd] Updated gold for completion tests after cfe changes.Ilya Biryukov2017-09-222-8/+8
| | | | llvm-svn: 314020
* Set completion priority of destructors and operators to CCP_Unlikely.Ilya Biryukov2017-09-225-19/+30
| | | | | | | | | | | | | | | | | | | Summary: It will move destructors and operators to the end of completion list. Destructors and operators are currently very high on the completion list, as they have the same priority as member functions. However, they are clearly not something users usually choose in completion lists. Reviewers: arphaman, erikjv, bkramer, krasimir Reviewed By: arphaman Subscribers: eraman, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D38081 llvm-svn: 314019
* [InstCombine] Move the call to isSignBitCheck into getDemandedBitsLHSMask ↵Craig Topper2017-09-221-15/+8
| | | | | | | | instead of calling it outside and passing its result through a flag. NFCI The result of the isSignBitCheck isn't used anywhere else and this allows us to share the m_APInt call in the likely case that it isn't a sign bit check. llvm-svn: 314018
* [InstCombine] Simplify check for RHS being a splat constant in ↵Craig Topper2017-09-221-8/+6
| | | | | | foldICmpUsingKnownBits by just checking Op1Min==Op1Max rather than going through m_APInt. llvm-svn: 314017
* [InstCombine] Make cases for ICMP_UGT/ICMP_ULT use similar formatting since ↵Craig Topper2017-09-221-6/+3
| | | | | | they use similar code. NFC llvm-svn: 314016
* [sanitizer] Replace AddressSanitizer with correct tool nameVitaly Buka2017-09-221-2/+3
| | | | llvm-svn: 314015
* Deflake the "xpc-race.mm" test.Kuba Mracek2017-09-221-22/+31
| | | | llvm-svn: 314014
* [lit.cfg] Avoid concatenating which(clang-func-mapping) if it's missingVedant Kumar2017-09-221-1/+5
| | | | | | | This un-breaks a lit workflow where you run lit tests from a test sub-directory within clang without first building clang-func-mapping. llvm-svn: 314013
* Move code to a helper function. NFC.Rafael Espindola2017-09-221-7/+13
| | | | | | Part of a patch by Jake Ehrlich! llvm-svn: 314012
* [clang] Fix printf fixit for objc specific typesAlexander Shaposhnikov2017-09-222-1/+27
| | | | | | | | | | | | | | | | | | For the triple thumbv7-apple-ios8.0.0 ssize_t is long and size_t is unsigned long, while NSInteger is int and NSUinteger is unsigned int. Following https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html Clang catches it and insert a cast to long, for example printf("%zd", getNSInteger()) will be replaced with printf("%zd", (long)getNSInteger()) but since the underlying type of ssize_t is long the specifier "%zd" is not getting replaced. This diff changes this behavior to enable replacing the specifier "%zd" with the correct one. Differential revision: https://reviews.llvm.org/D38159 Test plan: make check-all llvm-svn: 314011
* llvm-ar: align the first archive member consistently.Rafael Espindola2017-09-222-4/+14
| | | | | | | Before we were aligning the member after the symbol table to 4 but other members to 8. llvm-svn: 314010
* bindings: expose Linkage to the python bindingsSaleem Abdulrasool2017-09-222-0/+58
| | | | | | | | | Add Python bindings for the 'clang_getCursorLinkage', and tests to validate the functionality. Patch by Masud Rahman! llvm-svn: 314009
* [sanitizer] Move report locking code from asan into commonVitaly Buka2017-09-223-44/+55
| | | | llvm-svn: 314008
* [asan] Fix unlocking order for CommonSanitizerReportMutex and ↵Vitaly Buka2017-09-221-1/+1
| | | | | | reporting_thread_tid_ llvm-svn: 314007
* [sanitizer] Move CommonSanitizerReportMutex from _print.cc to _common.ccVitaly Buka2017-09-222-2/+2
| | | | llvm-svn: 314006
* [XRay] support conditional return on PPC.Tim Shen2017-09-227-72/+276
| | | | | | | | | | | | Summary: Conditional returns were not taken into consideration at all. Implement them by turning them into jumps and normal returns. This means there is a slightly higher performance penalty for conditional returns, but this is the best we can do, and it still disturbs little of the rest. Reviewers: dberris, echristo Subscribers: sanjoy, nemanjai, hiraditya, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D38102 llvm-svn: 314005
* [TableGen] Replace InfoByHwMode::getAsString with writeToStreamKrzysztof Parzyszek2017-09-225-33/+56
| | | | | | | | | | Also add operator<< for use with raw_ostream to InfoByHwMode and its derived classes. Recommitting r313989 with the fix for unresolved references: explicitly define the operator<< in namespace llvm. llvm-svn: 314004
* [TargetTransformInfo] Handle intrinsic call in getInstructionLatency()Guozhi Wei2017-09-222-7/+24
| | | | | | | | Usually an intrinsic is a simple target instruction, it should have a small latency. A real function call has much larger latency. So handle the intrinsic call in function getInstructionLatency(). Differential Revision: https://reviews.llvm.org/D38104 llvm-svn: 314003
* [Coverage] Add an option to emit limited coverage infoVedant Kumar2017-09-222-0/+13
| | | | | | | | | | | | | | | | | | | | | Add an option to emit limited coverage info for unused decls. It's just a cl::opt for now to allow us to experiment quickly. When building llc, this results in an 84% size reduction in the llvm_covmap section, and a similar size reduction in the llvm_prf_names section. In practice I expect the size reduction to be roughly quadratic with the size of the program. The downside is that coverage for headers will no longer be complete. This will make the line/function/region coverage metrics incorrect, since they will be artificially high. One mitigation would be to somehow disable those metrics when using limited-coverage=true. This is related to: llvm.org/PR34533 (make SourceBasedCodeCoverage scale) Differential Revision: https://reviews.llvm.org/D38107 llvm-svn: 314002
* Fix windows buildbot broken by r313999Francis Ricci2017-09-222-0/+2
| | | | llvm-svn: 314001
* llvm-ar: Don't add an unnecessary alignment in gnu mode.Rafael Espindola2017-09-222-1/+10
| | | | | | | This is mostly for getting stricter testing in preparation for future changes. llvm-svn: 314000
* Removed platform-specific ifdefs from sanitizer_procmaps.hFrancis Ricci2017-09-227-132/+132
| | | | | | | | | | | | | | | | Summary: Removed platform-specific ifdefs for linux, mac, freebsd and netbsd from sanitizer_procmaps.h Patch by Yicheng Wang <yichengfb@fb.com> Reviewers: kcc, kubamracek, alekseyshl, fjricci, vitalybuka Reviewed By: fjricci, vitalybuka Subscribers: vitalybuka, emaste, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D38098 llvm-svn: 313999
* [Falkor] Add falkor CPU to host detectionBalaram Makam2017-09-222-0/+4
| | | | | | This returns "falkor" for Falkor CPU. llvm-svn: 313998
* [index] Generate class & metaclass manglings for objcDave Lee2017-09-226-7/+88
| | | | | | | | | | | | | | | | | | | | | | | Summary: ObjC classes have two associated symbols, one for the class and one for the metaclass. This change overloads `CodegenNameGenerator::getAllManglings` to produce both class and metaclass symbols. While this function is called by `clang_Cursor_getCXXManglings`, it's only called for CXXRecordDecl and CXXMethodDecl, and so libclang's behavior is unchanged. Reviewers: arphaman, abdulras, alexshap, compnerd Reviewed By: compnerd Subscribers: compnerd Differential Revision: https://reviews.llvm.org/D37671 llvm-svn: 313997
* Remove trailing whitespace. NFCI.Simon Pilgrim2017-09-222-13/+13
| | | | llvm-svn: 313996
* [OPENMP] Handle re-declaration of captured variables in CodeGen.Alexey Bataev2017-09-222-4/+4
| | | | | | | | | If the captured variable has re-declaration we may end up with the situation where the captured variable is the re-declaration while the referenced variable is the canonical declaration (or vice versa). In this case we may generate wrong code. Patch fixes this situation. llvm-svn: 313995
* Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse passPranav Bhandarkar2017-09-222-0/+101
| | | | | | | | | If the two instructions being compared for equivalence have corresponding operands that are integer constants, then check their values to determine equivalence. Patch by Suyog Sarda! llvm-svn: 313993
* [Atomic][X8664] set max atomic inline width according to the targetWei Mi2017-09-228-13/+92
| | | | | | | | | | | This is to fix PR31620. MaxAtomicInlineWidth is set to 128 for x86_64. However for target without cx16 support, 128 atomic operation will generate __sync_* libcalls. The patch set MaxAtomicInlineWidth to 64 if the target doesn't support cx16. Differential Revision: https://reviews.llvm.org/D38046 llvm-svn: 313992
* Fix unused variable warning. NFCI.Simon Pilgrim2017-09-221-2/+1
| | | | llvm-svn: 313991
* Revert "[TableGen] Replace InfoByHwMode::getAsString with writeToStream"Krzysztof Parzyszek2017-09-225-53/+33
| | | | | | This reverts commit r313989: it breaks Windows bots. llvm-svn: 313990
* [TableGen] Replace InfoByHwMode::getAsString with writeToStreamKrzysztof Parzyszek2017-09-225-33/+53
| | | | | | | Also add operator<< for use with raw_ostream to InfoByHwMode and its derived classes. llvm-svn: 313989
* [SCEV] Generalize folding of trunc(x)+n*trunc(y) into folding ↵Daniel Neilson2017-09-222-6/+49
| | | | | | | | | | | | | | | | | | | | | | | | | m*trunc(x)+n*trunc(y) Summary: A SCEV such as: {%v2,+,((-1 * (trunc i64 (-1 * %v1) to i32)) + (-1 * (trunc i64 %v1 to i32)))}<%loop> can be folded into, simply, {%v2,+,0}. However, the current code in ::getAddExpr() will not try to apply the simplification m*trunc(x)+n*trunc(y) -> trunc(trunc(m)*x+trunc(n)*y) because it only keys off having a non-multiplied trunc as the first term in the simplification. This patch generalizes this code to try to do a more generic fold of these trunc expressions. Reviewers: sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37888 llvm-svn: 313988
* [scudo] Scudo thread specific data refactor, part 1Kostya Kortchinsky2017-09-228-100/+90
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We are going through an overhaul of Scudo's TSD, to allow for new platforms to be integrated more easily, and make the code more sound. This first part is mostly renaming, preferring some shorter names, correcting some comments. I removed `getPrng` and `getAllocatorCache` to directly access the members, there was not really any benefit to them (and it was suggested by Dmitry in D37590). The only functional change is in `scudo_tls_android.cpp`: we enforce bounds to the `NumberOfTSDs` and most of the logic in `getTSDAndLockSlow` is skipped if we only have 1 TSD. Reviewers: alekseyshl, dvyukov, kcc Reviewed By: dvyukov Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D38139 llvm-svn: 313987
* [x86] remove unnecessary OS specifier from testSanjay Patel2017-09-221-190/+178
| | | | llvm-svn: 313986
* [x86] auto-generate complete checks; NFCSanjay Patel2017-09-221-15/+59
| | | | llvm-svn: 313985
* [x86] update test to use FileCheck; NFCSanjay Patel2017-09-221-1/+17
| | | | llvm-svn: 313984
* [TableGen] Return StringRef from ValueTypeByHwMode::getMVTNameSimon Pilgrim2017-09-222-6/+5
| | | | | | | | | | Avoid unnecessary std::string creations during TypeSetByHwMode::writeToStream. Found during investigations into PR28222 Differential Revision: https://reviews.llvm.org/D38174 llvm-svn: 313983
OpenPOWER on IntegriCloud