summaryrefslogtreecommitdiffstats
path: root/llvm/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* gn build: Merge r363444Nico Weber2019-06-161-0/+1
| | | | llvm-svn: 363505
* UpdateTestChecks: Consider .section as end of function for AMDGPUMatt Arsenault2019-06-141-1/+1
| | | | | | | | Kernels seem to go directly to a section switch instead of emitting .Lfunc_end. This fixes including all of the kernel metadata in the check lines, which is undesirable most of the time. llvm-svn: 363452
* gn build: Add NVPTX targetNico Weber2019-06-149-4/+167
| | | | | | | | | | | | | | | | | | | The NVPTX target is a bit unusual in that it's the only target without a disassembler, and one of three targets without an asm parser (and the first one of those three in the gn build). NVPTX doesn't have those because it's not a binary format. The CMake build checks for the existence of {AsmParser,Disassembler}/CMakeLists.txt when setting LLVM_ENUM_ASM_PARSERS / LLVM_ENUM_DISASSEBLERS (http://llvm-cs.pcc.me.uk/CMakeLists.txt#744). The GN build doesn't want to hit the disk for things like this, so instead I'm adding explicit `targets_with_asm_parsers` and `targets_with_disassemblers` lists. Since both are needed rarely, they are defined in their own gni files. Differential Revision: https://reviews.llvm.org/D63210 llvm-svn: 363437
* gn build: Simplify Target build filesNico Weber2019-06-1421-159/+73
| | | | | | | | | | | | | | | | Now that the cycle between MCTargetDesc and TargetInfo is gone (see revisions 360709 360718 360722 360724 360726 360731 360733 360735 360736), remove the dependency from TargetInfo on MCTargetDesc:tablegen. In most targets, this makes MCTargetDesc:tablegen have just a single use, so inline it there. For AArch64, ARM, and RISCV there's still a similar cycle between MCTargetDesc and Utils, so the MCTargetDesc:tablegen indirection is still needed there. Differential Revision: https://reviews.llvm.org/D63200 llvm-svn: 363436
* [lit] Fix UnicodeEncodeError when test commands contain non-ASCII charsMichal Gorny2019-06-143-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that the bash script written by lit TestRunner is open with UTF-8 encoding when using Python 3. Otherwise, attempt to write non-ASCII characters causes UnicodeEncodeError. This happened e.g. with the following LLD test: UNRESOLVED: lld :: ELF/format-binary-non-ascii.s (657 of 2119) ******************** TEST 'lld :: ELF/format-binary-non-ascii.s' FAILED ******************** Exception during script execution: Traceback (most recent call last): File "/home/mgorny/llvm-project/llvm/utils/lit/lit/worker.py", line 63, in _execute_test result = test.config.test_format.execute(test, lit_config) File "/home/mgorny/llvm-project/llvm/utils/lit/lit/formats/shtest.py", line 25, in execute self.execute_external) File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1644, in executeShTest res = _runShTest(test, litConfig, useExternalSh, script, tmpBase) File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1590, in _runShTest res = executeScript(test, litConfig, tmpBase, script, execdir) File "/home/mgorny/llvm-project/llvm/utils/lit/lit/TestRunner.py", line 1157, in executeScript f.write('{ ' + '; } &&\n{ '.join(commands) + '; }') UnicodeEncodeError: 'ascii' codec can't encode character '\xa3' in position 274: ordinal not in range(128) Differential Revision: https://reviews.llvm.org/D63254 llvm-svn: 363388
* Revert r363298 "[lit] Disable test on darwin when building shared libs."Nico Weber2019-06-141-2/+0
| | | | | | It broke running check-lld on mac, see https://reviews.llvm.org/D61697 llvm-svn: 363379
* gn build: Merge r363376Nico Weber2019-06-142-7/+9
| | | | llvm-svn: 363378
* gn build: Merge r363204 (clang-scan-deps)Nico Weber2019-06-142-0/+21
| | | | llvm-svn: 363353
* [X86Disassembler] Unify the EVEX and VEX code in emitContextTable. Merge the ↵Craig Topper2019-06-131-51/+23
| | | | | | | | | | ATTR_VEXL/ATTR_EVEXL bits. NFCI Merging the two bits shrinks the context table from 16384 bytes to 8192 bytes. Remove the ATTRIBUTE_BITS macro and just create an enum directly. Then fix the ATTR_max define to be 8192 to reflect the table size so we stop hardcoding it separately. llvm-svn: 363330
* gn build: Merge r363242Nico Weber2019-06-132-9/+7
| | | | llvm-svn: 363324
* [lit] Disable test on darwin when building shared libs.Don Hinton2019-06-131-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This test fails to link shared libraries because tries to run a copied version of clang-check to see if the mock version of libcxx in the same directory can be loaded dynamically. Since the test is specifically designed not to look in the default just-built lib directory, it must be disabled when building with BUILD_SHARED_LIBS=ON. Currently only disabling it on Darwin and basing it on the enable_shared flag. Reviewed By: ilya-biryukov Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61697 llvm-svn: 363298
* Improve reduction intrinsics by overloading result value.Sander de Smalen2019-06-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the mechanism from D62995 to strengthen the definitions of the reduction intrinsics by letting the scalar result/accumulator type be overloaded from the vector element type. For example: ; The LLVM LangRef specifies that the scalar result must equal the ; vector element type, but this is not checked/enforced by LLVM. declare i32 @llvm.experimental.vector.reduce.or.i32.v4i32(<4 x i32> %a) This patch changes that into: declare i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32> %a) Which has the type-constraint more explicit and causes LLVM to check the result type with the vector element type. Reviewers: RKSimon, arsenm, rnk, greened, aemerson Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D62996 llvm-svn: 363240
* [IntrinsicEmitter] Extend argument overloading with forward references.Sander de Smalen2019-06-132-23/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the mechanism to overload intrinsic arguments by using either backward or forward references to the overloadable arguments. In for example: def int_something : Intrinsic<[LLVMPointerToElt<0>], [llvm_anyvector_ty], []>; LLVMPointerToElt<0> is a forward reference to the overloadable operand of type 'llvm_anyvector_ty' and would allow intrinsics such as: declare i32* @llvm.something.v4i32(<4 x i32>); declare i64* @llvm.something.v2i64(<2 x i64>); where the result pointer type is deduced from the element type of the first argument. If the returned pointer is not a pointer to the element type, LLVM will give an error: Intrinsic has incorrect return type! i64* (<4 x i32>)* @llvm.something.v4i32 Reviewers: RKSimon, arsenm, rnk, greened Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D62995 llvm-svn: 363233
* gn build: Add SystemZ targetNico Weber2019-06-127-1/+194
| | | | llvm-svn: 363170
* gn build: Add Mips targetNico Weber2019-06-127-1/+253
| | | | llvm-svn: 363159
* gn build: add RISCV targetNico Weber2019-06-127-0/+234
| | | | | | | | Patch from David L. Jones <dlj@google.com>, with minor tweaks by me. Differential Revision: https://reviews.llvm.org/D61821 llvm-svn: 363154
* gn build: Merge r363122Nico Weber2019-06-121-0/+1
| | | | llvm-svn: 363152
* Share /machine: handling code with llvm-cvtres tooNico Weber2019-06-121-0/+1
| | | | | | | | | | | | | | r363016 let lld-link and llvm-lib share the /machine: parsing code. This lets llvm-cvtres share it as well. Making llvm-cvtres depend on llvm-lib seemed a bit strange (it doesn't need llvm-lib's dependencies on BinaryFormat and BitReader) and I couldn't find a good place to put this code. Since it's just a few lines, put it in lib/Object for now. Differential Revision: https://reviews.llvm.org/D63120 llvm-svn: 363144
* lld-link: Reject more than one resource .obj fileNico Weber2019-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users are exepcted to pass all .res files to the linker, which then merges all the resource in all .res files into a tree structure and then converts the final tree structure to a .obj file with .rsrc$01 and .rsrc$02 sections and then links that. If the user instead passes several .obj files containing such resources, the correct thing to do would be to have custom code to merge the trees in the resource sections instead of doing normal section merging -- but link.exe rejects if multiple resource obj files are passed in with LNK4078, so let lld-link do that too instead of silently writing broken .rsrc sections in that case. The only real way to run into this is if users manually convert .res files to .obj files by running cvtres and then handing the resulting .obj files to lld-link instead, which in practice likely never happens. (lld-link is slightly stricter than link.exe now: If link.exe is passed one .obj file created by cvtres, and a .res file, for some reason it just emits a warning instead of an error and outputs strange looking data. lld-link now errors out on mixed input like this.) One way users could accidentally run into this is the following scenario: If a .res file is passed to lib.exe, then lib.exe calls cvtres.exe on the .res file before putting it in the output .lib. (llvm-lib currently doesn't do this.) link.exe's /wholearchive seems to only add obj files referenced from the static library index, but lld-link current really adds all files in the archive. So if lld-link /wholearchive is used with .lib files produced by lib.exe and .res files were among the files handed to lib.exe, we previously silently produced invalid output, but now we error out. link.exe's /wholearchive semantics on the other hand mean that it wouldn't load the resource object files from the .lib file at all. Since this scenario is probably still an unlikely corner case, the difference in behavior here seems fine -- and lld-link might have to change to use link.exe's /wholearchive semantics in the future anyways. Vaguely related to PR42180. Differential Revision: https://reviews.llvm.org/D63109 llvm-svn: 363078
* Revert CMake: Make most target symbols hidden by defaultTom Stellard2019-06-111-20/+0
| | | | | | | | | | | | | | | This reverts r362990 (git commit 374571301dc8e9bc9fdd1d70f86015de198673bd) This was causing linker warnings on Darwin: ld: warning: direct access in function 'llvm::initializeEvexToVexInstPassPass(llvm::PassRegistry&)' from file '../../lib/libLLVMX86CodeGen.a(X86EvexToVex.cpp.o)' to global weak symbol 'void std::__1::__call_once_proxy<std::__1::tuple<void* (&)(llvm::PassRegistry&), std::__1::reference_wrapper<llvm::PassRegistry>&&> >(void*)' from file '../../lib/libLLVMCore.a(Verifier.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. llvm-svn: 363028
* gn build: Merge r362939Nico Weber2019-06-112-0/+2
| | | | llvm-svn: 363020
* gn build: Merge r362972Nico Weber2019-06-111-0/+1
| | | | llvm-svn: 363019
* CMake: Make most target symbols hidden by defaultTom Stellard2019-06-101-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF this change makes all symbols in the target specific libraries hidden by default. A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these libraries public, which is mainly needed for the definitions of the LLVMInitialize* functions. This patch reduces the number of public symbols in libLLVM.so by about 25%. This should improve load times for the dynamic library and also make abi checker tools, like abidiff require less memory when analyzing libLLVM.so One side-effect of this change is that for builds with LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that access symbols that are no longer public will need to be statically linked. Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1): nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l 36221 nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l 26278 Reviewers: chandlerc, beanz, mgorny, rnk, hans Reviewed By: rnk, hans Subscribers: Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D54439 llvm-svn: 362990
* [RISCV] Replace map with set in getReqFeaturesSameer AbuAsal2019-06-101-9/+7
| | | | | | | | | | | | | | | | | | | | Summary: Use a set in getReqFeatures() in RISCVCompressInstEmitter instead of a map because the index we save is not needed. This also fixes bug 41666. Reviewers: llvm-commits, apazos, asb, nickdesaulniers Reviewed By: asb Subscribers: Jim, nickdesaulniers, rbar, johnrusso, simoncook, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna Tags: #llvm Differential Revision: https://reviews.llvm.org/D61412 llvm-svn: 362968
* gn build: Merge r362913Nico Weber2019-06-101-1/+0
| | | | llvm-svn: 362932
* gn build: Merge r362857Nico Weber2019-06-081-0/+1
| | | | llvm-svn: 362864
* Visualizer for APInt and remove obsolete visualizerMike Spertus2019-06-081-14/+5
| | | | | | | | | Visualizer for the simple case of APInt (uints < 2^64) as will be required for Clang ConstantArrayType visualizer. Also, removed obsolete VS2013 SmallVectorVisualizer as VS2013 is no longer supported. llvm-svn: 362860
* Fix string literals to avoid deprecation warnings in regexp patternsAdrian McCarthy2019-06-071-3/+3
| | | | | | | | | | | | | In LLDB, where tests run with the debug version of Python, we get a series of deprecation warnings because escape sequences like `\(` are being treated as part of the string literal rather than an escape for the regexp pattern. NFC intended. Differential Revision: https://reviews.llvm.org/D62882 llvm-svn: 362846
* Build with _XOPEN_SOURCE defined on AIXDavid Tenty2019-06-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open and POSIX compatibility mode, to work around stray macros and other bugs in the headers provided by the system and build compiler. This patch adds the config to cmake to build with _XOPEN_SOURCE defined on AIX with a few exceptions. Google Test internals require access to platform specific thread info constructs on AIX so in that case we build with _ALL_SOURCE defined instead. Libclang also uses header which needs _ALL_SOURCE on AIX so we leave that as is as well. We also add building on AIX with the large file API and doing CMake header checks with X/OPEN definitions so the results are consistent with the environment that will be present in the build. Reviewers: hubert.reinterpretcast, xingxue, andusy Reviewed By: hubert.reinterpretcast Subscribers: mgorny, jsji, cfe-commits, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62533 llvm-svn: 362808
* llvm-lib: Disallow mixing object files with different machine typesNico Weber2019-06-071-0/+1
| | | | | | | | | | | | | | | lib.exe doesn't allow creating .lib files with object files that have differing machine types. Update llvm-lib to match. The motivation is to make it possible to infer the machine type of a .lib file in lld, so that it can warn when e.g. a 32-bit .lib file is passed to a 64-bit link (PR38965). Fixes PR38782. Differential Revision: https://reviews.llvm.org/D62913 llvm-svn: 362798
* gn build: Merge r362766Nico Weber2019-06-071-0/+1
| | | | llvm-svn: 362796
* gn build: Merge r362774Nico Weber2019-06-071-0/+1
| | | | llvm-svn: 362795
* gn build: Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`Nico Weber2019-06-071-1/+1
| | | | llvm-svn: 362794
* gn build: Merge r362685Nico Weber2019-06-061-0/+1
| | | | llvm-svn: 362719
* gn build: Add new tidy checks to gn filesIlya Biryukov2019-06-061-0/+2
| | | | | | The checks were added in r362673 and r362672. llvm-svn: 362709
* Allow target to handle STRICT floating-point nodesUlrich Weigand2019-06-053-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ISD::STRICT_ nodes used to implement the constrained floating-point intrinsics are currently never passed to the target back-end, which makes it impossible to handle them correctly (e.g. mark instructions are depending on a floating-point status and control register, or mark instructions as possibly trapping). This patch allows the target to use setOperationAction to switch the action on ISD::STRICT_ nodes to Legal. If this is done, the SelectionDAG common code will stop converting the STRICT nodes to regular floating-point nodes, but instead pass the STRICT nodes to the target using normal SelectionDAG matching rules. To avoid having the back-end duplicate all the floating-point instruction patterns to handle both strict and non-strict variants, we make the MI codegen explicitly aware of the floating-point exceptions by introducing two new concepts: - A new MCID flag "mayRaiseFPException" that the target should set on any instruction that possibly can raise FP exception according to the architecture definition. - A new MI flag FPExcept that CodeGen/SelectionDAG will set on any MI instruction resulting from expansion of any constrained FP intrinsic. Any MI instruction that is *both* marked as mayRaiseFPException *and* FPExcept then needs to be considered as raising exceptions by MI-level codegen (e.g. scheduling). Setting those two new flags is straightforward. The mayRaiseFPException flag is simply set via TableGen by marking all relevant instruction patterns in the .td files. The FPExcept flag is set in SDNodeFlags when creating the STRICT_ nodes in the SelectionDAG, and gets inherited in the MachineSDNode nodes created from it during instruction selection. The flag is then transfered to an MIFlag when creating the MI from the MachineSDNode. This is handled just like fast-math flags like no-nans are handled today. This patch includes both common code changes required to implement the new features, and the SystemZ implementation. Reviewed By: andrew.w.kaylor Differential Revision: https://reviews.llvm.org/D55506 llvm-svn: 362663
* UpdateTestChecks: hexagon supportRoman Lebedev2019-06-051-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These tests are being affected by an upcoming patch, so having an understandable (autogenerated) diff is helpful. This target, again, prefers `-march`: ``` llvm/test/CodeGen/Hexagon$ grep -r triple | wc -l 467 llvm/test/CodeGen/Hexagon$ grep -r march | wc -l 1167 ``` Reviewers: RKSimon, kparzysz Reviewed By: kparzysz Subscribers: xbolva00, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62867 llvm-svn: 362605
* gn build: Merge r362578Nico Weber2019-06-051-0/+1
| | | | llvm-svn: 362598
* svn propset svn:executable on utils/prepare-code-coverage-artifact.pyNico Weber2019-06-041-0/+0
| | | | llvm-svn: 362561
* gn build: Merge r362459Nico Weber2019-06-042-0/+2
| | | | llvm-svn: 362498
* gn build: Merge r361896.Peter Collingbourne2019-06-032-0/+20
| | | | llvm-svn: 362445
* gn build: Merge r362371Nico Weber2019-06-033-0/+10
| | | | llvm-svn: 362433
* gn build: Merge r362352Nico Weber2019-06-031-0/+1
| | | | llvm-svn: 362428
* [TableGen] Fix std::array initializer to avoid warnings with older tool ↵Mikael Holmen2019-06-031-1/+1
| | | | | | | | | | | | | chains. NFC A std::array is implemented as a template with an array inside a struct. Older versions of clang, like 3.6, require an extra set of curly braces around std::array initializations to avoid warnings. The C++ language was changed regarding this by CWG 1270. So more modern tool chains does not complain even if leaving out one level of braces. llvm-svn: 362360
* Update MSVC Visualizer to reflect new variadic PointerUnionMike Spertus2019-06-021-73/+36
| | | | | | | | This changed updates the MSVC Visualizer to work with the recent change of PointerUnion into a variadic template. As an extra bonus, we fix some bit rot in the SmallPtrSet visualizer as well llvm-svn: 362345
* [X86] Make the X86FoldTablesEmitter functional again. Fix the spacing in the ↵Craig Topper2019-06-011-24/+37
| | | | | | | | | output to make it easier to diff. Fix a few other formatting issues in the manual table. And remove some old FIXMEs. llvm-svn: 362287
* [UpdateTestChecks] Add support for -march=r600 to match existing ↵Simon Pilgrim2019-05-311-0/+1
| | | | | | -march=amdgcn support llvm-svn: 362228
* gn build: Merge r362160Nico Weber2019-05-311-0/+1
| | | | llvm-svn: 362223
* gn build: Merge r362196Nico Weber2019-05-311-0/+2
| | | | llvm-svn: 362222
* gn build: Merge r362190Nico Weber2019-05-311-0/+2
| | | | llvm-svn: 362221
OpenPOWER on IntegriCloud