- Sep 15, 2020
-
-
Simon Pilgrim authored
Fixes clang-tidy warnings first noticed on D87452.
-
Rahman Lavaee authored
Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols. This patch introduces the new .bb_addr_map section feature which allows us to emit the bits needed for mapping binary profiles to basic blocks into a separate section. The format of the emitted data is represented as follows. It includes a header for every function: | Address of the function | -> 8 bytes (pointer size) | Number of basic blocks in this function (>0) | -> ULEB128 The header is followed by a BB record for every basic block. These records are ordered in the same order as MachineBasicBlocks are placed in the function. Each BB Info is structured as follows: | Offset of the basic block relative to function begin | -> ULEB128 | Binary size of the basic block | -> ULEB128 | BB metadata | -> ULEB128 [ MBB.isReturn() OR MBB.hasTailCall() << 1 OR MBB.isEHPad() << 2 ] The new feature will replace the existing "BB labels" functionality with -basic-block-sections=labels. The .bb_addr_map section scrubs the specially-encoded BB symbols from the binary and makes it friendly to profilers and debuggers. Furthermore, the new feature reduces the binary size overhead from 70% bloat to only 12%. For more information and results please refer to the RFC: https://lists.llvm.org/pipermail/llvm-dev/2020-July/143512.html Reviewed By: MaskRay, snehasish Differential Revision: https://reviews.llvm.org/D85408
-
Tim Keith authored
Change the analyzed form of type-bound assignment to match that of call statements. Resolve the binding name to a specific subprogram when possible by using `GetBindingResolution`. Otherwise leave it as a type-bound procedure call. Differential Revision: https://reviews.llvm.org/D87541
-
Fangrui Song authored
Prefer `errorOrWarn` to `fatal` for recoverable errors and graceful degradation when --noinhibit-exec is specified. Mention the destination symbol, otherwise the diagnostic is not really actionable. Two errors are not tested but the patch does not intend to add the coverage. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D87486
-
cgyurgyik authored
This revision removes dependencies that exist between different string functions. This allows for the libc user to use a specific function X of this library without also depending on Y and Z. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D87421
-
Tim Keith authored
Integer case values were being compared as unsigned by operator< on evaluate::value::Integer. Change that to signed so that overlap can be detected correctly. Explicit CompareUnsigned and BLT are still available if unsigned comparison is needed. Fixes https://bugs.llvm.org/show_bug.cgi?id=47309 Differential Revision: https://reviews.llvm.org/D87595
-
- Sep 14, 2020
-
-
Sanjay Patel authored
maximum(nnan X, +INF) --> +INF minimum(nnan X, -INF) --> -INF This is based on the similar codegen transform proposed in: D87571
-
Saleem Abdulrasool authored
This adds the `__swift_objc_members__` attribute to the semantic analysis. It allows for annotating ObjC interfaces to provide Swift semantics indicating that the types derived from this interface will be back-bridged to Objective-C to allow interoperability with Objective-C and Swift. This is based on the work of the original changes in https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c Differential Revision: https://reviews.llvm.org/D87395 Reviewed By: Aaron Ballman, Dmitri Gribenko
-
Sanjay Patel authored
maxnum(ninf X, +FLT_MAX) --> +FLT_MAX minnum(ninf X, -FLT_MAX) --> -FLT_MAX This is based on the similar codegen transform proposed in: D87571
-
Florian Hahn authored
1ce82015 added a fix to restrict phi optimizations after phi translations. But the current use of performedPhiTranslation only checked whether phi translation happened for the first iterator and missed cases where phi translations happens at subsequent iterators/upwards defs. This patch changes upward_defs_iteartor to take a pointer to a bool, so we can easily ensure the final value includes all visited defs, while still being able to conveniently use it with make_range & co.
-
Florian Hahn authored
-
Simon Pilgrim authored
Fixes clang static analyzer warning.
-
Louis Dionne authored
In C++20, since P0896R4, std::ostream_iterator and std::ostreambuf_iterator must have std::ptrdiff_t instead of void as a difference_type. Tests by Casey Carter (thanks!). Differential Revision: https://reviews.llvm.org/D87459
-
Lubomir Litchev authored
Added support to the Std dialect cast operations to do casts in vector types when feasible. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D87410
-
Sanjay Patel authored
We use the same code structure for folding integer min/max.
-
Sanjay Patel authored
The new tests are duplicated from the sibling patch for codegen: D87571
-
Sanjay Patel authored
-
jasonliu authored
Summary: In small code model, AIX assembler could not deal with labels that could not be reached within the [-0x8000, 0x8000) range from TOC base. So when generating the assembly, we would need to help the assembler by subtracting an offset from the label to keep the actual value within [-0x8000, 0x8000). Reviewed By: hubert.reinterpretcast, Xiangling_L Differential Revision: https://reviews.llvm.org/D86879
-
David Green authored
-
Sanjay Patel authored
As discussed in the sibling codegen functionality patch D87571, this transform was created with D52766, but it is not correct. The incorrect test diffs were missed during review, but the 'TODO' comment about this functionality was still in the code - we need 'nnan' to enable this fold.
-
Jay Foad authored
Clustering loads has caching benefits, but as far as I know there is no advantage to clustering stores on any AMDGPU subtargets. The disadvantage is that it tends to increase register pressure and restricts scheduling freedom. Differential Revision: https://reviews.llvm.org/D85530
-
Simon Pilgrim authored
Fixes clang static analyzer warning about potential null dereferences.
-
Simon Pilgrim authored
Use cast<> instead which will assert if it fails and not just return null. Fixes clang static analyzer warning.
-
Georgii Rymar authored
This changes messages reported to stop using dynamic section names (use `describe()` instead). This allows to avoid `unwrapOrError` and improves diagnostics. Differential revision: https://reviews.llvm.org/D87503
-
Georgii Rymar authored
It has following issues: 1) `getStaticSymbolName` returns `std::string`, but the code assigns a result to `Expected<std::string>`. 2) The code uses `unwrapOrError` and never tests the error reported. This patch fixes these issues. Differential revision: https://reviews.llvm.org/D87507
-
Max Kazantsev authored
-
Georgii Rymar authored
There is some code that can be shared between GNU/LLVM styles. Also, this fixes 2 inconsistencies related to dumping unknown note types: 1) For GNU style we printed "Unknown note type: (0x00000003)" in some cases, and "Unknown note type (0x00000003)" (no colon) in other cases. GNU readelf always prints `:`. This patch removes the related code duplication and does the same. 2) For LLVM style in some cases we printed "Unknown note type (0x00000003)", but sometimes just "Unknown (0x00000003)". The latter is the right form, which is consistent with other unknowns that are printed in LLVM style. Rebased on top of D87453. Differential revision: https://reviews.llvm.org/D87454
-
Georgii Rymar authored
Currently we don't test all core note types that are defined in `getCoreNoteTypeName` in ELFDumper.cpp. Also we don't have a test for an unknown core note type. This patch fixes it. Differential revision: https://reviews.llvm.org/D87453
-
Dvorskiy, Mikhail authored
After the changes the "tbb" parallel backend will work with old TBB versions(TBB_INTERFACE_VERSION <= 12000) and new ones (TBB 2020 and greater) More about oneTBB: https://github.com/oneapi-src/oneTBB Phabricator Review: https://reviews.llvm.org/D87380
-
Alex Zinenko authored
Type converter may fail and return nullptr on unconvertible types. The function conversion did not include a check and was attempting to use a nullptr type to construct an LLVM function, leading to a crash. Add a check and return early. The rest of the call stack propagates errors properly. Fixes PR47403. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D87075
-
David Green authored
Instcombine limits converting phi types to simple loads and stores. This does the same in codegenprepare, not processing phis that are not simple. Note that volatile loads/store ISel will happily convert between float and int. Atomics are more likely to always be integer. This just keeps things simple and doesn't process either. Differential Revision: https://reviews.llvm.org/D83770
-
Florian Hahn authored
AliasAnalysis/MemoryLocation does not account for loops. Two MemoryLocation can be must-overwrite, even if the first one writes multiple locations in a loop. This patch prevents removing such stores, by only considering candidates that are known to be loop invariant, or executed in the same BB. Currently the invariant check is quite conservative and only considers Alloca and Alloca-like instructions and arguments as invariant base pointers. It also considers GEPs with all constant indices and invariant bases as invariant. This can be improved in the future, but the current implementation has only minor impact on the total number of stores eliminated (25903 vs 26047 for the baseline). There are some 2-10% swings for some individual benchmarks. In roughly half of the cases, the number of stores removed increases actually, because we skip candidates that are unlikely to be valid candidates early.
-
Florian Hahn authored
-
Meera Nakrani authored
LLVM will canonicalize conditional selectors to a different pattern than the old code that was used. This is updating the function to match the new expected patterns and select SSAT or USAT when successful. Tests have also been updated to use the new patterns. Differential Review: https://reviews.llvm.org/D87379
-
Eduardo Caldas authored
Differential Revision: https://reviews.llvm.org/D87600
-
Eduardo Caldas authored
Differential Revision: https://reviews.llvm.org/D87599
-
Eduardo Caldas authored
Differential Revision: https://reviews.llvm.org/D87598
-
Sjoerd Meijer authored
This adds additional checks for the original scalar loop tripcount value, i.e. get.active.lane.mask second argument, and perform several sanity checks to see if it is of the form that we expect similarly like we already do for the IV which is the first argument of get.active.lane. Differential Revision: https://reviews.llvm.org/D86074
-
David Sherwood authored
The function LoopIdiomRecognize::isLegalStore looks for stores in loops that could be transformed into memset or memcpy. However, the algorithm currently requires that we know how big the store is at runtime, i.e. that the store size will not overflow an unsigned integer. For scalable vectors we cannot guarantee this so I have changed the code to bail out for now. In addition, even if we add a way to query the maximum value of vscale in future we will still need to update the algorithm to cope with non-constant strides. The additional cost associated with calculating the memset and memcpy arguments will need to be taken into account as well. This patch also fixes up an implicit TypeSize -> uint64_t cast, thereby removing a warning. I've added tests here showing a fixed width vector loop being transformed into memcpy, and a scalable vector loop remaining unchanged: Transforms/LoopIdiom/memcpy-vectors.ll Differential Revision: https://reviews.llvm.org/D87439
-
Petar Avramovic authored
Check for NoNaNsFPMath function attribute in isKnownNeverSNaN. Function attributes are in held in 'TargetMachine.Options'. Among other things, this allows selection of some patterns imported in D87351 since G_FCANONICALIZE is not generated when isKnownNeverSNaN returns true in lowerFMinNumMaxNum. However we notice some incorrect results since function attributes are not correctly written in TargetMachine.Options when next function is processed. Take a look at @v_test_no_global_nnans_med3_f32_pat0_srcmod0, it has "no-nans-fp-math"="false" but TargetMachine.Options still has it set to true since first function in test file had this attribute set to true. This will be fixed in D87511. Differential Revision: https://reviews.llvm.org/D87456
-