summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [LLD][ELF] - Support discarding .dynstr section.George Rimar2018-12-103-8/+12
| | | | | | | | | This is a part of https://bugs.llvm.org/show_bug.cgi?id=39810. The patch allows discarding the .dynstr section using linker script. Differential revision: https://reviews.llvm.org/D55215 llvm-svn: 348746
* Add interceptors for the sha2(3) from NetBSDKamil Rytarowski2018-12-105-0/+334
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: SHA224_Init, SHA224_Update, SHA224_Final, SHA224_End, SHA224_File, SHA224_FileChunk, SHA224_Data, SHA256_Init, SHA256_Update, SHA256_Final, SHA256_End, SHA256_File, SHA256_FileChunk, SHA256_Data, SHA384_Init, SHA384_Update, SHA384_Final, SHA384_End, SHA384_File, SHA384_FileChunk, SHA384_Data, SHA512_Init, SHA512_Update, SHA512_Final, SHA512_End, SHA512_File, SHA512_FileChunk, SHA512_Data – calculates the NIST Secure Hash Standard (version 2) Add tests for new interceptors. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54987 llvm-svn: 348745
* Add interceptors for md2(3) from NetBSDKamil Rytarowski2018-12-103-0/+193
| | | | | | | | | | | | | | | | | | | | Summary: MD2Init, MD2Update, MD2Final, MD2End, MD2File, MD2Data - calculates the RSA Data Security, Inc., "MD2" message digest. Add a dedicated test. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55469 llvm-svn: 348744
* Add new interceptors for FILE repositioning streamKamil Rytarowski2018-12-105-0/+112
| | | | | | | | | | | | | | | | | | | | | | Summary: Add new interceptors for a set of functions to reposition a stream: fgetpos, fseek, fseeko, fsetpos, ftell, ftello, rewind . Add a dedicated test. Enable this interface on NetBSD. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55471 llvm-svn: 348743
* Revert r348741 "[Sema] Further improvements to to static_assert diagnostics."Clement Courbet2018-12-107-65/+48
| | | | | | Seems to break build bots. llvm-svn: 348742
* [Sema] Further improvements to to static_assert diagnostics.Clement Courbet2018-12-107-48/+65
| | | | | | | | | | | | | | Summary: We're now handling cases like `static_assert(!expr)` and static_assert(!(expr))`. Reviewers: aaron.ballman, Quuxplusone Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55270 llvm-svn: 348741
* [llvm-exegesis] Also check latency mode in local lit.Clement Courbet2018-12-101-2/+6
| | | | | | | | | | Summary: This should avoid failing on old CPUs that do not have a cycle counter. Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D55416 llvm-svn: 348740
* [CostModel][X86][AArch64] Adjust cost of the scalarization part of min/max ↵Craig Topper2018-12-1011-710/+725
| | | | | | | | | | | | | | | | reduction. Summary: The comment says we need 3 extracts and a select at the end. But didn't we just account for the select in the vector cost above. Aren't we just extracting the single element after taking the min/max in the vector register? Reviewers: RKSimon, spatel, ABataev Reviewed By: RKSimon Subscribers: javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D55480 llvm-svn: 348739
* [X86] Remove the addcarry builtins. Leaving only the addcarryx builtins ↵Craig Topper2018-12-106-24/+14
| | | | | | | | | | since that matches gcc. The addcarry and addcarryx builtins do the same thing. The only difference is that addcarryx previously required adx feature. This commit removes the adx feature check from addcarryx and removes the addcarry builtin. This matches the builtins that gcc has. We don't guarantee compatibility in builtins, but we generally try to be consistent if its not a burden. llvm-svn: 348738
* [X86] Merge addcarryx/addcarry intrinsic into a single addcarry intrinsic.Craig Topper2018-12-107-165/+125
| | | | | | | | Both intrinsics do the exact same thing so we really only need one. Earlier in the 8.0 cycle we changed the signature of this intrinsic without renaming it. But it looks difficult to get the autoupgrade code to allow me to merge the intrinsics and change the signature at the same time. So I've renamed the intrinsic slightly for the new merged intrinsic. I'm skipping autoupgrading from the previous new to 8.0 signature. I've also renamed the subborrow for consistency. llvm-svn: 348737
* [TextAPI][elfabi] Fix build by adding std::move() to r348735Armando Montanez2018-12-101-1/+1
| | | | llvm-svn: 348736
* [TextAPI][elfabi] Make TBE handlers functions that return ErrorsArmando Montanez2018-12-104-34/+28
| | | | | | | | | | | | Since TBEHandler doesn't maintain state or otherwise have any need to be a class right now, the read and write functions have been moved out and turned into standalone functions. Additionally, the TBE read function has been updated to return an Expected value for better error handling. Tests have been updated to reflect these changes. Differential Revision: https://reviews.llvm.org/D55450 llvm-svn: 348735
* [bugpoint] Find 'opt', etc., in bugpoint directoryBrian Gesiak2018-12-1011-74/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When bugpoint attempts to find the other executables it needs to run, such as `opt` or `clang`, it tries searching the user's PATH. However, in many cases, the 'bugpoint' executable is part of an LLVM build, and the 'opt' executable it's looking for is in that same directory. Many LLVM tools handle this case by using the `Paths` parameter of `llvm::sys::findProgramByName`, passing the parent path of the currently running executable. Do this same thing for bugpoint. However, to preserve the current behavior exactly, first search the user's PATH, and then search for 'opt' in the directory containing 'bugpoint'. Test Plan: `check-llvm`. Many of the existing bugpoint tests no longer need to use the `--opt-command` option as a result of these changes. Reviewers: MatzeB, silvas, davide Reviewed By: MatzeB, davide Subscribers: davide, llvm-commits Differential Revision: https://reviews.llvm.org/D54884 llvm-svn: 348734
* Re-commit "[IR] Add NODISCARD to attribute functions"Brian Gesiak2018-12-091-53/+64
| | | | | | | | Now that https://reviews.llvm.org/D55435 is committed, https://reviews.llvm.org/D55217 can be committed once again -- all warnings are now fixed. llvm-svn: 348733
* [AMDGPU] Fix discarded result of addAttributeBrian Gesiak2018-12-092-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `llvm::AttributeList` and `llvm::AttributeSet` are immutable, and so methods defined on these classes, such as `addAttribute`, return a new immutable object with the attribute added. In https://reviews.llvm.org/D55217 I attempted to annotate methods such as `addAttribute` with `LLVM_NODISCARD`, since calling these methods has no side-effects, and so ignoring the result that is returned is almost certainly a programmer error. However, committing the change resulted in new warnings in the AMDGPU target. The AMDGPU simplify libcalls pass added in https://reviews.llvm.org/D36436 attempts to add the readonly and nounwind attributes to simplified library functions, but instead calls the `addAttribute` methods and ignores the result. Modify the simplify libcalls pass to actually add the nounwind and readonly attributes. Also update the simplify libcalls test to assert that these attributes are actually being set. Reviewers: rampitec, vpykhtin, rnk Reviewed By: rampitec Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D55435 llvm-svn: 348732
* Speculatively fixing the build; it seems add_pointer_t and add_const_t are ↵Aaron Ballman2018-12-091-1/+2
| | | | | | not implemented everywhere. llvm-svn: 348731
* Move the make_const_ptr trait into STLExtras; use add_pointer where ↵Aaron Ballman2018-12-094-34/+26
| | | | | | possible; NFC. llvm-svn: 348730
* Adding an STL-like type trait that is duplicated in multiple places in Clang.Aaron Ballman2018-12-091-0/+3
| | | | | | This trait is used by several AST visitor classes to control whether the AST is visiting const nodes or non-const nodes. These uses cannot be easily replaced with the STL traits directly due to use of an unspecialized templated when a type is expected (due to the template template parameter involved). llvm-svn: 348729
* [X86] Add some comments about when some X86 intrinsic autoupgrade code was ↵Craig Topper2018-12-091-7/+7
| | | | | | | | added. Someday we'd like to remove old autoupgrade code so it helps to annotate how long its been there so we don't have to go digging through commit history. llvm-svn: 348728
* [X86] If the carry input to an addcarry/subborrow intrinsic is known to be ↵Craig Topper2018-12-094-30/+31
| | | | | | | | | | 0, emit a flag setting ADD/SUB instead of ADC/SBB. Previously we had to take the carry in and add -1 to it to set the carry flag so we could use it with ADC/SBB. But if we know its 0 then we don't need to bother. This should go a long way towards fixing PR24545. llvm-svn: 348727
* Add OpenBSD support to OpenMPKamil Rytarowski2018-12-095-11/+22
| | | | | | | | | | | | | | | | Summary: This patch permits OpenMP to build and work (with both gcc and clang) on OpenBSD. It mostly follows what was done for FreeBSD and NetBSD, except OpenBSD does not have pthread_getattr_np support, so it follows OS X in that one instance. Reviewers: #openmp, krytarowski Reviewed By: krytarowski Subscribers: guansong, jfb, emaste, mgorny, krytarowski, #openmp Tags: #openmp Differential Revision: https://reviews.llvm.org/D34280 llvm-svn: 348726
* Add DragonFlyBSD support to OpenMPKamil Rytarowski2018-12-098-19/+43
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Additions mostly follow FreeBSD and NetBSD and are not intrusive. There is similar patch for OpenBSD: https://reviews.llvm.org/D34280 The -lm was being omitted due to -Wl,--as-needed in cmake rule, similar patch is in freebsd-ports/devel/llvm-devel port. Simple OpenMP programs compile and work as expected: $ clang-devel ~/omp_hello.c -fopenmp -I/usr/local/llvm-devel/include $ LD_LIBRARY_PATH=/usr/local/llvm-devel/lib OMP_NUM_THREADS=100 ./a.out The assertion in LLVMgold.so when -fopenmp was used together with -flto in 20170524 snapshot is no longer triggered on current svn-trunk and works fine as in llvm-4.0 with our local patches. Reviewers: #openmp, krytarowski Reviewed By: krytarowski Subscribers: dexonsmith, jfb, krytarowski, guansong, gregrodgers, emaste, mgorny, mehdi_amini Differential Revision: https://reviews.llvm.org/D35129 llvm-svn: 348725
* Remove unneeded dependency from lib/Target/X86/Utils/ to lib/IR (aka Core).Nico Weber2018-12-091-1/+1
| | | | | | | The dependency was added in r213995 in response to r213986 which did make X86/Utils depend on IR, but r256680 later removed that dependency again. llvm-svn: 348724
* [x86] regenerate test checks; NFCSanjay Patel2018-12-091-8/+10
| | | | llvm-svn: 348723
* [x86] don't try to convert add with undef operands to LEASanjay Patel2018-12-093-40/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code tries to handle an undef operand while transforming an add to an LEA, but it's incomplete because we will crash on the i16 test with the debug output shown below. It's better to just give up instead. Really, GlobalIsel should have folded these before we could get into trouble. # Machine code for function add_undef_i16: NoPHIs, TracksLiveness, Legalized, RegBankSelected, Selected bb.0 (%ir-block.0): liveins: $edi %1:gr32 = COPY killed $edi %0:gr16 = COPY %1.sub_16bit:gr32 %5:gr64_nosp = IMPLICIT_DEF %5.sub_16bit:gr64_nosp = COPY %0:gr16 %6:gr64_nosp = IMPLICIT_DEF %6.sub_16bit:gr64_nosp = COPY %2:gr16 %4:gr32 = LEA64_32r killed %5:gr64_nosp, 1, killed %6:gr64_nosp, 0, $noreg %3:gr16 = COPY killed %4.sub_16bit:gr32 $ax = COPY killed %3:gr16 RET 0, implicit killed $ax # End machine code for function add_undef_i16. *** Bad machine code: Reading virtual register without a def *** - function: add_undef_i16 - basic block: %bb.0 (0x7fe6cd83d940) - instruction: %6.sub_16bit:gr64_nosp = COPY %2:gr16 - operand 1: %2:gr16 LLVM ERROR: Found 1 machine code errors. Differential Revision: https://reviews.llvm.org/D54710 llvm-svn: 348722
* [X86] Extend pfm counter coverage for llvm-exegesisSimon Pilgrim2018-12-091-5/+29
| | | | | | Extension to rL348617, turns out llvm-exegesis doesn't need to match the perf counter name against a scheduler model resource name - so I've added a few more counters that I could find in the libpfm4 source code (and fix a typo in the knl/knm retired_uops counter - which uses 'all' instead of 'any'). llvm-svn: 348721
* NFC: Rename TemplateDecl dump utilitiesStephen Kelly2018-12-091-18/+17
| | | | | | | | | | There is a clang::TemplateDecl AST type, so a method called VisitTemplateDecl looks like it should 'override' the method from the base visitor, but it does not because of the extra parameters it takes. In reality, these methods are utilities, so name them like utilities. llvm-svn: 348720
* NFC: Move dump of individual comment nodes to NodeDumperStephen Kelly2018-12-093-156/+183
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55190 llvm-svn: 348719
* Revert "Introduce optional labels to dumpStmt"Stephen Kelly2018-12-091-15/+6
| | | | | | This reverts commit 933402caa09963792058198578522a95f013c69c. llvm-svn: 348718
* Introduce optional labels to dumpStmtStephen Kelly2018-12-091-6/+15
| | | | | | | | If the label is present, it is added as a child, with the statement a child of the label. This preserves behavior of the InitListExpr dump output. llvm-svn: 348717
* Inline hasNodes into only callerStephen Kelly2018-12-091-13/+8
| | | | | | It is easier to refactor with fewer utility methods. llvm-svn: 348716
* Inline dumpFullComment into callersStephen Kelly2018-12-091-10/+7
| | | | | | | It causes confusion over whether it or dumpComment is the more important. It is easier to refactor with fewer utility methods. llvm-svn: 348715
* Re-order content from InitListExprStephen Kelly2018-12-091-4/+4
| | | | | | | | | | | | | | Summary: This causes no change in the output of ast-dump-stmt.cpp due to the way child nodes are printed with a delay. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55398 llvm-svn: 348714
* Fix InitListExpr testStephen Kelly2018-12-091-6/+6
| | | | | | Wrong case of Check meant this has no effect. llvm-svn: 348713
* [X86] Add test for PR39926; NFCNikita Popov2018-12-091-0/+48
| | | | | | | | | | The test file shows a case where the avoid store forwarding block pass misses to copy a range (-1..1) when the load displacement changes sign. Baseline test for D55485. llvm-svn: 348712
* Revert a hunk that shouldn't have been included in the last commit.Frederic Riss2018-12-091-1/+1
| | | | | | I've seen this line trigger UB, but that's obviously not the correct fix... llvm-svn: 348711
* Remove some UB in RegisterContextDarwin_arm64.cppFrederic Riss2018-12-092-2/+12
| | | | llvm-svn: 348710
* SourceManager: insert(make_pair(..)) -> try_emplace. NFCFangrui Song2018-12-091-5/+2
| | | | llvm-svn: 348709
* [COFF] Map truncated .eh_frame section nameMartin Storsjo2018-12-084-0/+140
| | | | | | | | | | | | | | | PE/COFF sections can have section names truncated to 8 chars, in order to have the name available at runtime. (The string table, where long untruncated names are stored, isn't loaded at runtime.) This allows various llvm tools to dump the .eh_frame section from such executables. Patch by Peiyuan Song! Differential Revision: https://reviews.llvm.org/D55407 llvm-svn: 348708
* Fix conflict types for this FreeBSD test.David Carlier2018-12-081-48/+0
| | | | llvm-svn: 348707
* [DAGCombiner] re-enable truncation of binopsSanjay Patel2018-12-0825-882/+735
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is effectively re-committing the changes from: rL347917 (D54640) rL348195 (D55126) ...which were effectively reverted here: rL348604 ...because the code had a bug that could induce infinite looping or eventual out-of-memory compilation. The bug was that this code did not guard against transforming opaque constants. More details are in the post-commit mailing list thread for r347917. A reduced test for that is included in the x86 bool-math.ll file. (I wasn't able to reduce a PPC backend test for this, but it was almost the same pattern.) Original commit message for r347917: The motivating case for this is shown in: https://bugs.llvm.org/show_bug.cgi?id=32023 and the corresponding rot16.ll regression tests. Because x86 scalar shift amounts are i8 values, we can end up with trunc-binop-trunc sequences that don't get folded in IR. As the TODO comments suggest, there will be regressions if we extend this (for x86, we mostly seem to be missing LEA opportunities, but there are likely vector folds missing too). I think those should be considered existing bugs because this is the same transform that we do as an IR canonicalization in instcombine. We just need more tests to make those visible independent of this patch. llvm-svn: 348706
* [x86] add 32-bit RUN for tests and test with opaque constants; NFCSanjay Patel2018-12-081-79/+198
| | | | | | | The opaque constant test is reduced from a Chrome file that infinite-looped with rL347917. llvm-svn: 348705
* [gn build] Add build files for CodeGen subfolders AsmPrinter, GlobalISel, ↵Nico Weber2018-12-083-0/+115
| | | | | | | | SelectionDAG. Differential Revision: https://reviews.llvm.org/D55462 llvm-svn: 348704
* [WebAssembly] Add support for the event sectionHeejin Ahn2018-12-0819-30/+401
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* [WebAssembly] Make WasmSymbol's signature usable for events (NFC)Heejin Ahn2018-12-083-18/+12
| | | | | | | | | | | | | | Summary: WasmSignature used to use its `WasmSignature` member variable only for function types, but now it also can be used for events as well. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D55247 llvm-svn: 348702
* [llvm-readobj] Little clean up inside `parseDynamicTable`Xing GUO2018-12-081-13/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This anoymous function actually has same logic with `Obj->toMappedAddr`. Besides, I have a question on resolving illegal value. `gnu-readelf`, `gnu-objdump` and `llvm-objdump` could parse the test file 'test/tools/llvm-objdump/Inputs/private-headers-x86_64.elf', but `llvm-readobj` will fail when parse `DT_RELR` segment. Because, the value is 0x87654321 which is illegal. So, shall we do this clean up rather then remove the checking statements inside anoymous function? ``` if (Delta >= Phdr.p_filesz) return createError("Virtual address is not in any segment"); ``` Reviewers: rupprecht, jhenderson Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D55329 llvm-svn: 348701
* Convert some ObjC msgSends to runtime calls.Pete Cooper2018-12-0810-14/+245
| | | | | | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as alloc/allocWithZone instead of sending a message to those functions. This patch adds support for converting messages to alloc/allocWithZone to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed By: rjmccall https://reviews.llvm.org/D55349 llvm-svn: 348687
* Move diagnostic enums into Basic.Richard Trieu2018-12-0823-166/+342
| | | | | | | | | Move enums from */*Diagnostic.h to Basic/Diagnostic*.h. Basic/AllDiagnostics.h needs all the enums and moving the sources to Basic prevents a Basic->*->Basic dependency loop. This also allows each Basic/Diagnostics*Kinds.td to have a header at Basic/Diagnostic*.h (except for Common). The old headers are kept in place since other packages are still using them. llvm-svn: 348685
* Fix a typo in the strtoi testKamil Rytarowski2018-12-081-2/+2
| | | | | | https://reviews.llvm.org/D54702 llvm-svn: 348683
* Revert a chunk of previous change in sanitizer_platform_limits_netbsd.hKamil Rytarowski2018-12-081-2/+0
| | | | | | | Undefining INLINE breaks the build. The invalid change in this file has been overlooked in D55386. llvm-svn: 348680
OpenPOWER on IntegriCloud