summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [DebugInfo][PDB] Fix a signed/unsigned coversion warningKristina Brooks2018-10-081-1/+1
| | | | | | | | | | | | Fix the following warning when compiling with clang (caused by commit rL343951): GlobalsStream.cpp:61:33: warning: comparison of integers of different signs: 'int' and 'uint32_t' This also avoids double evaluation of `GlobalsTable.HashBuckets.size()`. llvm-svn: 343957
* [InstCombine] Fix incongruous GEP type addrspaceEwan Crawford2018-10-083-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently running the @insertelem_after_gep function below through the InstCombine pass with opt produces invalid IR. Input: ``` define void @insertelem_after_gep(<16 x i32>* %t0) { %t1 = bitcast <16 x i32>* %t0 to [16 x i32]* %t2 = addrspacecast [16 x i32]* %t1 to [16 x i32] addrspace(3)* %t3 = getelementptr inbounds [16 x i32], [16 x i32] addrspace(3)* %t2, i64 0, i64 0 %t4 = insertelement <16 x i32 addrspace(3)*> undef, i32 addrspace(3)* %t3, i32 0 call void @extern_vec_pointers_func(<16 x i32 addrspace(3)*> %t4) ret void } ``` Output: ``` define void @insertelem_after_gep(<16 x i32>* %t0) { %t3 = getelementptr inbounds <16 x i32>, <16 x i32>* %t0, i64 0, i64 0 %t4 = insertelement <16 x i32 addrspace(3)*> undef, i32 addrspace(3)* %t3, i32 0 call void @my_extern_func(<16 x i32 addrspace(3)*> %t4) ret void } ``` Which although causes no complaints when produced, isn't valid IR as the insertelement use of the %t3 GEP expects an address space. ``` opt: /tmp/bad.ll:52:73: error: '%t3' defined with type 'i32*' but expected 'i32 addrspace(3)*' %t4 = insertelement <16 x i32 addrspace(3)*> undef, i32 addrspace(3)* %t3, i32 0 ``` I've fixed this by adding an addrspacecast after the GEP in the InstCombine pass, and including a check for this type mismatch to the verifier. Reviewers: spatel, lebedev.ri Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52294 llvm-svn: 343956
* [SelectionDAGBuilder][NFC] Pass LHSTy to getShiftAmountTy rather than RHSTyAlex Bradbury2018-10-081-1/+1
| | | | | | | | | | r126518 introduced a a type parameter to the getShiftAmountTy target hook. It produces the type of the shift (RHSTy), parameterised by the type of the value being shifted (LHSTy). SelectionDAGBuilder::visitShift passed RHSTy rather than LHSTy and this patch corrects this. The change is a no-op because in LLVM IR the LHS and RHS types for a shift must be equal anyway. llvm-svn: 343955
* [LV] Do not create SCEVs on broken IR in emitTransformedIndex. PR39160Max Kazantsev2018-10-085-36/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the point when we perform `emitTransformedIndex`, we have a broken IR (in particular, we have Phis for which not every incoming value is properly set). On such IR, it is illegal to create SCEV expressions, because their internal simplification process may try to prove some predicates and break when it stumbles across some broken IR. The only purpose of using SCEV in this particular place is attempt to simplify the generated code slightly. It seems that the result isn't worth it, because some trivial cases (like addition of zero and multiplication by 1) can be handled separately if needed, but more generally InstCombine is able to achieve the goals we want to achieve by using SCEV. This patch fixes a functional crash described in PR39160, and as side-effect it also generates a bit smarter code in some simple cases. It also may cause some optimality loss (i.e. we will now generate `mul` by power of `2` instead of shift etc), but there is nothing what InstCombine could not handle later. In case of dire need, we can support more trivial cases just in place. Note that this patch only fixes one particular case of the general problem that LV misuses SCEV, attempting to create SCEVs or prove predicates on invalid IR. The general solution, however, seems complex enough. Differential Revision: https://reviews.llvm.org/D52881 Reviewed By: fhahn, hsaito llvm-svn: 343954
* Fix a -Wsign-compare warning.Zachary Turner2018-10-081-1/+1
| | | | llvm-svn: 343953
* Fix a compilation failure on non-MSVC compilers.Zachary Turner2018-10-081-1/+1
| | | | llvm-svn: 343952
* [PDB] Add the ability to lookup global symbols by name.Zachary Turner2018-10-0812-16/+158
| | | | | | | | | | The Globals table is a hash table keyed on symbol name, so it's possible to lookup symbols by name in O(1) time. Add a function to the globals stream to do this, and add an option to llvm-pdbutil to exercise this, then use it to write some tests to verify correctness. llvm-svn: 343951
* Revert r343948 "[LegalizeDAG] Make one of the ReplaceNode signatures take an ↵Craig Topper2018-10-081-8/+6
| | | | | | | | ArrayRef instead a pointer to an array. Add assert on size of array. NFC" The assert is failing some asan tests on the bots. llvm-svn: 343950
* [coro]Pass rvalue reference for named local variable to return_valueBrian Gesiak2018-10-082-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Addressing https://bugs.llvm.org/show_bug.cgi?id=37265. Implements [class.copy]/33 of coroutines TS. When the criteria for elision of a copy/move operation are met, but not for an exception-declaration, and the object to be copied is designated by an lvalue, or when the expression in a return or co_return statement is a (possibly parenthesized) id-expression that names an object with automatic storage duration declared in the body or parameter-declaration-clause of the innermost enclosing function or lambda-expression, overload resolution to select the constructor for the copy or the return_value overload to call is first performed as if the object were designated by an rvalue. Patch by Tanoy Sinha! Reviewers: modocache, GorNishanov Reviewed By: modocache, GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51741 llvm-svn: 343949
* [LegalizeDAG] Make one of the ReplaceNode signatures take an ArrayRef ↵Craig Topper2018-10-081-6/+8
| | | | | | instead a pointer to an array. Add assert on size of array. NFC llvm-svn: 343948
* [LegalizeDAG] Move legalization of scatter and masked store from ↵Craig Topper2018-10-082-11/+10
| | | | | | | | | | LegalizeVectorOps to LegalizeDAG. This is where we legalize gather and masked load so this is consistent. Since these ops are always on vectors I've chosen to go with LegalizeDAG since that's what we do for other vector only ops like BUILD_VECTOR, VECTOR_SHUFFLE, etc. The ScalarizeMaskedMemIntrinsic pass should take care of scalarizing these before SelectionDAG so hopefully we don't need to worry about illegally typed scalar ops being emitted in the legalizing. If we did we would need to do this in LegalizeVectorOps so we could get the second type legalization that runs between LegalizeVectorOps and LegalizeDAG. llvm-svn: 343947
* [clangd] Migrate to LLVM STLExtras range APIFangrui Song2018-10-072-7/+6
| | | | llvm-svn: 343946
* [DAGCombiner] allow undef elts in vector fadd matchingSanjay Patel2018-10-072-3/+1
| | | | llvm-svn: 343945
* [x86] add vector fadd with undef elts test; NFCSanjay Patel2018-10-071-0/+10
| | | | llvm-svn: 343944
* [x86] remove redundant tests; NFCSanjay Patel2018-10-071-9/+0
| | | | | | The equivalent tests were added to the file with related folds in rL343941. llvm-svn: 343943
* [DAGCombiner] allow undefs when matching vector splats for fmul foldsSanjay Patel2018-10-072-7/+5
| | | | llvm-svn: 343942
* [x86] add vector fmul with undef elts tests; NFC Sanjay Patel2018-10-071-0/+57
| | | | llvm-svn: 343941
* [DAGCombiner] allow undef elts in vector fabs/fneg matchingSanjay Patel2018-10-072-7/+5
| | | | | | | | This change is proposed as a part of D44548, but we need this independently to avoid regressions from improved undef propagation in SimplifyDemandedVectorElts(). llvm-svn: 343940
* [DAGCombiner] shorten code for bitcast+fabs fold; NFCSanjay Patel2018-10-071-5/+2
| | | | llvm-svn: 343939
* [x86] add tests for FP logic folding for vectors with undefs; NFC Sanjay Patel2018-10-071-0/+26
| | | | llvm-svn: 343938
* [clangd] NFC: Migrate to LLVM STLExtras API where possibleKirill Bobyrev2018-10-0713-62/+54
| | | | | | | | | | | | | | This patch improves readability by migrating `std::function(ForwardIt start, ForwardIt end, ...)` to LLVM's STLExtras range-based equivalent `llvm::function(RangeT &&Range, ...)`. Similar change in Clang: D52576. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52650 llvm-svn: 343937
* [InstSimplify] add vector test for fneg+fdiv; NFCSanjay Patel2018-10-071-16/+32
| | | | | | This should be fixed with D52934. llvm-svn: 343936
* [SelectionDAG] Respect multiple uses in SimplifyDemandedBits to ↵Simon Pilgrim2018-10-078-104/+183
| | | | | | | | | | | | SimplifyDemandedVectorElts simplification rL343913 was using SimplifyDemandedBits's original demanded mask instead of the adjusted 'NewMask' that accounts for multiple uses of the op (those variable names really need improving....). Annoyingly many of the test changes (back to pre-rL343913 state) are actually safe - but only because their multiple uses are all by PMULDQ/PMULUDQ. Thanks to Jan Vesely (@jvesely) for bisecting the bug. llvm-svn: 343935
* [AARCH64][X86] Remove _nonsplat from test namesSimon Pilgrim2018-10-072-48/+48
| | | | | | As discussed on D50222 llvm-svn: 343934
* [LegalizeVectorOps] Make ExpandStrictFPOp return the result corresponding to ↵Craig Topper2018-10-071-1/+1
| | | | | | | | the result number of the SDValue passed in. It was always returning the chain which seems to be the result number of the SDValue in the lit tests we have. But I don't know if that's guaranteed. llvm-svn: 343933
* [IAI,LV] Avoid creating interleave-groups for predicated accesseDorit Nuzman2018-10-073-1/+105
| | | | | | | | | | | | | | | | | | | | | | This patch fixes PR39099. When strided loads are predicated, each of them will form an interleaved-group (with gaps). However, subsequent stages of vectorization (planning and transformation) assume that if a load is part of an Interleave-Group it is not predicated, resulting in wrong code - unmasked wide loads are created. The Interleaving Analysis does take care not to have conditional interleave groups of size > 1, but until we extend the planning and transformation stages to support masked-interleave-groups we should also avoid having them for size == 1. Reviewers: Ayal, hsaito, dcaballe, fhahn Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D52682 llvm-svn: 343931
* [RISCV] Introduce alu8.ll and alu16.ll testsAlex Bradbury2018-10-072-0/+412
| | | | | | | These track the quality of generated code for simple arithmetic operations that were legalised from non-native types. llvm-svn: 343930
* [ORC] Consume unhandled errors in unit test.Lang Hames2018-10-071-0/+2
| | | | | | This should fix the failures on the debug buildbots. llvm-svn: 343929
* [ORC] Add a 'remove' method to JITDylib to remove symbols.Lang Hames2018-10-063-0/+180
| | | | | | | | Symbols can be removed provided that all are present in the JITDylib and none are currently in the materializing state. On success all requested symbols are removed. On failure an error is returned and no symbols are removed. llvm-svn: 343928
* [ORC] Pass symbol name to discard by const reference.Lang Hames2018-10-069-15/+17
| | | | | | This saves some unnecessary atomic ref-counting operations. llvm-svn: 343927
* [X86] getFauxShuffleMask - Handle undef + sentinel values in subvector insertionSimon Pilgrim2018-10-062-13/+11
| | | | llvm-svn: 343926
* [X86][SSE] Add SSE41 vector int2fp testsSimon Pilgrim2018-10-061-1217/+2323
| | | | llvm-svn: 343925
* [X86][AVX] Ensure resolveTargetShuffleInputs shuffle masks are the correct widthSimon Pilgrim2018-10-061-1/+2
| | | | | | Don't handle ZERO_EXTEND style shuffles until we support bitcasts. Found by inspection. llvm-svn: 343924
* Papers and Issues for San DiegoMarshall Clow2018-10-061-54/+81
| | | | llvm-svn: 343923
* [X86] combinePMULDQ - add op back to worklist if SimplifyDemandedBits ↵Simon Pilgrim2018-10-062-28/+10
| | | | | | | | succeeds on either operand Prevents missing other simplifications that may occur deep in the operand chain where CommitTargetLoweringOpt won't add the PMULDQ back to the worklist itself llvm-svn: 343922
* [X86] Regenerate LSR loop iteration testSimon Pilgrim2018-10-061-28/+218
| | | | llvm-svn: 343921
* [x86] add test for masked store with extra shift op; NFCSanjay Patel2018-10-061-4/+52
| | | | llvm-svn: 343920
* [X86][SSE] SimplifyDemandedVectorEltsForTargetNode - simplify PSHUFB masksSimon Pilgrim2018-10-064-9/+18
| | | | | | Attempt to simplify PSHUFB masks (even non-constant ones) - we should probably be able to simplify other variable shuffles as well as the need arises. llvm-svn: 343919
* [X86] Use the SimplifyDemandedBits wrappers where possible. NFCI.Simon Pilgrim2018-10-061-23/+4
| | | | | | Leave the wrapper to handle TargetLowering::TargetLoweringOpt and CommitTargetLoweringOpt. llvm-svn: 343918
* Revert rL343916: Fix -Wmissing-braces warning. NFCI.Simon Pilgrim2018-10-061-3/+3
| | | | llvm-svn: 343917
* Fix -Wmissing-braces warning. NFCI.Simon Pilgrim2018-10-061-3/+3
| | | | llvm-svn: 343916
* Wdocumentation fixSimon Pilgrim2018-10-061-1/+1
| | | | llvm-svn: 343915
* Wdocumentation fixSimon Pilgrim2018-10-061-1/+2
| | | | llvm-svn: 343914
* [SelectionDAG] Add SimplifyDemandedBits to SimplifyDemandedVectorElts ↵Simon Pilgrim2018-10-0618-524/+359
| | | | | | | | | | | | | | | | simplification This patch enables SimplifyDemandedBits to call SimplifyDemandedVectorElts in cases where the demanded bits mask covers entire elements of a bitcasted source vector. There are a couple of cases here where simplification at a deeper level (such as through bitcasts) prevents further simplification - CommitTargetLoweringOpt only adds immediate uses/users back to the worklist when we might want to combine the original caller again to see what else it can simplify. As well as that I had to disable handling of bool vector until SimplifyDemandedVectorElts better supports some of their opcodes (SETCC, shifts etc.). Fixes PR39178 Differential Revision: https://reviews.llvm.org/D52935 llvm-svn: 343913
* [clangd] Remove unused headers from CodeComplete.cppFangrui Song2018-10-061-3/+0
| | | | | | | queue is not used after index-provided completions' merge with those from Sema USRGeneration.h is not used after introduction of getSymbolID llvm-svn: 343912
* [RISCV] Compress addiw rd, x0, simm6 to c.li rd, simm6Alex Bradbury2018-10-062-10/+12
| | | | | | | | A pattern was present for addi rd, x0, simm6 but not addiw which is semantically identical when the source register is x0. This patch addresses that, and the benefit can be seen in rv64c-aliases-valid.s. llvm-svn: 343911
* AMDGPU: Consolidate SMRD TableGen patternsTom Stellard2018-10-061-100/+80
| | | | | | | | | | | | | | | | | Summary: Merge the SMRD patterns for CI into the same multiclass as the patterns for other sub-targets. This removes some duplicate code and will make it easier for some future GlobalISel changes I would like to do. Reviewers: arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D52557 llvm-svn: 343909
* Thread safety analysis: Handle conditional expression in getTrylockCallExprAaron Puchert2018-10-062-1/+30
| | | | | | | | | | | | | | | | | | | | | Summary: We unwrap conditional expressions containing try-lock functions. Additionally we don't acquire on conditional expression branches, since that is usually not helpful. When joining the branches we would almost certainly get a warning then. Hopefully fixes an issue that was raised in D52398. Reviewers: aaron.ballman, delesley, hokein Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52888 llvm-svn: 343902
* [llvm-ar] Use POSIX-specified timestamps for 'tv'.Jordan Rupprecht2018-10-054-23/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The POSIX spec says: ``` If the −t option is used with the −v option, the standard output format shall be: "%s %u/%u %u %s %d %d:%d %d %s\n", <member mode>, <user ID>, <group ID>, <number of bytes in member>, <abbreviated month>, <day-of-month>, <hour>, <minute>, <year>, <file> where: ... <abbreviated month> Equivalent to the format of the %b conversion specification format in date. <day-of-month> Equivalent to the format of the %e conversion specification format in date. <hour> Equivalent to the format of the %H conversion specification format in date. <minute> Equivalent to the format of the %M conversion specification format in date. <year> Equivalent to the format of the %Y conversion specification format in date. ``` This actually used to be the format printed by llvm-ar. It was apparently accidentally changed (see r207385 followed by comments in r207387). This makes it conform to GNU ar for easier replacement. Reviewers: MaskRay Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52940 llvm-svn: 343901
* Add support for artificial tail call framesVedant Kumar2018-10-0552-73/+1166
| | | | | | | | | | | | | | | | This patch teaches lldb to detect when there are missing frames in a backtrace due to a sequence of tail calls, and to fill in the backtrace with artificial tail call frames when this happens. This is only done when the execution history can be determined from the call graph and from the return PC addresses of calls on the stack. Ambiguous sequences of tail calls (e.g anything involving tail calls and recursion) are detected and ignored. Depends on D49887. Differential Revision: https://reviews.llvm.org/D50478 llvm-svn: 343900
OpenPOWER on IntegriCloud