summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Improve include fixer's ranking by taking the paths into account.Manuel Klimek2017-01-116-22/+66
| | | | | | | | | | | | | | | Instead of just using popularity, we also take into account how similar the path of the current file is to the path of the header. Our first approach is to get popularity into a reasonably small scale by taking log2 (which is roughly intuitive to how humans would bucket popularity), and multiply that with the number of matching prefix path fragments of the included header with the current file. Note that currently we do not take special care for unclean paths containing "../" or "./". Differential Revision: https://reviews.llvm.org/D28548 llvm-svn: 291664
* Fix line endingsSimon Pilgrim2017-01-114-421/+421
| | | | llvm-svn: 291663
* [PM] Separate the LoopAnalysisManager from the LoopPassManager and moveChandler Carruth2017-01-1144-266/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the latter to the Transforms library. While the loop PM uses an analysis to form the IR units, the current plan is to have the PM itself establish and enforce both loop simplified form and LCSSA. This would be a layering violation in the analysis library. Fundamentally, the idea behind the loop PM is to *transform* loops in addition to running passes over them, so it really seemed like the most natural place to sink this was into the transforms library. We can't just move *everything* because we also have loop analyses that rely on a subset of the invariants. So this patch splits the the loop infrastructure into the analysis management that has to be part of the analysis library, and the transform-aware pass manager. This also required splitting the loop analyses' printer passes out to the transforms library, which makes sense to me as running these will transform the code into LCSSA in theory. I haven't split the unittest though because testing one component without the other seems nearly intractable. Differential Revision: https://reviews.llvm.org/D28452 llvm-svn: 291662
* [PM] Take more drastic measures to work around MSVC's failure on thisChandler Carruth2017-01-111-7/+10
| | | | | | | code. If this doesn't work and I can't find someone to help who has MSVC installed, I'll back everything out I guess. =[ llvm-svn: 291661
* [X86] Fix PR30926 - Add patterns for (v)cvtsi2s{s,d} and (v)cvtsd2s{s,d}Elad Cohen2017-01-116-10/+220
| | | | | | | | | | | The code emiited by Clang's intrinsics for (v)cvtsi2ss, (v)cvtsi2sd, (v)cvtsd2ss and (v)cvtss2sd is lowered to a code sequence that includes redundant (v)movss/(v)movsd instructions. This patch adds patterns for optimizing these sequences. Differential revision: https://reviews.llvm.org/D28455 llvm-svn: 291660
* [X86] fixing failed test in commit: r291657 Mohammed Agabaria2017-01-111-0/+1
| | | | | | Missing Requires asserts. llvm-svn: 291659
* [ELF] - Explicitly list supported relocations for x86 target.George Rimar2017-01-113-1/+23
| | | | | | | | | | | | | | | | Previously some value was returned by default for relocations by getRelExpr(), even if relocation actually was not supported. This is orthogonal alternative to D28094. Instead of implementing probably useless R_386_PC8/R_386_8 relocations, this patch uses them in a testcase to demonstrate what happens when LLD mets unsupported relocations. Patch passes all testcases and changes logic only for x86. Differential revision: https://reviews.llvm.org/D28516 llvm-svn: 291658
* [X86] updating TTI costs for arithmetic instructions on X86\SLM arch.Mohammed Agabaria2017-01-1123-29/+616
| | | | | | | | | | | | updated instructions: pmulld, pmullw, pmulhw, mulsd, mulps, mulpd, divss, divps, divsd, divpd, addpd and subpd. special optimization case which replaces pmulld with pmullw\pmulhw\pshuf seq. In case if the real operands bitwidth <= 16. Differential Revision: https://reviews.llvm.org/D28104 llvm-svn: 291657
* [PM] Pull a lambda out of an argument into a named variable to try andChandler Carruth2017-01-111-6/+7
| | | | | | | get a little more clarity about the nature of the issue MSVC is having with this code. llvm-svn: 291656
* [PM] Another attempt to satisfy MSVC.Chandler Carruth2017-01-111-1/+1
| | | | llvm-svn: 291655
* [PM] Try to appease MSVC by explicitly disambiguating a member name asChandler Carruth2017-01-111-1/+1
| | | | | | a template. llvm-svn: 291654
* Only launch asynchronously if threading is enabled.Manuel Klimek2017-01-111-1/+6
| | | | llvm-svn: 291653
* [XRay] Define the library for XRay trace logsDean Michael Berris2017-01-1112-212/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In this change we move the definition of the log reading routines from the tools directory in LLVM to {include/llvm,lib}/XRay. We improve the documentation a little bit for the publicly accessible headers, and adjust the top-matter. This also leads to some refactoring and cleanup in the tooling code. In particular, we do the following: - Rename the class from LogReader to Trace, as it better represents the logical set of records as opposed to a log. - Use file type detection instead of asking the user to say what format the input file is. This allows us to keep the interface simple and encapsulate the logic of loading the data appropriately. In future changes we increase the API surface and write dedicated unit tests for the XRay library. Depends on D24376. Reviewers: dblaikie, echristo Subscribers: mehdi_amini, mgorny, llvm-commits, varno Differential Revision: https://reviews.llvm.org/D28345 llvm-svn: 291652
* [PM] Rewrite the loop pass manager to use a worklist and augmented runChandler Carruth2017-01-1134-387/+2015
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments much like the CGSCC pass manager. This is a major redesign following the pattern establish for the CGSCC layer to support updates to the set of loops during the traversal of the loop nest and to support invalidation of analyses. An additional significant burden in the loop PM is that so many passes require access to a large number of function analyses. Manually ensuring these are cached, available, and preserved has been a long-standing burden in LLVM even with the help of the automatic scheduling in the old pass manager. And it made the new pass manager extremely unweildy. With this design, we can package the common analyses up while in a function pass and make them immediately available to all the loop passes. While in some cases this is unnecessary, I think the simplicity afforded is worth it. This does not (yet) address loop simplified form or LCSSA form, but those are the next things on my radar and I have a clear plan for them. While the patch is very large, most of it is either mechanically updating loop passes to the new API or the new testing for the loop PM. The code for it is reasonably compact. I have not yet updated all of the loop passes to correctly leverage the update mechanisms demonstrated in the unittests. I'll do that in follow-up patches along with improved FileCheck tests for those passes that ensure things work in more realistic scenarios. In many cases, there isn't much we can do with these until the loop simplified form and LCSSA form are in place. Differential Revision: https://reviews.llvm.org/D28292 llvm-svn: 291651
* Revert r291645 "[DAGCombiner] Teach DAG combiner to fold (vselect (N0 xor ↵Craig Topper2017-01-114-348/+560
| | | | | | | | AllOnes), N1, N2) -> (vselect N0, N2, N1). Only do this if the target indicates its vector boolean type is ZeroOrNegativeOneBooleanContent." Some test appears to be hanging on the build bots. llvm-svn: 291650
* [LICM] Report failing to hoist conditionally-executed loadsAdam Nemet2017-01-112-6/+67
| | | | | | | | | | | | These are interesting again because the user may not be aware that this is a common reason preventing LICM. A const is removed from an instruction pointer declaration in order to pass it to ORE. Differential Revision: https://reviews.llvm.org/D27940 llvm-svn: 291649
* [LICM] Report failing to hoist a load with an invariant addressAdam Nemet2017-01-113-6/+85
| | | | | | | | | | | | | | | | | These are interesting because lack of precision in alias information could be standing in the way of this optimization. An example is the case in the test suite that I showed in the DevMeeting talk: http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/MultiSource/Benchmarks/FreeBench/distray/CMakeFiles/distray.dir/html/_org_test-suite_MultiSource_Benchmarks_FreeBench_distray_distray.c.html#L236 canSinkOrHoistInst is also used from LoopSink, which does not use opt-remarks so we need to take ORE as an optional argument. Differential Revision: https://reviews.llvm.org/D27939 llvm-svn: 291648
* Fix typo in commentAdam Nemet2017-01-111-1/+1
| | | | llvm-svn: 291647
* [LICM] Report successful hoist/sink/promotionAdam Nemet2017-01-1127-50/+161
| | | | | | Differential Revision: https://reviews.llvm.org/D27938 llvm-svn: 291646
* [DAGCombiner] Teach DAG combiner to fold (vselect (N0 xor AllOnes), N1, N2) ↵Craig Topper2017-01-114-560/+348
| | | | | | -> (vselect N0, N2, N1). Only do this if the target indicates its vector boolean type is ZeroOrNegativeOneBooleanContent. llvm-svn: 291645
* [Modules] Support #import when entering files with modulesBruno Cardoso Lopes2017-01-1125-9/+188
| | | | | | | | | | | | Textual headers and builtins that are #import'd from different modules should get re-entered when these modules are independent from each other. Differential Revision: https://reviews.llvm.org/D26267 rdar://problem/25881934 llvm-svn: 291644
* DAGCombiner: Add hasOneUse checks to fadd/fma combineMatt Arsenault2017-01-112-3/+268
| | | | | | | | Even with aggressive fusion enabled, this requires duplicating the fmul, or increases an fadd to another fma which is not an improvement. llvm-svn: 291642
* [Target] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-01-115-110/+143
| | | | | | other minor fixes (NFC). llvm-svn: 291641
* Re-commit r289955: [X86] Fold (setcc (cmp (atomic_load_add x, -C) C), COND) ↵Hans Wennborg2017-01-112-10/+86
| | | | | | | | | | | | | to (setcc (LADD x, -C), COND) (PR31367) This was reverted because it would miscompile code where the cmp had multiple uses. That was due to a deficiency in the existing code, which was fixed in r291630 (see the PR for details). This re-commit includes an extra test for the kind of code that got miscompiled: @test_sub_1_setcc_jcc. llvm-svn: 291640
* Follow-up for r291277: Add a return to silence GCC's "control reaches end of ↵Kuba Mracek2017-01-111-0/+1
| | | | | | non-void function" warning. llvm-svn: 291639
* Teach Polly's standalone build to work now that we include the gmockChandler Carruth2017-01-111-2/+13
| | | | | | component of gtest. llvm-svn: 291638
* Teach Polly's unittest macro to link LLVMDemangle which LLVMSupport nowChandler Carruth2017-01-111-1/+1
| | | | | | depends on... llvm-svn: 291637
* tools/llvm-xray: Avoid std::errc::protocol_* to appease mingw, like r285261.NAKAMURA Takumi2017-01-113-3/+3
| | | | | | They are oriented from winsock and mingw doesn't import them. llvm-svn: 291636
* [analyzer] Fix crash in body farm for getter without implicit self.Devin Coughlin2017-01-112-0/+28
| | | | | | | | | | | | | | | | | Fix a crash in body farm when synthesizing a getter for a property synthesized for a property declared in a protocol on a class extension that shadows a declaration of the property in a category. In this case, Sema doesn't fill in the implicit 'self' parameter for the getter in the category, which leads to a crash when trying to synthesize the getter for it. To avoid the crash, skip getter synthesis in body farm if the self parameter is not filled int. rdar://problem/29938138 llvm-svn: 291635
* InstSimplify: Refactor function to use more switchesMatt Arsenault2017-01-111-38/+51
| | | | llvm-svn: 291634
* Remove unused field.Zachary Turner2017-01-111-1/+0
| | | | llvm-svn: 291633
* [CMake][libcxx] Do not rely on the existence of c++abi or unwind targetsPetr Hosek2017-01-112-4/+6
| | | | | | | | | | | There is no guaranteed order in which CMake files for individual runtimes are invoked and therefore we cannot rely on existence of targets defined in other runtimes. Use the new HAVE_<name> options instead in those cases. Differential Revision: https://reviews.llvm.org/D28391 llvm-svn: 291632
* [tsan] Implement a 'ignore_noninstrumented_modules' flag to better suppress ↵Kuba Mracek2017-01-116-45/+153
| | | | | | | | | | | | | | false positive races On Darwin, we currently use 'ignore_interceptors_accesses', which is a heavy-weight solution that simply turns of race detection in all interceptors. This was done to suppress false positives coming from system libraries (non-instrumented code), but it also silences a lot of real races. This patch implements an alternative approach that should allow us to enable interceptors and report races coming from them, but only if they are called directly from instrumented code. The patch matches the caller PC in each interceptors. For non-instrumented code, we call ThreadIgnoreBegin. The assumption here is that the number of instrumented modules is low. Most likely there's only one (the instrumented main executable) and all the other modules are system libraries (non-instrumented). Differential Revision: https://reviews.llvm.org/D28264 llvm-svn: 291631
* [X86] Dont run combineSetCCAtomicArith() when the cmp has multiple usesHans Wennborg2017-01-112-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would miscompile the following: void g(int); int f(volatile long long *p) { bool b = __atomic_fetch_add(p, 1, __ATOMIC_SEQ_CST) < 0; g(b ? 12 : 34); return b ? 56 : 78; } into pushq %rax lock incq (%rdi) movl $12, %eax movl $34, %edi cmovlel %eax, %edi callq g(int) testq %rax, %rax <---- Bad. movl $56, %ecx movl $78, %eax cmovsl %ecx, %eax popq %rcx retq because the code failed to take into account that the cmp has multiple uses, replaced one of them, and left the other one comparing garbage. llvm-svn: 291630
* [RegBankSelect] Improve the output of the debug messages.Quentin Colombet2017-01-112-7/+46
| | | | | | Add more information about mapping cost and chosen solution. llvm-svn: 291629
* Module: Do not create Implicit ImportDecl for module X if weManman Ren2017-01-115-5/+23
| | | | | | | | | are building an implemenation of module X. This fixes a regression caused by r280409. rdar://problem/29930553 llvm-svn: 291628
* [CodeView/PDB] Rename a bunch of files.Zachary Turner2017-01-1130-95/+93
| | | | | | | | | | | We were starting to get some name clashes between llvm-pdbdump and the common CodeView framework, so I took this opportunity to rename a bunch of files to more accurately describe their usage. This also helps in llvm-pdbdump to distinguish between different files and whether they are used for pretty dump mode or raw dump mode. llvm-svn: 291627
* [CodeView] Add TypeDatabase class.Zachary Turner2017-01-119-271/+568
| | | | | | | | | | | | | | This creates a centralized class in which to store type records. It stores types as an array of entries, which matches the notion of a type stream being a topologically sorted DAG. Logic to build up such a database was already being used in CVTypeDumper, so CVTypeDumper is now updated to to read from a TypeDatabase which is filled out by an earlier visitor in the pipeline. Differential Revision: https://reviews.llvm.org/D28486 llvm-svn: 291626
* Add better documentation for iterator facade subclasses.Zachary Turner2017-01-111-0/+26
| | | | llvm-svn: 291625
* InstSimplify: Eliminate fabs on known positiveMatt Arsenault2017-01-116-32/+212
| | | | llvm-svn: 291624
* [gmock] Teach gmock ElementsAre and BeginEndDistanceIs matchers toChandler Carruth2017-01-111-12/+28
| | | | | | | | | | | | | | | | | | handle generic ranges by using std::begin and std::end rather than requiring things to look exactly like an STL container. Much of the credit for this goes to Dave Blaikie who helped me figure out the right incantations. This will probably be re-designed when I send this to the maintainers of gmock, so I've instead structured it to change is little as possible while it is a local patch. That makes it somewhat ugly, but I think a focused change is better for getting this to work for LLVM today and letting the upstream maintainers figure out the correct long-term pattern. Differential Revision: https://reviews.llvm.org/D28288 llvm-svn: 291623
* AMDGPU/EG,CM: Add fp16 conversion instructionsJan Vesely2017-01-115-36/+52
| | | | | | Differential Revision: https://reviews.llvm.org/D28164 llvm-svn: 291622
* Revert "[PGO] Turn off comdat renaming in IR PGO by default"Rong Xu2017-01-109-150/+36
| | | | | | | This patch reverts r291588: [PGO] Turn off comdat renaming in IR PGO by default, as we are seeing some hash mismatches in our internal tests. llvm-svn: 291621
* [InstCombine] add a wrapper for a common pair of transforms; NFCISanjay Patel2017-01-106-75/+44
| | | | | | | Some of the callers are artificially limiting this transform to integer types; this should make it easier to incrementally remove that restriction. llvm-svn: 291620
* [loop-unroll] Properly populate LoopInfo for loops cloned in LoopUnrollRuntime.Florian Hahn2017-01-101-3/+5
| | | | | | | | | | | | | | | | Summary: This fixes Transforms/LoopUnroll/runtime-loop3.ll which failed with EXTENSIVE_DEBUG, because the cloned basic blocks were not added to the correct sub-loops in LoopUnrollRuntime.cpp. Reviewers: dexonsmith, mzolotukhin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28482 llvm-svn: 291619
* [TM] Restore default TargetOptions in TargetMachine::resetTargetOptions.Justin Lebar2017-01-105-5/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously if you had * a function with the fast-math-enabled attr, followed by * a function without the fast-math attr, the second function would inherit the first function's fast-math-ness. This means that mixing fast-math and non-fast-math functions in a module was completely broken unless you explicitly annotated every non-fast-math function with "unsafe-fp-math"="false". This appears to have been broken since r176986 (March 2013), when the resetTargetOptions function was introduced. This patch tests the correct behavior as best we can. I don't think I can test FPDenormalMode and NoTrappingFPMath, because they aren't used in any backends during function lowering. Surprisingly, I also can't find any uses at all of LessPreciseFPMAD affecting generated code. The NVPTX/fast-math.ll test changes are an expected result of fixing this bug. When FMA is disabled, we emit add as "add.rn.f32", which prevents fma combining. Before this patch, fast-math was enabled in all functions following the one which explicitly enabled it on itself, so we were emitting plain "add.f32" where we should have generated "add.rn.f32". Reviewers: mkuper Subscribers: hfinkel, majnemer, jholewinski, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D28507 llvm-svn: 291618
* [NVPTX] Add CHECK-LABEL where appropriate to fast-math.ll test.Justin Lebar2017-01-101-9/+4
| | | | | | | | Also fix up whitespace. Test-only change. llvm-svn: 291617
* [AArch64] Consider all vector types for FeatureSlowMisaligned128StoreEvandro Menezes2017-01-102-20/+61
| | | | | | | | | | | | The original code considered only v2i64 as slow for this feature. This patch consider all 128-bit long vector types as slow candidates. In internal tests, extending this feature to all 128-bit vector types resulted in an overall improvement of 1% on Exynos M1. Differential revision: https://reviews.llvm.org/D27998 llvm-svn: 291616
* AMDGPU: Constant fold when immediate is materializedMatt Arsenault2017-01-102-141/+1086
| | | | | | In future commits these patterns will appear after moveToVALU changes. llvm-svn: 291615
* [loop-unroll] Factor out code to update LoopInfo (NFC).Florian Hahn2017-01-102-17/+39
| | | | | | | | Move the code to update LoopInfo for cloned basic blocks to addClonedBlockToLoopInfo, as suggested in https://reviews.llvm.org/D28482. llvm-svn: 291614
OpenPOWER on IntegriCloud