summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [FPEnv][X86] More strict int <-> FP conversion fixesUlrich Weigand2019-12-2316-1151/+1655
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix several several additional problems with the int <-> FP conversion logic both in common code and in the X86 target. In particular: - The STRICT_FP_TO_UINT expansion emits a floating-point compare. This compare can raise exceptions and therefore needs to be a strict compare. I've made it signaling (even though quiet would also be correct) as signaling is the more usual default for an LT. This code exists both in common code and in the X86 target. - The STRICT_UINT_TO_FP expansion algorithm was incorrect for strict mode: it emitted two STRICT_SINT_TO_FP nodes and then used a select to choose one of the results. This can cause spurious exceptions by the STRICT_SINT_TO_FP that ends up not chosen. I've fixed the algorithm to use only a single STRICT_SINT_TO_FP instead. - The !isStrictFPEnabled logic in DoInstructionSelection would sometimes do the wrong thing because it calls getOperationAction using the result VT. But for some opcodes, incuding [SU]INT_TO_FP, getOperationAction needs to be called using the operand VT. - Remove some (obsolete) code in X86DAGToDAGISel::Select that would mutate STRICT_FP_TO_[SU]INT to non-strict versions unnecessarily. Reviewed by: craig.topper Differential Revision: https://reviews.llvm.org/D71840
* [msan] Check qsort input.Evgenii Stepanov2019-12-232-0/+23
| | | | | | | | | | | | | | | | | | Summary: Qsort interceptor suppresses all checks by unpoisoning the data in the wrapper of a comparator function, and then unpoisoning the output array as well. This change adds an explicit run of the comparator on all elements of the input array to catch any sanitizer bugs. Reviewers: vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71780
* [msan] Intercept qsort, qsort_r.Evgenii Stepanov2019-12-233-0/+152
| | | | | | | | | | | | | | | Summary: This fixes qsort-related false positives with glibc-2.27. I'm not entirely sure why they did not show up with the earlier versions; the code seems similar enough. Reviewers: vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71740
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-2310-84/+146
| | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch moves some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Differential Revision: https://reviews.llvm.org/D68627
* MC: Ensure test only reads from the Inputs directoryDavid Blaikie2019-12-239-80/+80
|
* Fix LLVM tool --version build mode printing for MSVCReid Kleckner2019-12-231-1/+23
| | | | | | | | | | | | | | | LLVM tools such as llc print "DEBUG build" or "Optimized build" when passed --version. Before this change, this was implemented by checking for the __OPTIMIZE__ GCC macro. MSVC does not define this macro. For MSVC, control this behavior with _DEBUG instead. It doesn't have precisely the same meaning, but in most configurations, it will do the right thing. Fixes PR17752 Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D71817
* [lldb/Test] Disable TestSynchronous.test on Windows.Jonas Devlieghere2019-12-231-0/+1
| | | | | | The test was being skipped on the Windwos bot because it requires Python which was silently disabled because of a configuration issue. Now that the test runs, this fails as expected.
* Move from a long list of checkers to tablesSylvestre Ledru2019-12-231-384/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, the list isn't very useful. This change adds two tables. * The checkers * The aliases For each checkers, we provide extract info: * the severity. Taken from codechecker - https://github.com/Ericsson/codechecker/blob/master/config/checker_severity_map.json * if the checker has an autofix or not I used the cvs format for the table because: * it is easy * the data could be reused by other tools (we could move that into a separated / generated file at some point) Reviewers: alexfh, jdoerfert, jfb, lebedev.ri, Eugene.Zelenko Subscribers: dexonsmith, wuzish, nemanjai, kbarton, arphaman, lebedev.ri, whisperity, Eugene.Zelenko, JonasToth, JDevlieghere, xazax.hun, cfe-commits, #clang-tools-extra Tags: #clang Differential Revision: https://reviews.llvm.org/D36051
* [ELF] Don't suggest an alternative spelling for a symbol in a discarded sectionFangrui Song2019-12-232-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | For undef-not-suggest.test, we currently make redundant alternative spelling suggestions: ``` ld.lld: error: relocation refers to a discarded section: .text.foo >>> defined in a.o >>> section group signature: foo >>> prevailing definition is in a.o >>> referenced by a.o:(.rodata+0x0) >>> did you mean: >>> defined in: a.o ld.lld: error: relocation refers to a symbol in a discarded section: foo >>> defined in a.o >>> section group signature: foo >>> prevailing definition is in a.o >>> referenced by a.o:(.rodata+0x8) >>> did you mean: for >>> defined in: a.o ``` Reviewed By: grimar, ruiu Differential Revision: https://reviews.llvm.org/D71735
* [AMDGPU] Don't create MachinePointerInfos with an UndefValue pointerJay Foad2019-12-237-114/+91
| | | | | | | | | | | | | | | Summary: The only useful information the UndefValue conveys is the address space, which MachinePointerInfo can represent directly without referring to an IR value. Reviewers: arsenm, rampitec Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71838
* [RISCV][NFC] Fix use of missing attribute groups in testsLuís Marques2019-12-233-6/+6
|
* [PowerPC] NFC - fix the testcase bug of folding rlwinmczhengsz2019-12-231-7/+7
|
* [DAGCombine] visitEXTRACT_SUBVECTOR - 'little to big' ↵Sanjay Patel2019-12-239-176/+83
| | | | | | | | | | | | | | | | | | | extract_subvector(bitcast()) support This moves the X86 specific transform from rL364407 into DAGCombiner to generically handle 'little to big' cases (for example: extract_subvector(v2i64 bitcast(v16i8))). This allows us to remove both the x86 implementation and the aarch64 bitcast(extract_subvector(bitcast())) combine. Earlier patches that dealt with regressions initially exposed by this patch: rG5e5e99c041e4 rG0b38af89e2c0 Patch by: @RKSimon (Simon Pilgrim) Differential Revision: https://reviews.llvm.org/D63815
* [OPENMP50]Codegen for nontemporal clause.Alexey Bataev2019-12-2320-115/+339
| | | | | | | | | | | | | | | | Summary: Basic codegen for the declarations marked as nontemporal. Also, if the base declaration in the member expression is marked as nontemporal, lvalue for member decl access inherits nonteporal flag from the base lvalue. Reviewers: rjmccall, hfinkel, jdoerfert Subscribers: guansong, arphaman, caomhin, kkwli0, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71708
* [lldb] Remove DWARFUnit::AppendDIEsWithTagPavel Labath2019-12-233-24/+6
| | | | | | | This function is not very useful, as it's forcing a materialization of the returned DIEs, and calling it is not substantially simpler than just iterating over the DIEs manually. Delete it, and rewrite the single caller.
* [gn build] Port eca40066ebbLLVM GN Syncbot2019-12-232-1/+1
|
* [lldb/DWARF] Fix hostname-stripping logicPavel Labath2019-12-232-0/+51
| | | | | | | | | | | | | | This bit of code is trying to strip everything up to the first colon from all debug info paths, as dwarf2 recommends this syntax for storing the compilation host name. However, this code was too eager, and it ended up stripping the entire compilation directory, if it did not contain a forward slash (or a "x:\"). Normally this does not matter, as all absolute paths will contain one of these patterns, but this does not have to be the case in case the debug info is produced by "clang -fdebug-compilation-dir", which can end up producing a relative compilation directory with no slashes (this is one of the techniques for producing "relocatable" debug info).
* [Matrix] Use fmuladd for matrix.multiply if allowed.Florian Hahn2019-12-235-5/+301
| | | | | | | | | | | | | If the matrix.multiply calls have the contract fast math flag, we can use fmuladd. This als adds a command line option to force fmuladd generation. We can retire this option once there is a clang-level option. Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor Reviewed By: anemet Differential Revision: https://reviews.llvm.org/D70951
* [NFC] Move OptionUtils from Basic to DriverYaxun (Sam) Liu2019-12-235-7/+6
| | | | Differential Revision: https://reviews.llvm.org/D71802
* [Matrix] Add forward shape propagation and first shape aware lowerings.Florian Hahn2019-12-234-316/+670
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds infrastructure for forward shape propagation to LowerMatrixIntrinsics. It also updates the pass to make use of the shape information to break up larger vector operations and to eliminate unnecessary conversion operations between columnwise matrixes and flattened vectors: if shape information is available for an instruction, lower the operation to a set of instructions operating on columns. For example, a store of a matrix is broken down into separate stores for each column. For users that do not have shape information (e.g. because they do not yet support shape information aware lowering), we pack the result columns into a flat vector and update those users. It also adds shape aware lowering for the first non-intrinsic instruction: vector stores. Example: For %c = call <4 x double> @llvm.matrix.transpose(<4 x double> %a, i32 2, i32 2) store <4 x double> %c, <4 x double>* %Ptr We generate the code below without shape propagation. Note %9 which combines the columns of the transposed matrix into a flat vector. %split = shufflevector <4 x double> %a, <4 x double> undef, <2 x i32> <i32 0, i32 1> %split1 = shufflevector <4 x double> %a, <4 x double> undef, <2 x i32> <i32 2, i32 3> %1 = extractelement <2 x double> %split, i64 0 %2 = insertelement <2 x double> undef, double %1, i64 0 %3 = extractelement <2 x double> %split1, i64 0 %4 = insertelement <2 x double> %2, double %3, i64 1 %5 = extractelement <2 x double> %split, i64 1 %6 = insertelement <2 x double> undef, double %5, i64 0 %7 = extractelement <2 x double> %split1, i64 1 %8 = insertelement <2 x double> %6, double %7, i64 1 %9 = shufflevector <2 x double> %4, <2 x double> %8, <4 x i32> <i32 0, i32 1, i32 2, i32 3> store <4 x double> %9, <4 x double>* %Ptr With this patch, we propagate the 2x2 shape information from the transpose to the store and we generate the code below. Note that we store the columns directly and do not need an extra shuffle. %9 = bitcast <4 x double>* %Ptr to double* %10 = bitcast double* %9 to <2 x double>* store <2 x double> %4, <2 x double>* %10, align 8 %11 = getelementptr double, double* %9, i32 2 %12 = bitcast double* %11 to <2 x double>* store <2 x double> %8, <2 x double>* %12, align 8 Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor Reviewed By: anemet Differential Revision: https://reviews.llvm.org/D70897
* [lldb][NFC] Remove unused callback functionality from ClangASTContextRaphael Isemann2019-12-232-8/+0
|
* [OpenCL] Add atomic builtin functionsSven van Haastregt2019-12-232-2/+87
| | | | | | Add atomic builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt.
* [lldb][NFC] Simplify ClangExternalASTSourceCallbacksRaphael Isemann2019-12-234-182/+27
| | | | | | | | | | | | | | | This class is only used by the ClangASTContext so we might as well simplify this whole logic by just passing a ClangASTContext instead of a list of callbacks and a void* pointer. If we ever need this to support other classes then we can define some interface that ClangASTContext implements but for now this isn't needed. I also removed any code for m_callback_find_by_name as this was always a nullptr in LLDB and removed all overriden implementations that just redefined the default no-op implementation that the ExternalASTSource provides. Also removed the assert.h workarounds.
* [find_interesting_reviews.py] Add git blame output cacheKristof Beyls2019-12-231-14/+57
| | | | | | | | | | | | | The majority of the running time of this script tends to be spent in running git blame on source files touched by patches under review. By introducing a git blame output cache, some of the git blame commands don't have to re-run, and the blame information can be retrieved from a cache. I've observed that in a typical run matching patches available for review with potential reviewers, this speeds up the script's running time by a factor of about 2.5x.
* [lldb][NFC] Remove unused 'type' parameter in ↵Raphael Isemann2019-12-232-23/+6
| | | | | | ClangExpressionDeclMap::FindGlobalVariable We never pass something else than a nullptr as the 'type' so the related code in this function is never reached.
* [lldb][NFC] Remove wrong and unused ClangASTContext::CopyDecl methodRaphael Isemann2019-12-232-20/+0
|
* [lldb][NFC] Delete all 'else return ...' in CompilerDeclContext.cppRaphael Isemann2019-12-231-8/+4
|
* [lldb] Add sanity check to CreateDeclContext and fixed illformed ↵Raphael Isemann2019-12-233-2/+6
| | | | | | | | | | | | | | | | | | | | | CompilerContext in ClangExpressionDeclMap. This adds a check that the ClangASTContext actually fits to the DeclContext that we want to create a CompilerDeclContext for. If the ClangASTContext (and its associated ASTContext) does not fit to the DeclContext (that is, the DeclContext wasn't created by the ASTContext), all computations using this malformed CompilerDeclContext will yield unpredictable results. Also fixes the only place that actually hits this assert which is the construction of a CompilerDeclContext in ClangExpressionDeclMap where we pass an unrelated ASTContext instead of the ASTContext of the current expression. I had to revert my previous change to DWARFASTParserClangTests.cpp back to using the unsafe direct construction of CompilerDeclContext as this assert won't work if the DeclContext we pass isn't a valid DeclContext in the first place.
* [yaml2obj] - Allow using an arbitrary value for OSABI.Georgii Rymar2019-12-232-0/+14
| | | | | | | There was no way to set an unsupported or unknown OS ABI. With this patch it is possible to use any numeric value. Differential revision: https://reviews.llvm.org/D71765
* [yaml2obj] - Add support for ELFOSABI_LINUX.Georgii Rymar2019-12-232-21/+32
| | | | | | | ELFOSABI_LINUX is an alias for ELFOSABI_GNU. It is not that obvious probably. Differential revision: https://reviews.llvm.org/D71764
* [lldb] Don't process symlinks deep inside DWARFUnitPavel Labath2019-12-232-20/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: This code is handling debug info paths starting with /proc/self/cwd, which is one of the mechanisms people use to obtain "relocatable" debug info (the idea being that one starts the debugger with an appropriate cwd and things "just work"). Instead of resolving the symlinks inside DWARFUnit, we can do the same thing more elegantly by hooking into the existing Module path remapping code. Since llvm::DWARFUnit does not support any similar functionality, doing things this way is also a step towards unifying llvm and lldb dwarf parsers. Reviewers: JDevlieghere, aprantl, clayborg, jdoerfert Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71770
* [yaml2obj] - Add testing for OSABI field.Georgii Rymar2019-12-231-0/+317
| | | | | | | We have no such testing. This makes impossible to add support for new ELFOSABI_* tags. Differential revision: https://reviews.llvm.org/D71763
* [AArch64] [Windows] Use COFF stubs for calls to extern_weak functionsMartin Storsjö2019-12-237-25/+60
| | | | | | | | | | | | | | | | | | | As the extern_weak target might be missing, resolving to the absolute address zero, we can't use the normal direct PC-relative branch instructions (as that would result in relocations out of range). Improve the classifyGlobalFunctionReference method to set MO_DLLIMPORT/MO_COFFSTUB, and simplify the existing code in AArch64TargetLowering::LowerCall to use the return value from classifyGlobalFunctionReference for these cases. Add code in both AArch64FastISel and GlobalISel/IRTranslator to bail out for function calls to extern weak functions on windows, to let SelectionDAG handle them. This matches what was done for X86 in 6bf108d77a3c. Differential Revision: https://reviews.llvm.org/D71721
* [ARM] [Windows] Use COFF stubs for calls to extern_weak functionsMartin Storsjö2019-12-232-7/+12
| | | | | | | | | | | | | As the extern_weak target might be missing, resolving to the absolute address zero, we can't use the normal direct PC-relative branch instructions (as that would result in relocations out of range). Instead check the shouldAssumeDSOLocal method and load the address from a COFF stub. This matches what was done for X86 in 6bf108d77a3c. Differential Revision: https://reviews.llvm.org/D71720
* [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windowsMartin Storsjö2019-12-232-1/+12
| | | | | | | | | Since 6bf108d77a3c, we try to not mark extern_weak symbols as dso_local, to allow using COFF stubs for references to those symbols (as the symbol may be missing, resolving to an absolute address zero, outside of the current DSO). Differential Revision: https://reviews.llvm.org/D71716
* [llvm-readobj][test] - Stop using Inputs/trivial.obj.elf-x86-64.Georgii Rymar2019-12-236-114/+179
| | | | | | | | This rewrites a few tests to stop using the trivial.obj.elf-x86-64 precompiled object and removes it. Differential revision: https://reviews.llvm.org/D71662
* [lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cppPavel Labath2019-12-231-0/+1
|
* [lldb/lua] Fix bindings.test for lua-5.1Pavel Labath2019-12-231-1/+1
| | | | | string.format("%s", true) only works since lua-5.2. Make the print statement more portable.
* [lldb][NFC] Simplify ClangASTContext::GetTranslationUnitDeclRaphael Isemann2019-12-232-11/+3
| | | | | | | | | | | | | | | | | These two functions are just calling their equivalent function in ASTContext and implicitly convert the result to a DeclContext* (a parent class of TranslationUnitDecl). This leads to the absurd situation that we had to cast the result of GetTranslationUnitDecl to a TranslationUnitDecl*. The only reason we did this implicit conversion to the parent class was that the void* conversion for the CompilerDeclContext constructor was sound (which otherwise would receive a Decl* pointer when called with a TranslationUnitDecl*). Now that the CompilerDeclContext constructor is type safe we can properly implement these functions by actually returning the right type. Also deletes the static inconvenience method that was not used anywhere.
* [lldb] Add a SubsystemRAII that takes care of calling Initialize and ↵Raphael Isemann2019-12-2327-231/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Terminate in the unit tests Summary: Many of our tests need to initialize certain subsystems/plugins of LLDB such as `FileSystem` or `HostInfo` by calling their static `Initialize` functions before the test starts and then calling `::Terminate` after the test is done (in reverse order). This adds a lot of error-prone boilerplate code to our testing code. This patch adds a RAII called SubsystemRAII that ensures that we always call ::Initialize and then call ::Terminate after the test is done (and that the Terminate calls are always in the reverse order of the ::Initialize calls). It also gets rid of all of the boilerplate that we had for these calls. Per-fixture initialization is still not very nice with this approach as it would require some kind of static unique_ptr that gets manually assigned/reseted from the gtest SetUpTestCase/TearDownTestCase functions. Because of that I changed all per-fixture setup to now do per-test setup which can be done by just having the SubsystemRAII as a member of the test fixture. This change doesn't influence our normal test runtime as LIT anyway runs each test case separately (and the Initialize/Terminate calls are anyway not very expensive). It will however make running all tests in a single executable slightly slower. Reviewers: labath, JDevlieghere, martong, espindola, shafik Reviewed By: labath Subscribers: mgorny, rnkovacs, emaste, MaskRay, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71630
* [NFC] Style cleanupsShengchen Kan2019-12-233-51/+51
| | | | | | 1. Remove duplicate function for class name at the beginning of the comment. 2. Use auto where the type is already obvious from the context.
* [lldb][NFC] Document CompilerDeclContext constructorsRaphael Isemann2019-12-231-1/+7
|
* [lldb][NFC] Make CompilerDeclContext construction type safeRaphael Isemann2019-12-239-21/+25
| | | | | | | | | | | | | | | The CompilerDeclContext constructor takes a void* pointer which means that all callers of this constructor need to first explicitly convert all pointers to clang::DeclContext*. This causes that we for example can't just pass a TranslationUnitDecl* to the constructor without first casting it to its parent class (as it inherits from both Decl and DeclContext so the void* pointer is actually a Decl*). This patch introduces a utility function in the ClangASTContext which gets rid of the requirement to cast all pointers to clang::DeclContext. Also moves all constructor calls to use this function instead which is NFC (beside the change in DWARFASTParserClangTests.cpp).
* [Power9] Remove the PPCISD::XXREVERSE as it has completely the same ↵QingShan Zhang2019-12-235-26/+7
| | | | | | | | | semantics of ISD::BSWAP The custom node PPCISD::XXREVERSE has completely the same semantics of generic node ISD::BSWAP. We need to clean up it as we have the combine rules for bswap in the base class, while nothing for xxreverse. Differential Revision: https://reviews.llvm.org/D70657
* Fix case style warnings in DIBuilder. NFC.Simon Pilgrim2019-12-232-13/+13
|
* [SLP] Replace NeedToGather variable with enum.Dinar Temirbulatov2019-12-231-22/+34
|
* [NFC][Test][PowerPC] Add more tests for 'and mask'QingShan Zhang2019-12-232-22/+91
|
* [Concepts] Constrained partial specializations and function overloads.Saar Raz2019-12-2318-102/+1026
| | | | | | | Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads. Re-commit after fixing another crash (added regression test). Differential Revision: https://reviews.llvm.org/D41910
* [lldb/ScriptInterpreter] Remove can_reload which is always true (NFC)Jonas Devlieghere2019-12-227-26/+12
| | | | | | The `-r` option for `command script import` is there for legacy compatibility, however the can_reload flag is always set to true. This patch removes the flag and any code that relies on it being false.
* build: use `find_package(Python3)` rather than `PYTHON_HOME`Saleem Abdulrasool2019-12-221-0/+1
| | | | | | The behaviour of `PYTHON_HOME` can be emulated by setting `Python3_EXECUTABLE` to the absolute path instead of the custom variable now that we can find the python interpreter.
OpenPOWER on IntegriCloud