- Feb 05, 2021
-
-
Richard Smith authored
These attributes were all incorrect or inappropriate for LLVM to infer: - inaccessiblememonly is generally wrong; user replacement operator new can access memory that's visible to the caller, as can a new_handler function. - willreturn is generally wrong; a custom new_handler is not guaranteed to terminate. - noalias is inappropriate: Clang has a flag to determine whether this attribute should be present and adds it itself when appropriate. - noundef and nonnull on the return value should be specified by the frontend on all 'operator new' functions if we want them, not here. In any case, inferring attributes on functions declared 'nobuiltin' (as these are when Clang emits them) seems questionable.
-
Richard Smith authored
Several of the new attributes here were incorrect, and even the ones that are generally correct were being added even to nobuiltin calls. This reverts commit bb3f169b.
-
Bill Torpey authored
For those using a GUI, it can be very helpful to have a particular suffix appended to the report file name, so it can be opened with a double-click. (see also: https://github.com/google/sanitizers/issues/951) Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46546
-
Sean Silva authored
- attribute-dict production is redundant with dictionary-attribute - definitions of attribute aliases were part of the same production as uses of attribute aliases - `std.dim` now accepts the dimension number as an operand, so the example is out of date. Use the predicate of std.cmpi as a better example. Differential Revision: https://reviews.llvm.org/D96076
-
Yaxun (Sam) Liu authored
-
Sam McCall authored
This enables: - completion in { .x.^ } - completion in { .x = { .^ } } - type-based ranking of candidates for { .x = ^ } Differential Revision: https://reviews.llvm.org/D96058 -
Richard Smith authored
explicitly qualified as members of the current instantiation. Despite the nested name specifier being fully-dependent in this case, the elaborated type might only be instantiation-dependent, because the type is a member of the current instantiation.
-
Ayke van Laethem authored
The ldrexd/strexd instructions are not supported on M-class chips, see for example https://developer.arm.com/documentation/dui0489/e/arm-and-thumb-instructions/memory-access-instructions/ldrex-and-strex which says: > All these 32-bit Thumb instructions are available in ARMv6T2 and > above, except that LDREXD and STREXD are not available in the ARMv7-M > architecture. Looking at the ARMv8-M architecture, it appears that these instructions aren't supported either. The Architecture Reference Manual lists ldrex/strex but not ldrexd/strexd: https://developer.arm.com/documentation/ddi0553/bn/ Godbolt example on LLVM 11.0.0, which incorrectly emits ldrexd/strexd instructions: https://llvm.godbolt.org/z/5qqPnE Differential Revision: https://reviews.llvm.org/D95891
-
Aaron Ballman authored
Attributes accept arguments, not parameters, so we should report that the duplicate attribute arguments don't match.
-
Eric Schweitz authored
https://github.com/flang-compiler/f18-llvm-project/pull/413 Differential Revision: https://reviews.llvm.org/D96072
-
Kirill Bobyrev authored
Follow-up on D95925: adds better detection for function arguments and also checks for conflicts in muli-variable init statements in ForStmt. Reviewed By: hokein Differential Revision: https://reviews.llvm.org/D96009
-
Craig Topper authored
-
Marek Kurdej authored
Note: contrary to what I said previously, I didn't change .clang-format nor utils/generate_feature_test_macro_components.py script. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D92229
-
Nikita Popov authored
MemorySSA currently treats lifetime.end intrinsics as not aliasing anything. This breaks MemorySSA-based MemCpyOpt, because we'll happily move a read of a pointer below a lifetime.end intrinsic, as no clobber is reported. I think the MemorySSA modelling here isn't correct: lifetime.end(p) has approximately the same effect as doing a memcpy(p, undef), and should be treated as a clobber. This patch removes the special handling of lifetime.end, leaving alias analysis to handle it appropriately. Differential Revision: https://reviews.llvm.org/D95763
-
Adrian Prantl authored
... and not when the typesystem failed to initialize. rdar://72562341 Differential Revision: https://reviews.llvm.org/D95992
-
wlei authored
This change allows merging and trimming cold context profile in llvm-profgen to solve profile size bloat problem. Currently when the profile's total sample is below threshold(supported by a switch), it will be considered cold and merged into a base context-less profile, which will at least keep the profile quality as good as the baseline(non-cs). For example, two input profiles: [main @ foo @ bar]:60 [main @ bar]:50 Under threshold = 100, the two profiles will be merge into one with the base context, get result: [bar]:110 Added two switches: `--csprof-cold-thres=<value>`: Specified the total samples threshold for a context profile to be considered cold, with 100 being the default. Any cold context profiles will be merged into context-less base profile by default. `--csprof-keep-cold`: Force profile generation to keep cold context profiles instead of dropping them. By default, any cold context will not be written to output profile. Results: Though not yet evaluating it with the latest CSSPGO, our internal branch shows neutral on performance but significantly reduce the profile size. Detailed evaluation on llvm-profgen with CSSPGO will come later. Differential Revision: https://reviews.llvm.org/D94111
-
Walter Erquinigo authored
@mstorsjo found a mistake that I made when trying to fix some Windows compilation errors encountered by @stella.stamenova. I was incorrectly using the LLVM_ON_UNIX macro. In any case, proper use of #if defined(_WIN32) should be the actual fix. Differential Revision: https://reviews.llvm.org/D96060
-
Adrian Prantl authored
Based on the comments in the code, the idea is that AsmPrinter is unable to produce entry value blocks of arbitrary length, such as DW_OP_entry_value [DW_OP_reg5 DW_OP_lit1 DW_OP_plus]. But the way the Verifier check is written it also disallows DW_OP_entry_value [DW_OP_reg5] DW_OP_lit1 DW_OP_plus which seems to overshoot the target. Note that this patch does not change any of the safety guards in LiveDebugValues — there is zero behavior change for clang. It just allows us to legalize more complex expressions in future patches. rdar://73907559 Differential Revision: https://reviews.llvm.org/D95990
-
Diego Caballero authored
Reviewed By: mehdi_amini, rriddle Differential Revision: https://reviews.llvm.org/D95906
-
Sanjay Patel authored
The upstream callers (the vectorizers) were fixed with: bbed5f2f ( D95690 ) 77adbe6a We should remove this pass entirely now that reduction legalization/lowering is expected to work just as well, but we need to confirm that the shuffle ops do not regress (for x86 in particular). This should be the last step needed to close: https://llvm.org/PR23116
-
Christopher Tetreault authored
The operator< in the previous attempt was incorrect. It is unfortunate that this was only caught by the expensive checks. This reverts commit ff1147c3.
-
Peng Guo authored
Fix clang compiler warning from `-Wrange-loop-analysis`. Reviewed By: andreadb Differential Revision: https://reviews.llvm.org/D95997
-
Wen-Heng (Jack) Chung authored
Follow patterns used for f32 and f64 types. Differential Revision: https://reviews.llvm.org/D95964
-
Paul Robinson authored
-
Shilei Tian authored
The header `assert.h` needs to be included in order to use `assert` in the code. When building NVPTX `deviceRTLs` on a CUDA free system, it requires headers from `gcc-multilib`, which some systems don't have. This patch drops the use of `assert` in common parts of `deviceRTLs`. In light of `openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h`, a code block ``` if (!cond) __builtin_trap(); ``` is being used. The builtin will be translated to `call void @llvm.trap()`, and the corresponding PTX is `trap;`. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D95986
-
Mehdi Amini authored
-
Vladislav Vinogradov authored
Use `StringLiteral` for function return type if it is known to return constant string literals only. This will make it visible to API users, that such values can be safely stored, since they refers to constant data, which will never be deallocated. `StringRef` is general is not safe to store for a long term, since it might refer to temporal data allocated in heap. Reviewed By: mehdi_amini, bkramer Differential Revision: https://reviews.llvm.org/D95945
-
Fangrui Song authored
binutils 2.36 introduced the new section flag SHF_GNU_RETAIN (for ELFOSABI_GNU & ELFOSABI_FREEBSD) to mark a sections as a GC root. Several LLVM side toolchain folks (including me) were involved in the design process of SHF_GNU_RETAIN and were happy with this proposal. Currently GNU ld only respects SHF_GNU_RETAIN semantics for ELFOSABI_GNU & ELFOSABI_FREEBSD object files (https://sourceware.org/bugzilla/show_bug.cgi?id=27282). GNU ld sets EI_OSABI to ELFOSABI_GNU for relocatable output (https://sourceware.org/bugzilla/show_bug.cgi?id=27091). In practice the single value EI_OSABI is neither a good indicator for object file compatibility, nor a useful mechanism marking used ELF extensions. For input, we respect SHF_GNU_RETAIN semantics even for ELFOSABI_NONE object files. This is compatible with how LLD and GNU ld handle (mildly useful) STT_GNU_IFUNC / (emitted by GCC, considered misfeature by some folks) STB_GNU_UNIQUE input. (As of LLVM 12.0.0, the integrated assembler does not set ELFOSABI_GNU for STT_GNU_IFUNC/STB_GNU_UNIQUE). Arguably STT_GNU_IFUNC/STB_GNU_UNIQUE probably need indicators in object files but SHF_GNU_RETAIN is more likely accepted by more OSABI platforms. For output, we take a step further than GNU ld: we don't promote ELFOSABI_NONE to ELFOSABI_GNU for all output. Differential Revision: https://reviews.llvm.org/D95749
-
Fangrui Song authored
In GCC emitted .debug_info sections, R_386_GOTOFF may be used to relocate DW_AT_GNU_call_site_value values (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98946). R_386_GOTOFF (`S + A - GOT`) is one of the `isStaticLinkTimeConstant` relocation type which is not PC-relative, so it can be used from non-SHF_ALLOC sections. We current allow new relocation types as needs come. The diagnostic has caught some bugs in the past. Differential Revision: https://reviews.llvm.org/D95994
-
xgupta authored
-
Vladislav Vinogradov authored
To allow it usage for Operation classes defined outside of `mlir` namespace. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D95952
-
Fangrui Song authored
Warnings have been added for three cases (PR41905): (1) missing debug info, (2) the source file cannot be found, (3) the debug info points at a line beyond the end of the file. (1) is probably less useful. This was brought up once on http://lists.llvm.org/pipermail/llvm-dev/2020-April/141264.html and two internal users mentioned it to me that it was annoying. (I personally find the warning confusing, too.) Users specify --source to get additional information if sources happen to be available. If sources are not available, it should be obvious as the output will have no interleaved source lines. The warning can be especially annoying when using llvm-objdump -S on a bunch of files. This patch drops the warning when there is no debug info. (If LLVMSymbolizer::symbolizeCode returns an `Error`, there will still be an error. There is currently no test for an `Error` return value. The only code path is probably a broken symbol table, but we probably already emit a warning in that case) `source-interleave-prefix.test` has an inappropriate "malformed" test - the test simply has no .debug_* because new llc does not produce debug info when the filename is empty (invalid). I have tried tampering the header of .debug_info/.debug_line but llvm-symbolizer does not warn. This patch does not intend to add the missing test coverage. Differential Revision: https://reviews.llvm.org/D88715
-
Vladislav Vinogradov authored
* Introduce separate `RankedTensorOf` class. Use it as base class for `AnyRankedTensor`. * Add C++ class specification (`::mlir::MemRefType`) to `MemRefRankOf` and `StaticShapeMemRefOf`. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D95936
-
Jay Foad authored
When widening, each half of the v2s16 operands needs to be sign extended for G_ASHR or zero extended for G_LSHR. Differential Revision: https://reviews.llvm.org/D96048
-
Jay Foad authored
SALU min/max s32 instructions exist so use them. This means that regbankselect can handle min/max much like add/sub/mul/shifts. Differential Revision: https://reviews.llvm.org/D96047
-
Nicolas Vasilache authored
This revision takes advantage of recent extensions to vectorization to refactor contraction detection into a bona fide Linalg interface. The mlit-linalg-ods-gen parser is extended to support adding such interfaces. The detection that was originally enabling vectorization is refactored to serve as both a test on a generic LinalgOp as well as to verify ops that declare to conform to that interface. This is plugged through Linalg transforms and strategies but it quickly becomes evident that the complexity and rigidity of the C++ class based templating does not pay for itself. Therefore, this revision changes the API for vectorization patterns to get rid of templates as much as possible. Variadic templates are relegated to the internals of LinalgTransformationFilter as much as possible and away from the user-facing APIs. It is expected other patterns / transformations will follow the same path and drop as much C++ templating as possible from the class definition. Differential revision: https://reviews.llvm.org/D95973
-
Jonas Devlieghere authored
This patch effectively does the following 3 things: - Centralize the logic to figure out if a compiler flag is supported. - Stop sanity checking whether the compiler works at all. While useful, that's not the decorator's responsibility. - Invoke the compiler with xcrun on Darwin so we know where to find the sysroot. On my macOS Big Sur system, the clang invocation couldn't find libSystem and would fail the sanity check in the decorator. This meant that the test suite would always try to run the ASan/UBSan/TSan tests, regardless of whether compiler-rt was built. Differential revision: https://reviews.llvm.org/D95995
-
Andrzej Warzynski authored
This patch adds logic in the InputOutputTestAction frontend action for reading input from stdin. Without this patch the following fails: ``` flang-new -fc1 -test-io - ``` The implementation of `InputOutputTestAction` is cleaned-up and a test for reading from stdin is added. Note that there's a difference between `-test-io` and e.g. `-E` in terms of file I/O. The frontend action for the former handles all file I/O on it's own. Conversely, the action corresponding to -E relies on the prescanner API to handle this. Currently we can't test reading from stdin for `flang-new -`. In this case `libclangDriver` assumes `-x -c`. This in turn leads to `flang-new -cc1`, which is not supported. -
Louis Dionne authored
According to my reading of http://eel.is/c++draft/filesystems#fs.class.path, the Standard doesn't actually mention that this should work. Since other implementations don't allow it, allowing it in libc++ is just setting a portability trap. Supersedes https://reviews.llvm.org/D89865. Differential Revision: https://reviews.llvm.org/D95975
-