- Feb 27, 2021
-
-
Craig Topper authored
Using ComputeNumSignBits or computeKnownBits we might be able to determine that overflow is impossible. This especially helps after type legalization if the type was promoted from a type with half the bits or more. Type legalization conservatively creates a promoted smulo/umulo and an overflow check for the promoted bits. The overflow from the promoted smulo/umulo is ORed with the result of the promoted bits overflow check. Proving that the promoted smulo/umulo can never overflow will leave us with just the promoted bits overflow check. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D97160
-
Peter Steinfeld authored
It's possible to define a procedure whose interface depends on a procedure which has an interface that depends on the original procedure. Such a circular definition was causing the compiler to fall into an infinite loop when resolving the name of the second procedure. It's also possible to create circular dependency chains of more than two procedures. I fixed this by adding the function HasCycle() to the class DeclarationVisitor and calling it from DeclareProcEntity() to detect procedures with such circularly defined interfaces. I marked the associated symbols of such procedures by calling SetError() on them. When processing subsequent procedures, I called HasError() before attempting to analyze their interfaces. Unfortunately, this did not work. With help from Tim, we determined that the SymbolSet used to track the erroneous symbols was instantiated using a "<" operator which was defined using the name of the procedure. But the procedure name was being changed by a call to ReplaceName() between the times that the calls to SetError() and HasError() were made. This caused HasError() to incorrectly report that a symbol was not in the set of erroneous symbols. I fixed this by making SymbolSet be an ordered set, which does not use the "<" operator. I also added tests that will crash the compiler without this change. And I fixed the formatting on an error message from a previous update. Differential Revision: https://reviews.llvm.org/D97201
-
George Balatsouras authored
This will allow identifying exactly how many shadow bytes were used during compilation, for when fast8 mode is introduced. Also, it will provide a consistent matching point for instrumentation tests so that the exact llvm type used (i8 or i16) for the shadow can be replaced by a pattern substitution. This is handy for tests with multiple prefixes. Reviewed by: stephan.yichao.zhao, morehouse Differential Revision: https://reviews.llvm.org/D97409
-
Vitaly Buka authored
Warning was enabled by D94640
-
Vitaly Buka authored
According to the comment on the next line it's expected behaviour.
-
Vitaly Buka authored
-
Aart Bik authored
Similar to mask-load/store and compress/expand, the gather and scatter operation now allow for higher dimension uses. Note that to support the mixed-type index, the new syntax is: vector.gather %base [%i,%j] [%kvector] .... The first client of this generalization is the sparse compiler, which needs to define scatter and gathers on dense operands of higher dimensions too. Reviewed By: bixia Differential Revision: https://reviews.llvm.org/D97422
-
Dan Gohman authored
Use `APInt` to convert a 32-bit or 64-bit immediate to an `APFloat` rather than `bit_cast` to a `float` or `double` to avoid going through host floating-point and potentially changing the bit pattern of NaNs. Differential Revision: https://reviews.llvm.org/D97490
-
Nico Weber authored
Dynamic lookup symbols are symbols that work like dynamic symbols in ELF: They're not bound to a dylib like normal Mach-O twolevel lookup symbols, but they live in a global pool and dyld resolves them against exported symbols from all loaded dylibs. This adds support for dynamical lookup symbols to lld/mac. They are represented as DylibSymbols with file set to nullptr. This also uses this support to implement the -U flag, which makes a specific symbol that's undefined at the end of the link a dynamic lookup symbol. For -U, it'd be sufficient to just to a pass over remaining undefined symbols at the end of the link and to replace them with dynamic lookup symbols then. But I'd like to use this code to implement flat_namespace too, and that will require real support for resolving dynamic lookup symbols in SymbolTable. So this patch adds this now already. While writing tests for this, I noticed that we didn't set N_WEAK_DEF in the symbol table for DylibSymbols, so this fixes that too. Differential Revision: https://reviews.llvm.org/D97521
-
Casey Carter authored
... when testing `default_initializable`. Also, include `<memory>` for `unique_ptr`.
-
Heejin Ahn authored
This is a case D97178 tried to solve but missed. D97178 could not handle the case when multiple consecutive delegates are generated: - Before: ``` block br (a) try catch end_try end_block <- (a) ``` - After ``` block br (a) try ... try try catch end_try <- (a) delegate delegate end_block <- (b) ``` (The `br` should point to (b) now) D97178 assumed `end_block` exists two BBs later than `end_try`, because it assumed the order as `end_try` BB -> `delegate` BB -> `end_block` BB. But it turned out there can be multiple `delegate`s in between. This patch changes the logic so we just search from `end_try` BB until we find `end_block`. Fixes https://github.com/emscripten-core/emscripten/issues/13515. (More precisely, fixes https://github.com/emscripten-core/emscripten/issues/13515#issuecomment-784711318.) Reviewed By: dschuff, tlively Differential Revision: https://reviews.llvm.org/D97569 -
Philip Reames authored
-
Rob Suderman authored
Lowering from the tosa.reshape op to linalg.reshape. For same-rank or non-collapsed/expanded cases two linalg.reshapes are inserted. Differential Revision: https://reviews.llvm.org/D97439
-
Stanislav Mekhanoshin authored
If a region was not constrained by a high register pressure and was not rescheduled without clustering we can skip rescheduling it ClusteredLowOccupancyReschedule stage. This improves scheduling speed by 25% on some kernels. Differential Revision: https://reviews.llvm.org/D97506
-
Stanislav Mekhanoshin authored
We are attempting rescheduling without load store clustering if occupancy limits were not met with clustering. Skip this for regions which do not have any loads or stores at all. In a set of kernels I am experimenting with this improves scheduling time by ~30%. Differential Revision: https://reviews.llvm.org/D97342
-
Anirudh Prasad authored
- This patch introduces a different assembler dialect ("hlasm") for z/OS. The default dialect has now been given the "att" dialect name. For this appropriate changes have been added to SystemZ.td. - This patch also makes a few changes to SystemZInstrFormats.td which restrict a few condition code mnemonics to just the "att" dialect variant (he, le, lh, nhe, nle, nlh). These extended condition code mnemonics are not available in HLASM. - A new private function has been introduced in SystemZAsmParser.cpp to return the assembler dialect set in SystemZMCAsmInfo.cpp. The reason we couldn't/haven't explicitly queried the overriden getAssemblerDialect function from AsmParser is outlined in this thread here. This returned dialect is directly passed onto the relevant matcher functions which taken in a variantID, so that the matcher functions can appropriately choose an instruction based on the variant. Reviewed By: uweigand Differential Revision: https://reviews.llvm.org/D94250 -
James Y Knight authored
These locations were missed as part of adding alignment to the instructions, and were still making their own alignment assumptions.
-
Philip Reames authored
-
Jianzhou Zhao authored
This would cause linking errors after https://reviews.llvm.org/D97483 that introduced new prefixes for ABI wrappers with origin tracking mode. We will renable this after the full origin tracking is checked in.
-
Craig Topper authored
This will allow FrameIndex as the base address instead of emitting a separate ADDI from isel. eliminateFrameIndex will likely turn it back into an ADDI, but this makes things consistent with the SDPatterns and VLPatterns. I only tested one case for simplicity. I can test more if reviewers want. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D97221
-
Philip Reames authored
This clarifies the interface of the matchSimpleRecurrence helper introduced in 8020be0b for non-commutative operators. After ebd3aeba, I realized the original way I framed the routine was inconsistent. For shifts, we only matched the the LHS form, but for sub we matched both and the caller wanted that information. So, instead, we now consistently match both forms for non-commutative operators and the caller becomes responsible for filtering if needed. I tried to put a clear warning in the header because I suspect the RHS form of e.g. a sub recurrence is non-obvious for most folks. (It was for me.)
-
Leonard Chan authored
As of 4f395db8 which contains updates to -Wfree-nonheap-object, a line in this test will trigger the warning. This particular line is ok though since it's meant to test a free on a bad pointer. Differential Revision: https://reviews.llvm.org/D97516
-
Jianzhou Zhao authored
This is a part of https://reviews.llvm.org/D95835. Each customized function has two wrappers. The first one dfsw is for the normal shadow propagation. The second one dfso is used when origin tracking is on. It calls the first one, and does additional origin propagation. Which one to use can be decided at instrumentation time. This is to ensure minimal additional overhead when origin tracking is off. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D97483
-
Nathan James authored
Fix up cases where diag is called by piecing together a string in favour of placeholders. Fix up cases where select could be used instead of duplicating the message for sake of 1 word difference. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97488
-
Fangrui Song authored
[SanitizerCoverage] Clarify llvm.used/llvm.compiler.used and partially fix unmatched metadata sections on Windows `__sancov_pcs` parallels the other metadata section(s). While some optimizers (e.g. GlobalDCE) respect linker semantics for comdat and retain or discard the sections as a unit, some (e.g. GlobalOpt/ConstantMerge) do not. So we have to conservatively retain all unconditionally in the compiler. When a comdat is used, the COFF/ELF linkers' GC semantics ensure the associated parallel array elements are retained or discarded together, so `llvm.compiler.used` is sufficient. Otherwise (MachO (see rL311955/rL311959), COFF special case where comdat is not used), we have to use `llvm.used` to conservatively make all sections retain by the linker. This will fix the Windows problem once internal linkage GlobalObject's in `llvm.used` are retained via `/INCLUDE:`. Reviewed By: morehouse, vitalybuka Differential Revision: https://reviews.llvm.org/D97432
-
Nathan James authored
Some comments are redundant, others just simple fixes. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97544
-
Philip Reames authored
Direct rewrite of the code the helper was extracted from.
-
Christopher Di Bella authored
libc++ was previously a bit confused by what the value of __cpp_concepts should be. Also replaces `__floating_point` with `floating_point` now that it exists. Differential Revision: https://reviews.llvm.org/D97015
-
Fangrui Song authored
An global value in the `llvm.used` list does not have GC root semantics on ELF targets. This will be changed in a subsequent backend patch. Change some `llvm.used` in the ELF code path to use `llvm.compiler.used` to prevent undesired GC root semantics. Change one extern "C" alias (due to `__attribute__((used))` in extern "C") to use `llvm.compiler.used` on all targets. GNU ld has a rule "`__start_/__stop_` references from a live input section retain the associated C identifier name sections", which LLD may drop entirely (currently refined to exclude SHF_LINK_ORDER/SHF_GROUP) in a future release (the rule makes it clumsy to GC metadata sections; D96914 added a way to try the potential future behavior). For `llvm.used` global values defined in a C identifier name section, keep using `llvm.used` so that the future LLD change will not affect them. rnk kindly categorized the changes: ``` ObjC/blocks: this wants GC root semantics, since ObjC mainly runs on Mac. MS C++ ABI stuff: wants GC root semantics, no change OpenMP: unsure, but GC root semantics probably don't hurt CodeGenModule: affected in this patch to *not* use GC root semantics so that __attribute__((used)) behavior remains the same on ELF, plus two other minor use cases that don't want GC semantics Coverage: Probably want GC root semantics CGExpr.cpp: refers to LTO, wants GC root CGDeclCXX.cpp: one is MS ABI specific, so yes GC root, one is some other C++ init functionality, which should form GC roots (C++ initializers can have side effects and must run) CGDecl.cpp: Changed in this patch for __attribute__((used)) ``` Differential Revision: https://reviews.llvm.org/D97446
-
Philip Reames authored
This helper came up in another review, and I've got about 4 different patches with copies of this copied into it. Time to precommit the routine. :)
-
Louis Dionne authored
-
Alexey Bataev authored
-
Mircea Trofin authored
-
Mircea Trofin authored
-
Louis Dionne authored
Xcode does bundle Ninja, so we can use that Ninja if there's no system-wide Ninja installed. This is useful on some CI bots we have that don't come with Ninja pre-installed.
-
Mircea Trofin authored
-
Jay Foad authored
This allows GlobalISel to use this instruction where available. I assume SelectionDAG always selects s_xnor_b32 so it isn't affected by this change. Differential Revision: https://reviews.llvm.org/D97560
-
Geoffrey Martin-Noble authored
Right now they multiply before casting which means they would frequently overflow. There are various reasonable ways to do this, but until we have robust op description infra, this is a simple and safe default. More careful treatments are likely to be hardware specific, as well (e.g. using an i8*i8->i16 mul instruction). Reviewed By: nicolasvasilache, mravishankar Differential Revision: https://reviews.llvm.org/D97505
-
Nico Weber authored
When building with -fsanitize=unsigned-integer-overflow, this code causes a diagnostic like: ../../llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp:159:15: runtime error: unsigned integer overflow: 90 - 229 cannot be represented in type 'unsigned long' unsigned integer overflow is well defined and it isn't an issue in practice, but in obscure scenarios (S1.size() small, S2.size over 2GB on 32-bit systems) it could even be a bug. So use the usual idiom for implementing cmp functions instead of the gernally considered buggy idiom :) See e.g. https://www.gnu.org/software/libc/manual/html_node/Comparison-Functions.html or https://stackoverflow.com/questions/10996418/efficient-integer-compare-function/10997428#10997428 Differential Revision: https://reviews.llvm.org/D97557 -
Simon Pilgrim authored
Simplify through to the scalar/vector source operand.
-