summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb][NFC] Move Clang-specific flags to ClangUserExpressionRaphael Isemann2019-08-303-19/+18
| | | | | | | | | LLVMUserExpression doesn't use these variables and they are all specific to Clang. Also removes m_const_object as this was actually never used by anyone (and Clang didn't report it as we assigned it in the constructor which seems to count as use). llvm-svn: 370440
* [ELF] Set `referenced` bit of Undefined created by BitcodeFileFangrui Song2019-08-303-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | D64136 and D65584, while fixing STB_WEAK issues and improving our compatibility with ld.bfd, can cause another STB_WEAK problem related to LTO: If %tundef.o has an undefined reference on f, and %tweakundef.o has a weak undefined reference on f, %tdef.o has a definition of f ``` ld.lld %tundef.o %tweakundef.o --start-lib %tdef.o --end-lib ``` 1) `%tundef.o` doesn't set the `referenced` bit. 2) `%weakundef.o` changes the binding from STB_GLOBAL to STB_WEAK 3) `%tdef.o` is not fetched because the binding is weak. Step (1) is incorrect. This patch sets the `referenced` bit of Undefined created by bitcode files. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D66992 llvm-svn: 370437
* [LLD] [COFF] Support merging resource object filesMartin Storsjo2019-08-3012-43/+477
| | | | | | | | | | | | | | | | | | | | | | | | Extend WindowsResourceParser to support using a ResourceSectionRef for loading resources from an object file. Only allow merging resource object files in mingw mode; keep the existing error on multiple resource objects in link mode. If there only is one resource object file and no .res resources, don't parse and recreate the .rsrc section, but just link it in without inspecting it. This allows users to produce any .rsrc section (outside of what the parser supports), just like before. (I don't have a specific need for this, but it reduces the risk of this new feature.) Separate out the .rsrc section chunks in InputFiles.cpp, and only include them in the list of section chunks to link if we've determined that there only was one single resource object. (We need to keep other chunks from those object files, as they can legitimately contain other sections as well, in addition to .rsrc section chunks.) Differential Revision: https://reviews.llvm.org/D66824 llvm-svn: 370436
* [WindowsResource] Remove use of global variables in WindowsResourceParserMartin Storsjo2019-08-302-70/+62
| | | | | | | | | | | | | | | | Instead of updating a global variable counter for the next index of strings and data blobs, pass along a reference to actual data/string vectors and let the TreeNode insertion methods add their data/strings to the vectors when a new entry is needed. Additionally, if the resource tree had duplicates, that were ignored with -force:multipleres in lld, we no longer store all versions of the duplicated resource data, now we only keep the one that actually ends up referenced. Differential Revision: https://reviews.llvm.org/D66823 llvm-svn: 370435
* [WindowsResource] Avoid duplicating the input filenames for each resource. NFC.Martin Storsjo2019-08-301-4/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D66821 llvm-svn: 370434
* [COFF] Add a ResourceSectionRef method for getting resource contentsMartin Storsjo2019-08-306-1/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like it already does for plain .res files. This requires providing the whole COFFObjectFile to ResourceSectionRef. This supports both object files and executables. For executables, the DataRVA field is used as is to look up the right section. For object files, ideally we would need to complete linking of them and fix up all relocations to know what the DataRVA field would end up being. In practice, the only thing that makes sense for an RVA field is an ADDR32NB relocation. Thus, find a relocation pointing at this field, verify that it has the expected type, locate the symbol it points at, look up the section the symbol points at, and read from the right offset in that section. This works both for GNU windres object files (which use one single .rsrc section, with all relocations against the base of the .rsrc section, with the original value of the DataRVA field being the offset of the data from the beginning of the .rsrc section) and cvtres object files (with two separate .rsrc$01 and .rsrc$02 sections, and one symbol per data entry, with the original pre-relocated DataRVA field being set to zero). Differential Revision: https://reviews.llvm.org/D66820 llvm-svn: 370433
* [MIPS GlobalISel] Lower uitofpPetar Avramovic2019-08-303-1/+493
| | | | | | | | Add custom lowering for G_UITOFP for MIPS32. Differential Revision: https://reviews.llvm.org/D66930 llvm-svn: 370432
* [MIPS GlobalISel] Lower fptouiPetar Avramovic2019-08-305-0/+536
| | | | | | | | | | Add lower for G_FPTOUI. Algorithm is similar to the SDAG version in TargetLowering::expandFP_TO_UINT. Lower G_FPTOUI for MIPS32. Differential Revision: https://reviews.llvm.org/D66929 llvm-svn: 370431
* [CodeGen] Fix lowering for returning the result of an extractvalueDan Gohman2019-08-302-1/+201
| | | | | | | | | | | | | | When the number of return values exceeds the number of registers available, SelectionDAGBuilder::visitRet transforms a function's return to use a pointer to a buffer to hold return values. When the returned value is an operator such as extractvalue, the value may have a non-zero result number. Add that number to the indexing when obtaining the values to store. This fixes https://bugs.llvm.org/show_bug.cgi?id=43132. Differential Revision: https://reviews.llvm.org/D66978 llvm-svn: 370430
* [clangd] Add distinct highlightings for static fields and methodsNathan Ridge2019-08-304-14/+33
| | | | | | | | | | | | | | Reviewers: hokein, ilya-biryukov, jvikstrom Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66828 llvm-svn: 370429
* [PowerPC][NFC] Use inline Subtarget->isPPC64()Jinsong Ji2019-08-301-7/+6
| | | | | | To be consistent with all the other instances. llvm-svn: 370428
* [PowerPC][NFC] Use -mtriple in RUN line, remove target triple in tls.llJinsong Ji2019-08-301-4/+4
| | | | | | To avoid confusion, especially when -mtriple are also added for PPC32. llvm-svn: 370427
* [PPC32] Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LOFangrui Song2019-08-302-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike ppc64, which has ADDISgotTprelHA+LDgotTprelL pairs, ppc32 just uses LDgotTprelL32, so it does not make lots of sense to use _LO without a paired _HA. Emit R_PPC_GOT_TPREL16 instead R_PPC_GOT_TPREL16_LO to match GCC, and get better linker relocation check. Note, R_PPC_GOT_TPREL16_{HA,LO} don't have good linker support: (a) lld does not support R_PPC_GOT_TPREL16_{HA,LO}. (b) Top of tree ld.bfd does not support R_PPC_GOT_REL16_HA Initial-Exec -> Local-Exec relaxation: // a.o addis 3, 3, tsd_tls@got@tprel@ha lwz 3, tsd_tls@got@tprel@l(3) add 3, 3, tsd_tls@tls // b.o .section .tdata,"awT"; .globl tsd_tls; tsd_tls: // ld/ld-new a.o b.o internal error, aborting at ../../bfd/elf32-ppc.c:7952 in ppc_elf_relocate_section Reviewed By: adalava Differential Revision: https://reviews.llvm.org/D66925 llvm-svn: 370426
* [clang-scan-deps] NFC, refactor the DependencyScanningWorker to use a consumerAlex Lorenz2019-08-303-43/+117
| | | | | | | | | | | to report the dependencies to the client This will allow the scanner to report modular dependencies to the consumer. This will also allow the scanner to accept regular cc1 clang invocations, e.g. in an implementation of a libclang C API for clang-scan-deps, that I will add follow-up patches for in the future. llvm-svn: 370425
* [X86] Explicitly list all the always trivially rematerializable instructions.Craig Topper2019-08-301-5/+40
| | | | | | | | | Add a default with an llvm_unreachable for anything we don't expect. This seems safer that just blindly returning true for anything missing from the switch. llvm-svn: 370424
* DebugInfo: add CodeView register mapping for ARM NTSaleem Abdulrasool2019-08-301-0/+121
| | | | | | | | Add the core registers and NEON registers mapping to the CodeView register ID. This is sufficient to compile a basic C program with debug info using CodeView debug info. llvm-svn: 370423
* [Modules] Make ReadModuleMapFileBlock errors reliableBruno Cardoso Lopes2019-08-292-9/+11
| | | | | | | | | | | | | | | | | | This prevents a crash when an error should be emitted instead. During implicit module builds, there are cases where ReadASTCore is called with ImportedBy set to nullptr, which breaks expectations in ReadModuleMapFileBlock, leading to crashes. Fix this by improving ReadModuleMapFileBlock to handle ImportedBy correctly. This only happens non deterministically in the wild, when the underlying file system changes while concurrent compiler invocations use implicit modules, forcing rebuilds which see an inconsistent filesystem state. That said, there's no much to do w.r.t. writing tests here. rdar://problem/48828801 llvm-svn: 370422
* [CMake][Fuchsia] Enable experimental pass manager by defaultPetr Hosek2019-08-292-0/+2
| | | | | | | | We plan on using experimental new pass manager for Fuchsia toolchain. Differential Revision: https://reviews.llvm.org/D58214 llvm-svn: 370421
* [clang-scan-deps] reuse the file manager across invocations ofAlex Lorenz2019-08-2911-8/+101
| | | | | | | | | | | | | | | | the dependency scanner on a single worker thread This behavior can be controlled using the new `-reuse-filemanager` clang-scan-deps option. By default the file manager is reused. The added test/ClangScanDeps/symlink.cpp is able to pass with the reused filemanager after the related FileEntryRef changes landed earlier. The test test/ClangScanDeps/subframework_header_dir_symlink.m still fails when the file manager is reused (I run the FileCheck with not to make it PASS). I will address this in a follow-up patch that improves the DirectoryEntry name modelling in the FileManager. llvm-svn: 370420
* Fix silent wrong-code bugs and crashes with designated initialization.Richard Smith2019-08-293-176/+388
| | | | | | | | | | | | | | | | | | | | | We failed to correctly handle the 'holes' left behind by designated initializers in VerifyOnly mode. This would result in us thinking that a designated initialization would be valid, only to find that it is not actually valid when we come to build it. In a +Asserts build, that would assert, and in a -Asserts build, that would silently lose some part of the initialization or crash. With this change, when an InitListExpr contains any designators, we now always build a structured list so that we can track the locations of the 'holes' that we need to go back and fill in. We could in principle do better: we only need the structured form if there is a designator that jumps backwards (and can otherwise check for the holes as we progress through the initializer list), but dealing with that turns out to be rather complicated, so it's not done as part of this patch. llvm-svn: 370419
* Refactor InitListChecker to check only a single (explicit) initializerRichard Smith2019-08-292-48/+15
| | | | | | | | | | list, rather than recursively checking multiple lists in C. This simplification is in preparation for making InitListChecker maintain more state that's specific to the explicit initializer list, particularly when handling designated initialization. llvm-svn: 370418
* Refactor InitListChecker to make it a bit clearer that hasError is onlyRichard Smith2019-08-291-44/+36
| | | | | | | | | | set to true in VerifyOnly mode in cases where it's also set to true when actually building the initializer list. Add FIXMEs for the two cases where that's not true. No functionality change intended. llvm-svn: 370417
* [WebAssembly] Implement NO_STRIPDan Gohman2019-08-297-7/+26
| | | | | | | | | | | | | This patch implements support for the NO_STRIP flag, which will allow __attribute__((used)) to be implemented. This accompanies https://reviews.llvm.org/D62542, which moves to setting the NO_STRIP flag, and will continue to set EXPORTED for Emscripten targets for compatibility. Differential Revision: https://reviews.llvm.org/D66968 llvm-svn: 370416
* [WebAssembly] Make __attribute__((used)) not imply export.Dan Gohman2019-08-2912-18/+39
| | | | | | | | | | Add an WASM_SYMBOL_NO_STRIP flag, so that __attribute__((used)) doesn't need to imply exporting. When targeting Emscripten, have WASM_SYMBOL_NO_STRIP imply exporting. Differential Revision: https://reviews.llvm.org/D62542 llvm-svn: 370415
* [Tests] Precommit a few cases where we're missing oppurtunities for block ↵Philip Reames2019-08-291-0/+66
| | | | | | local simplications off assumes. llvm-svn: 370414
* [lit] Print exit code in for unresolved (lldb)tests.Jonas Devlieghere2019-08-291-2/+2
| | | | | | | | | | | | A test is marked unresolved when we're unable to find PASSED or FAILED in the dotest output. Usually this is because we crashed and when that happens the exit code can give a clue as to why. This patch adds the exit code to the lit output to make it easier to investigate those issues. Differential revision: https://reviews.llvm.org/D66975 llvm-svn: 370413
* [NFC] Test commit - sorted headers.Nandor Licker2019-08-291-1/+1
| | | | llvm-svn: 370412
* [PowerPC] Support extended mnemonics mffprwz etc.Jinsong Ji2019-08-2922-109/+276
| | | | | | | | | | | | | | | | | | | | | | Summary: Reported in https://github.com/opencv/opencv/issues/15413. We have serveral extended mnemonics for Move To/From Vector-Scalar Register Instructions eg: mffprd,mtfprd etc. We only support one of them, this patch add the others. Reviewers: nemanjai, steven.zhang, hfinkel, #powerpc Reviewed By: hfinkel Subscribers: wuzish, qcolombet, hiraditya, kbarton, MaskRay, shchenz, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66963 llvm-svn: 370411
* [AArch64][GlobalISel] Select arithmetic extended register patternsJessica Paquette2019-08-295-41/+906
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches GISel to select patterns which fold an extend plus optional shift into the addressing mode. In particular, adds and subs. Factor out the arith extended register ComplexPatterns in AArch64InstrFormats.td and create GISel equivalents. Add some equivalent functions to the ones in AArch64ISelDAGToDAG: - `selectArithExtendedRegister` - `narrowExtendRegIfNeeded` - `getExtendTypeForInst` `getExtendTypeForInst` includes the checks for loads and stores. This will be used for WRO addressing modes in loads + stores. Teach selectCopy to properly handle subregister copies on the same bank in order to support `narrowExtendRegIfNeeded`. The extended register must be a GPR32, so we need to support same-bank subregister copies. Fix a bug in getSubRegForClass which would cause registers on things like GPR32common to end up getting ssub. Just change the check to look for FPR32 rather than GPR32. For tests: - Add select-arith-extended-reg.mir - Update addsub_ext.ll to include GlobalISel checks Differential Revision: https://reviews.llvm.org/D66835 llvm-svn: 370410
* [X86] Don't emit unreachable stack adjustmentsReid Kleckner2019-08-293-2/+129
| | | | | | | | | | | | | | | | Summary: This is a minor improvement on our past attempts to do this. Fixes PR43155. Reviewers: hans Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66905 llvm-svn: 370409
* Allow '@' to appear in x86 mingw symbolsReid Kleckner2019-08-292-0/+21
| | | | | | | | | | | | | | | | | Summary: There is no reason to differ in assembler behavior here between -msvc and -gnu targets. Without this setting, the text after the '@' is interpreted as a symbol variable, like foo@IMGREL. Reviewers: mstorsjo Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66974 llvm-svn: 370408
* [InstCombine] add possible bswap as widening shuffle test; NFCSanjay Patel2019-08-291-2/+13
| | | | | | Goes with the proposal in D66965. llvm-svn: 370407
* [CFG] Fix CFG for statement-expressions in return values.Artem Dergachev2019-08-293-4/+61
| | | | | | | | | | | We're building the CFG from bottom to top, so when the return-value expression has a non-trivial CFG on its own, we need to continue building from the entry to the return-value expression CFG rather than from the block to which we've just appended the return statement. Fixes a false positive warning "control may reach end of non-void function". llvm-svn: 370406
* Fix the build for MSVC builds using M_PIReid Kleckner2019-08-291-0/+7
| | | | llvm-svn: 370405
* [X86][SSE] combinePMULDQ - pmuldq(x, 0) -> zero vector (PR43159)Simon Pilgrim2019-08-292-3/+120
| | | | | | ISD::isBuildVectorAllZeros permits undef elements to be present, which means we can't return it as a zero vector. PMULDQ/PMULUDQ is an extending multiply so a multiply by zero of the lower 32-bits should result in a zero 64-bit element. llvm-svn: 370404
* [ASan] Version mismatch check follow-upJulian Lettner2019-08-291-2/+2
| | | | | | | | | | | Follow-up for: [ASan] Make insertion of version mismatch guard configurable 3ae9b9d5e40d1d9bdea1fd8e6fca322df920754a This tiny change makes sure that this test passes on our internal bots as well. llvm-svn: 370403
* AMDGPU/GlobalISel: Legalize sin/cosMatt Arsenault2019-08-294-0/+1125
| | | | llvm-svn: 370402
* Avoid crash when dumping NULL Type as JSON.Aaron Ballman2019-08-293-1/+82
| | | | | | Patch by Bert Belder. llvm-svn: 370401
* Remove `FileManager::invalidateCache` as it has no callers anymore. NFC.Volodymyr Sapsai2019-08-292-17/+0
| | | | llvm-svn: 370400
* [InstCombine] reduce duplicated code; NFCSanjay Patel2019-08-291-10/+13
| | | | llvm-svn: 370399
* Revert [MBP] Disable aggressive loop rotate in plain modeJordan Rupprecht2019-08-2958-3251/+3533
| | | | | | | | This reverts r369664 (git commit 51f48295cbe8fa3a44db263b528dd9f7bae7bf9a) It causes many benchmark regressions, internally and in llvm's benchmark suite. llvm-svn: 370398
* Revert enabling MemorySSA.Alina Sbirlea2019-08-296-53/+38
| | | | | | | | Breaks sanitizers bots. Differential Revision: https://reviews.llvm.org/D58311 llvm-svn: 370397
* [DependenceInfo] Compute WAR dependence info using ISL kills. NFC.Michael Kruse2019-08-291-114/+16
| | | | | | | | | | | | | | | When reading code of Dependences::calculateDependences, I noticed that WAR is computed specifically by buildWAR. Given ISL now supports "kills" in approximate dataflow analysis, this patch takes advantage of it. This patch also cleans up a couple lines redundant codes. Patch by bin.narwal <bin.narwal@gmail.com> Differential Revision: https://reviews.llvm.org/D66741 llvm-svn: 370396
* [lldb][NFC] Document options parameter in ClangUserExpression constructorRaphael Isemann2019-08-291-0/+3
| | | | | | Somehow this option was only documented in the swift branch. llvm-svn: 370395
* [test] Fix various module cache bugs and inconsistenciesJonas Devlieghere2019-08-2916-30/+86
| | | | | | | | | | | | | | | | | Currently, lit tests don't set neither the module cache for building inferiors nor the module cache used by lldb when running tests. Furthermore, we have several places where we rely on the path to the module cache being always the same, rather than passing the correct value around. This makes it hard to specify a different module cache path when debugging a a test. This patch reworks how we determine and pass around the module cache paths and fixes the omission on the lit side. It also adds a sanity check to the lit and dotest suites. Differential revision: https://reviews.llvm.org/D66966 llvm-svn: 370394
* [X86] Remove what little support we had for MPXCraig Topper2019-08-2914-64/+39
| | | | | | | | | | | | | | | -Deprecate -mmpx and -mno-mpx command line options -Remove CPUID detection of mpx for -march=native -Remove MPX from all CPUs -Remove MPX preprocessor define I've left the "mpx" string in the backend so we don't fail on old IR, but its not connected to anything. gcc has also deprecated these command line options. https://www.phoronix.com/scan.php?page=news_item&px=GCC-Patch-To-Drop-MPX Differential Revision: https://reviews.llvm.org/D66669 llvm-svn: 370393
* GlobalISel: Don't compute known bits for non-integral GEPMatt Arsenault2019-08-291-2/+7
| | | | llvm-svn: 370392
* [LoopUnrollAndJam] Use Lazy strategy for DTU.Florian Hahn2019-08-291-2/+4
| | | | | | | | | | | | | We can also apply the earlier updates to the lazy DTU, instead of applying them directly. Reviewers: kuhar, brzycki, asbirlea, SjoerdMeijer Reviewed By: brzycki, asbirlea, SjoerdMeijer Differential Revision: https://reviews.llvm.org/D66918 llvm-svn: 370391
* [cmake] enable x86 libfuzzer on WindowsMatthew G McGovern2019-08-291-0/+2
| | | | | | | | - recent commit https://reviews.llvm.org/D66433 enabled libfuzzer to build on windows, this just enables the option to build as part of the the regular build. llvm-svn: 370390
* GlobalISel: Add maskedValueIsZero and signBitIsZero to known bitsMatt Arsenault2019-08-293-0/+33
| | | | | | | I dropped the DemandedElts since it seems to be missing from some of the new interfaces, but not others. llvm-svn: 370389
OpenPOWER on IntegriCloud