summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Revert rL292621. Caused some internal build bot failures in apple.Wei Mi2017-01-244-625/+0
| | | | llvm-svn: 292984
* [SystemZ] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-01-2410-98/+185
| | | | | | other minor fixes (NFC). llvm-svn: 292983
* Enable FeatureFlatForGlobal on Volcanic IslandsMatt Arsenault2017-01-24276-379/+391
| | | | | | | | | | | This switches to the workaround that HSA defaults to for the mesa path. This should be applied to the 4.0 branch. Patch by Vedran Miletić <vedran@miletic.net> llvm-svn: 292982
* Explicitly promote indirect calls before sample profile annotation.Dehao Chen2017-01-243-5/+58
| | | | | | | | | | | | | | Summary: In iterative sample pgo where profile is collected from PGOed binary, we may see indirect call targets promoted and inlined in the profile. Before profile annotation, we need to make this happen in order to annotate correctly on IR. This patch explicitly promotes these indirect calls and inlines them before profile annotation. Reviewers: xur, davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29040 llvm-svn: 292979
* Demangle: correct demangling for CV-qualified functionsSaleem Abdulrasool2017-01-241-6/+9
| | | | | | | | | | | When demangling a CV-qualified function type with a final reference type parameter, we would treat the reference type parameter as a r-value ref accidentally. This would result in the improper decoration of the function type itself. Resolves PR31741! llvm-svn: 292976
* Demangle: use named values for CV qualifiersSaleem Abdulrasool2017-01-241-12/+18
| | | | | | | Rather than hard-coding magic values of 1, 2, 4 (bit-field), use an enum to name the values. NFC. llvm-svn: 292975
* Revert [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.Ivan Krasin2017-01-243-241206/+0
| | | | | | | | | | | | Reason: broke ASAN bots with a global buffer overflow. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/2291 Each test contains 20-30K test cases but takes only several (from 4 to 10) seconds to complete on average machine. The tests cover the majority of AMDGPU Gfx7/Gfx8 instructions, including many dark corners, and intended to quickly find out if something is broken. llvm-svn: 292974
* Remove the load hoisting code of MLSM, it is completely subsumed by GVNHoistDaniel Berlin2017-01-243-179/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GVNHoist performs all the optimizations that MLSM does to loads, in a more general way, and in a faster time bound (MLSM is N^3 in most cases, N^4 in a few edge cases). This disables the load portion. Note that the way ld_hoist_st_sink.ll is written makes one think that the loads should be moved to the while.preheader block, but 1. Neither MLSM nor GVNHoist do it (they both move them to identical places). 2. MLSM couldn't possibly do it anyway, as the while.preheader block is not the head of the diamond, while.body is. (GVNHoist could do it if it was legal). 3. At a glance, it's not legal anyway because the in-loop load conflict with the in-loop store, so the loads must stay in-loop. I am happy to update the test to use update_test_checks so that checking is tighter, just was going to do it as a followup. Note that i can find no particular benefit to the store portion on any real testcase/benchmark i have (even size-wise). If we really still want it, i am happy to commit to writing a targeted store sinker, just taking the code from the MemorySSA port of MergedLoadStoreMotion (which is N^2 worst case, and N most of the time). We can do what it does in a much better time bound. We also should be both hoisting and sinking stores, not just sinking them, anyway, since whether we should hoist or sink to merge depends basically on luck of the draw of where the blockers are placed. Nonetheless, i have left it alone for now. Reviewers: chandlerc, davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29079 llvm-svn: 292971
* AMDGPU/SI: Give up in promote alloca when a pointer may be captured.Changpeng Fang2017-01-242-0/+51
| | | | | | | | | | Differential Revision: http://reviews.llvm.org/D28970 Reviewer: Matt llvm-svn: 292966
* Demangle: avoid butchering parameter typeSaleem Abdulrasool2017-01-241-2/+2
| | | | | | | | | | When demangling a CV-qualified function type with a final parameter with a reference type, we would insert the CV qualification on the parameter rather than the function, and in the process adjust the insertion point by one extra, splitting the type name. This avoids doing so, even though the attribution is still incorrect. llvm-svn: 292965
* [AArch64] Fix typo. NFC.Chad Rosier2017-01-241-2/+2
| | | | llvm-svn: 292959
* Use InstCombine's builder in foldSelectCttzCtlz instead of creating a new one.Amaury Sechet2017-01-241-3/+2
| | | | | | | | | | Summary: As per title. This will add the instructiions we are interested in in the worklist. Reviewers: mehdi_amini, majnemer, andreadb Differential Revision: https://reviews.llvm.org/D29081 llvm-svn: 292957
* [AMDGPU] Add VGPR copies post regalloc fix passStanislav Mekhanoshin2017-01-245-0/+122
| | | | | | | | | | | | | | Regalloc creates COPY instructions which do not formally use VALU. That results in v_mov instructions displaced after exec mask modification. One pass which do it is SIOptimizeExecMasking, but potentially it can be done by other passes too. This patch adds a pass immediately after regalloc to add implicit exec use operand to all VGPR copy instructions. Differential Revision: https://reviews.llvm.org/D28874 llvm-svn: 292956
* [AArch64] Rename 'no-quad-ldst-pairs' to 'slow-paired-128'Evandro Menezes2017-01-244-9/+8
| | | | | | | In order to follow the pattern of the existing 'slow-misaligned-128store' option, rename the option 'no-quad-ldst-pairs' to 'slow-paired-128'. llvm-svn: 292954
* [Lanai] Rename LanaiInstPrinter library to LanaiAsmPrinterChris Bieneman2017-01-244-4/+4
| | | | | | | | | | | | | | | Summary: This is in keeping with LLVM convention. The classes are InstPrinters, but the library is ${target}AsmPrinter. This patch is in response to bryant pointing out to me that Lanai was the only backend deviating from convention here. Thanks! Reviewers: jpienaar, bryant Subscribers: mgorny, jgosnell, llvm-commits Differential Revision: https://reviews.llvm.org/D29043 llvm-svn: 292953
* [InstSimplify] try to eliminate icmp Pred (add nsw X, C1), C2Sanjay Patel2017-01-242-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was surprised to see that we're missing icmp folds based on 'add nsw' in InstCombine, but we should handle the InstSimplify cases first because that could make the InstCombine code simpler. Here are Alive-based proofs for the logic: Name: add_neg_constant Pre: C1 < 0 && (C2 > ((1<<(width(C1)-1)) + C1)) %a = add nsw i7 %x, C1 %b = icmp sgt %a, C2 => %b = false Name: add_pos_constant Pre: C1 > 0 && (C2 < ((1<<(width(C1)-1)) + C1 - 1)) %a = add nsw i6 %x, C1 %b = icmp slt %a, C2 => %b = false Name: nuw Pre: C1 u>= C2 %a = add nuw i11 %x, C1 %b = icmp ult %a, C2 => %b = false Differential Revision: https://reviews.llvm.org/D29053 llvm-svn: 292952
* [X86][AVX2] Regenerate test.Simon Pilgrim2017-01-241-2/+1
| | | | llvm-svn: 292950
* [CodeView] Fix off-by-one error in def range gap emissionReid Kleckner2017-01-242-6/+30
| | | | | | | | | Also fixes a much worse bug where we emitted the wrong gap size for the def range uncovered by the test for this issue. Fixes PR31726. llvm-svn: 292949
* [X86][AVX2] Removed FIXME comment and regenerated test.Simon Pilgrim2017-01-241-5/+1
| | | | | | The comment talked about replacing vpmovzxwd+vpslld+vpsrad with vpmovsxwd - which isn't valid as we're sign extending a <8 x i1> bool vector not an all/nobits <8 x i16> llvm-svn: 292948
* [X86][AVX2] Cleaned up test triple and regenerated tests.Simon Pilgrim2017-01-241-14/+2
| | | | llvm-svn: 292946
* [SelectionDAG] Handle inverted conditions when splitting into multiple branches.Geoff Berry2017-01-245-20/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When conditional branches with complex conditions are split into multiple branches in SelectionDAGBuilder::FindMergedConditions, also handle inverted conditions. These may sometimes appear without having been optimized by InstCombine when CodeGenPrepare decides to sink and duplicate cmp instructions, causing them to have only one use. This problem can be increased by e.g. GVNHoist hiding more cmps from InstCombine by combining equivalent cmps from different blocks. For example codegen X & !(Y | Z) as: jmp_if_X TmpBB jmp FBB TmpBB: jmp_if_notY Tmp2BB jmp FBB Tmp2BB: jmp_if_notZ TBB jmp FBB Reviewers: bogner, MatzeB, qcolombet Subscribers: llvm-commits, hiraditya, mcrosier, sebpop Differential Revision: https://reviews.llvm.org/D28380 llvm-svn: 292944
* Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAILAlex Lorenz2017-01-2416-602/+112
| | | | | | | | | | | and UNSUPPORTED" After r292904 llvm-lit fails to emit the test results in the XML format for Apple's internal buildbots. rdar://30164800 llvm-svn: 292942
* [X86][AVX512] Remove unused argument from PMOVX tablegen patterns. NFCI.Simon Pilgrim2017-01-241-3/+3
| | | | | | Seems to be a copy+paste legacy from the AVX2 patterns. llvm-svn: 292941
* Fix formating in foldSelectCttzCtlz. NFCAmaury Sechet2017-01-241-1/+1
| | | | llvm-svn: 292934
* Improve comment for ISD::EXTRACT_VECTOR_ELTJonas Paulsson2017-01-241-1/+2
| | | | | | | | The comment in ISDOpcodes.h for EXTRACT_VECTOR_ELT now explains that the high bits are undefined if the result is extended. Review: Hal Finkel llvm-svn: 292933
* [PH] Replace uses of AssertingVH from members of analysis results withChandler Carruth2017-01-2413-67/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a lazy-asserting PoisoningVH. AssertVH is fundamentally incompatible with cache-invalidation of analysis results. The invaliadtion happens after the AssertingVH has already fired. Instead, use a PoisoningVH that will assert if the dangling handle is ever used rather than merely be assigned or destroyed. This patch also removes all of the (numerous) doomed attempts to work around this fundamental incompatibility. It is a pretty significant simplification IMO. The most interesting change is in the Inliner where we still do some clearing because we don't want to rely on the coarse grained invalidation strategy of the containing pass manager. However, I prefer the approach that contains this logic to the cleanup phase of the Inliner, and I think we could enhance the CGSCC analysis management layer to make this even better in the future if desired. The rest is straight cleanup. I've also added a test for one of the harder cases to work around: when a *module analysis* contains many AssertingVHes pointing at functions. Differential Revision: https://reviews.llvm.org/D29006 llvm-svn: 292928
* [PM] Introduce a PoisoningVH as a (more expensive) alternative toChandler Carruth2017-01-242-3/+226
| | | | | | | | | | | | | | | | | | | | | | | | AssertingVH that delays any reported error until the handle is *used*. This allows data structures to contain handles which become dangling provided the data structure is cleaned up afterward rather than used for anything interesting. The implementation is moderately horrible in part because it works to leave AssertingVH in place, undisturbed. If at some point there is consensus that this is simply how AssertingVH should be used, it can be substantially simplified. This remains a boring pointer in a non-asserts build as you would expect. The only place we pay cost is in asserts builds. I plan to use this as a basis for replacing the asserting VHs that currently dangle in the new PM until invalidation occurs in both LVI and SCEV. Differential Revision: https://reviews.llvm.org/D29061 llvm-svn: 292925
* [X86][SSE] Add explicit braces to avoid -Wdangling-else warning.Martin Bohme2017-01-241-1/+2
| | | | | | | | | | Reviewers: RKSimon Subscribers: llvm-commits, igorb Differential Revision: https://reviews.llvm.org/D29076 llvm-svn: 292924
* [AMDGPU][mc][tests][NFC] Add coverage/smoke tests for Gfx7 and Gfx8.Artem Tamazov2017-01-243-0/+241206
| | | | | | | | | Each test contains 20-30K test cases but takes only several (from 4 to 10) seconds to complete on average machine. The tests cover the majority of AMDGPU Gfx7/Gfx8 instructions, including many dark corners, and intended to quickly find out if something is broken. llvm-svn: 292922
* Fix unused variable warningSimon Pilgrim2017-01-241-2/+2
| | | | llvm-svn: 292921
* [X86][SSE] Add support for constant folding vector arithmetic shift by ↵Simon Pilgrim2017-01-244-51/+57
| | | | | | immediates llvm-svn: 292919
* Fix fs::set_current_path unit testPavel Labath2017-01-241-1/+5
| | | | | | | | The test fails when there is a symlink on the path because then the path returned by current_path will not match the one we have set. Instead of doing a string match check the unique id of the two files. llvm-svn: 292916
* [X86][SSE] Add support for constant folding vector logical shift by immediatesSimon Pilgrim2017-01-2413-213/+186
| | | | llvm-svn: 292915
* [InstCombine][X86] MULDQ/MULUDQ undef -> zeroSimon Pilgrim2017-01-242-7/+1
| | | | | | | | Added early out for single undef input - we were already supporting (and testing) this in the constant folding code, we just do it quicker now Drop undef handling from demanded elts code now that we handle it fully in InstCombiner::visitCallInst llvm-svn: 292913
* [Support] Use O_CLOEXEC only when declaredPavel Labath2017-01-241-2/+20
| | | | | | | | | | | | | | | | | | | Summary: Use the O_CLOEXEC flag only when it is available. Some old systems (e.g. SLES10) do not support this flag. POSIX explicitly guarantees that this flag can be checked for using #if, so there is no need for a CMake check. In case O_CLOEXEC is not supported, fall back to fcntl(FD_CLOEXEC) instead. Reviewers: rnk, rafael, mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28894 llvm-svn: 292912
* [SLP] Additional test for checking that instruction with extra args isAlexey Bataev2017-01-241-0/+57
| | | | | | not reconstructed. llvm-svn: 292911
* [Support] Add sys::fs::set_current_path() (aka chdir)Pavel Labath2017-01-244-0/+48
| | | | | | | | | | | | | | | Summary: This adds a cross-platform way of setting the current working directory analogous to the existing current_path() function used for retrieving it. The function will be used in lldb. Reviewers: rafael, silvas, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29035 llvm-svn: 292907
* [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTEDGreg Parker2017-01-2416-112/+602
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A `lit` condition line is now a comma-separated list of boolean expressions. Comma-separated expressions act as if each expression were on its own condition line: For REQUIRES, if every expression is true then the test will run. For UNSUPPORTED, if every expression is false then the test will run. For XFAIL, if every expression is false then the test is expected to succeed. As a special case "XFAIL: *" expects the test to fail. Examples: # Test is expected fail on 64-bit Apple simulators and pass everywhere else XFAIL: x86_64 && apple && !macosx # Test is unsupported on Windows and on non-Ubuntu Linux # and supported everywhere else UNSUPPORTED: linux && !ubuntu, system-windows Syntax: * '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false. * Each test feature is a true identifier. * Substrings of the target triple are true identifiers for UNSUPPORTED and XFAIL, but not for REQUIRES. (This matches the current behavior.) * All other identifiers are false. * Identifiers are [-+=._a-zA-Z0-9]+ Differential Revision: https://reviews.llvm.org/D18185 llvm-svn: 292904
* Revert "[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED"Greg Parker2017-01-2419-607/+117
| | | | | | This change needs to be better-coordinated with libc++. llvm-svn: 292900
* [SLP] Refactoring of HorizontalReduction class, NFC.Alexey Bataev2017-01-241-34/+20
| | | | | | | | | Removed data members ReduxWidth and MinVecRegSize + some C++11 stylish improvements. Differential Revision: https://reviews.llvm.org/D29010 llvm-svn: 292899
* [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTEDGreg Parker2017-01-2419-117/+607
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A `lit` condition line is now a comma-separated list of boolean expressions. Comma-separated expressions act as if each expression were on its own condition line: For REQUIRES, if every expression is true then the test will run. For UNSUPPORTED, if every expression is false then the test will run. For XFAIL, if every expression is false then the test is expected to succeed. As a special case "XFAIL: *" expects the test to fail. Examples: # Test is expected fail on 64-bit Apple simulators and pass everywhere else XFAIL: x86_64 && apple && !macosx # Test is unsupported on Windows and on non-Ubuntu Linux # and supported everywhere else UNSUPPORTED: linux && !ubuntu, system-windows Syntax: * '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false. * Each test feature is a true identifier. * Substrings of the target triple are true identifiers for UNSUPPORTED and XFAIL, but not for REQUIRES. (This matches the current behavior.) * All other identifiers are false. * Identifiers are [-+=._a-zA-Z0-9]+ Differential Revision: https://reviews.llvm.org/D18185 llvm-svn: 292896
* Update domtree incrementally in loop peeling.Serge Pavlov2017-01-242-8/+31
| | | | | | | | | With this change dominator tree remains in sync after each step of loop peeling. Differential Revision: https://reviews.llvm.org/D29029 llvm-svn: 292895
* [X86] Remove unnecessary peakThroughBitcasts call that's already take care ↵Craig Topper2017-01-241-2/+0
| | | | | | of by the ISD::isBuildVectorAllOnes check below. llvm-svn: 292894
* AMDGPU : Add trap handler support.Wei Ding2017-01-244-25/+37
| | | | llvm-svn: 292893
* [AVX-512] Simplify multiclasses for integer logic operations. There were ↵Craig Topper2017-01-241-35/+23
| | | | | | | | several inputs that didn't vary. While there give them the same scheduling itinerary as the SSE/AVX versions. llvm-svn: 292892
* [Orc][RPC] Refactor ParallelCallGroup to decouple it from RPCEndpoint.Lang Hames2017-01-242-38/+37
| | | | | | | | This refactor allows parallel calls to be made via an arbitrary async call dispatcher. In particular, this allows ParallelCallGroup to be used with derived RPC classes that expose custom async RPC call operations. llvm-svn: 292891
* Make VerifyDomInfo and VerifyLoopInfo global variablesSerge Pavlov2017-01-243-9/+27
| | | | | | | | | | | | | | | Verifications of dominator tree and loop info are expensive operations so they are disabled by default. They can be enabled by command line options -verify-dom-info and -verify-loop-info. These options however enable checks only in files Dominators.cpp and LoopInfo.cpp. If some transformation changes dominaror tree and/or loop info, it would be convenient to place similar checks to the files implementing the transformation. This change makes corresponding flags global, so they can be used in any file to optionally turn verification on. llvm-svn: 292889
* [SystemZ] Gracefully fail in GeneralShuffle::add() instead of assertion.Jonas Paulsson2017-01-241-12/+22
| | | | | | | | | | | | | | The GeneralShuffle::add() method used to have an assert that made sure that source elements were at least as big as the destination elements. This was wrong, since it is actually expected that an EXTRACT_VECTOR_ELT node with a smaller source element type than the return type gets extended. Therefore, instead of asserting this, it is just checked and if this is the case 'false' is returned from the GeneralShuffle::add() method. This case should be very rare and is not handled further by the backend. Review: Ulrich Weigand. llvm-svn: 292888
* [PM] Further fixes to the test case in r292863.Chandler Carruth2017-01-241-1/+1
| | | | | | This should hopefully fix the MSVC failures remaining. llvm-svn: 292887
* [Orc][RPC] Refactor some common remote-function-id negotiation code.Lang Hames2017-01-241-81/+33
| | | | llvm-svn: 292886
OpenPOWER on IntegriCloud