- Dec 31, 2021
-
-
Random authored
Early revisions of the VR4300 have a hardware bug where two consecutive multiplications can produce an incorrect result in the second multiply. This revision adds the `-mfix4300` flag to llvm (and clang) which, when passed, provides a software fix for this issue. More precise description of the "mulmul" bug: ``` mul.[s,d] fd,fs,ft mul.[s,d] fd,fs,ft or [D]MULT[U] rs,rt ``` When the above sequence is executed by the CPU, if at least one of the source operands of the first mul instruction happens to be `sNaN`, `0` or `Infinity`, then the second mul instruction may produce an incorrect result. This can happen both if the two mul instructions are next to each other and if the first one is in a delay slot and the second is the first instruction of the branch target. Description of the fix: This fix adds a backend pass to llvm which scans for mul instructions in each basic block and inserts a nop whenever the following conditions are met: - The current instruction is a single or double-precision floating-point mul instruction. - The next instruction is either a mul instruction (any kind) or a branch instruction. Differential Revision: https://reviews.llvm.org/D116238
-
Jay Foad authored
-
Pavel Labath authored
Just what it says on the box.
-
Craig Topper authored
Better to use the named list instead of assuming the size of MxList.
-
Craig Topper authored
Rather than wrapping a def around a list, we can just make a defvar of the list.
-
wangpc authored
For large integers (for example, magic numbers generated by TargetLowering::BuildSDIV when dividing by constant), we may need about 4~8 instructions to build them. In the same time, it just takes two instructions to load constants (with extra cycles to access memory), so it may be profitable to put these integers into constant pool. Reviewed By: asb, craig.topper Differential Revision: https://reviews.llvm.org/D114950
-
jacquesguan authored
Fix incorrect cases of vmv.s.f and add test cases for it. Differential Revision: https://reviews.llvm.org/D116432
-
Stella Laurenzo authored
https://reviews.llvm.org/D109555 added support to APInt for this, so the special case to disable it is no longer valid. It is in fact legal to construct these programmatically today, and they print properly but do not parse. Justification: zero bit integers arise naturally in various bit reduction optimization problems, and having them defined for MLIR reduces special casing. I think there is a solid case for i0 and ui0 being supported. I'm less convinced about si0 and opted to just allow the parser to round-trip values that already verify. The counter argument is that the proper singular value for an si0 is -1. But the counter to this counter is that the sign bit is N-1, which does not exist for si0 and it is not unreasonable to consider this non-existent bit to be 0. Various sources consider it having the singular value "0" to be the least surprising. Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D116413
-
Alexandre Ganea authored
Fixes interception of atoi() entry point.
-
Sam McCall authored
This more precise type is useful for tools, e.g. fixes https://github.com/clangd/clangd/issues/831 Differential Revision: https://reviews.llvm.org/D107275
-
Fangrui Song authored
Make it smaller
-
Craig Topper authored
[LegalizeIntegerTypes] Rename NewLHS/NewRHS arguments to DAGTypeLegalizer::PromoteSetCCOperands. NFC The 'New' only makes sense in the context of these being output arguments, but they are also used as inputs first. Drop the 'New' and just call them LHS/RHS. Factored out of D116421.
-
Ellis Hoag authored
In debug info correlation mode we do not emit the data globals so we need to explicitly mark the counter globals as used so they don't get stripped. Reviewed By: kyulee Differential Revision: https://reviews.llvm.org/D115981
-
MaheshRavishankar authored
These method currently takes a SmallVector<AffineExpr> & as an argument to return the dims as AffineExpr. This creation of AffineExpr objects is unnecessary. Differential Revision: https://reviews.llvm.org/D116422
-
Fangrui Song authored
-
Alexey Bataev authored
Need to clear CurrentOrder order mask if it is determined that extractelements form identity order and need to use a vector-like construct when iterating over ordered entries in the reorderTopToBottom function.
-
Krzysztof Parzyszek authored
Co-authored-by:
Anirudh Sundar Subramaniam <quic_sanirudh@quicinc.com> Co-authored-by:
Sumanth Gundapaneni <sgundapa@quicinc.com> Co-authored-by:
Joshua Herrera <joshherr@quicinc.com>
-
Louis Dionne authored
-
Mogball authored
-
Krzysztof Parzyszek authored
Co-authored-by:Anirudh Sundar Subramaniam <quic_sanirudh@quicinc.com>
-
Fangrui Song authored
Similar to D62188: a BitcodeFile's symbol table may be iterated twice, once in --start-lib (lazy) state, and once in the non-lazy state. This patch makes `parseLazy` save `symbols[i]` so that the non-lazy state does not need to re-insert to the global symbol table. Avoiding a redundant `saver.save` may save memory. `Maximum resident set size (kbytes)` for a large --thinlto-index-only link: * without the patch: 10164000 * with the patch: 10095716 (0.6% decrease) Note: we can remove `saver.save` if `BitcodeCompiler::add` does not transfer the ownership of `f.obj` in `checkError(ltoObj->add(std::move(f.obj), resols));`. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D116390
-
Craig Topper authored
This patch adds isel support for STRICT_LRINT/LLRINT/LROUND/LLROUND. It also adds test cases for f32 and f64 constrained intrinsics that correspond to the intrinsics in float-intrinsics.ll and double-intrinsics.ll. Support for promoting the integer argument of STRICT_FPOWI was added. I've skipped adding tests for f16 intrinsics, since we don't have libcalls for them and we have inconsistent support for promoting them in LegalizeDAG. This will need to be examined more closely. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D116323
-
Fangrui Song authored
-
long.chen authored
[MLIR] Add explicit `using` to disambiguate between multiple implementations from base classes (NFC) Both of DenseElementsAttr and ElementsAttrTrait define the method of getElementType, this commit makes it available on DenseIntOrFPElementsAttr and DenseStringElementsAttr. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D116389
-
Benjamin Kramer authored
This moves the only string function out of the big list of math funcs. And let's us CSE strnlen calls.
-
Fangrui Song authored
@tejohnson noticed that freeing MemoryBuffer instances right before `lto->compile` can save RSS, likely because the memory can be reused by LTO indexing (e.g. ThinLTO import/export lists).). For ELFFileBase instances, symbol and section names are backed by MemoryBuffer, so destroying MemoryBuffer would make some infrequent passes (parseSymbolVersion, reportBackrefs) crash and make debugging difficult. For a BitcodeFile, its content is completely unused, but destroying its MemoryBuffer makes the buffer identifier inaccessible and may introduce constraints for future changes. This patch leverages madvise(MADV_DONTNEED) which achieves the major gain without the latent issues. `Maximum resident set size (kbytes): ` for a large --thinlto-index-only link: * current behavior: 10146104KiB * destroy MemoryBuffer instances: 8555240KiB * madvise(MADV_DONTNEED) just bitcodeFiles and lazyBitcodeFiles: 8737372KiB * madvise(MADV_DONTNEED) all MemoryBuffers: 8739796KiB (16% decrease) Depends on D116366 Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D116367
-
William S. Moses authored
Per the discussion in https://reviews.llvm.org/D116345 it makes sense to move AtomicRMWOp out of the standard dialect. This was accentuated by the need to add a fold op with a memref::cast. The only dialect that would permit this is the memref dialect (keeping it in the standard dialect or moving it to the arithmetic dialect would require those dialects to have a dependency on the memref dialect, which breaks linking). As the AtomicRMWKind enum is used throughout, this has been moved to Arith. Reviewed By: Mogball Differential Revision: https://reviews.llvm.org/D116392
-
Jack Andersen authored
Extends response file expansion to recognize `<CFGDIR>` and expand to the current file's directory. This makes it much easier to author clang config files rooted in portable, potentially not-installed SDK directories. A typical use case may be something like the following: ``` # sample_sdk.cfg --target=sample -isystem <CFGDIR>/include -L <CFGDIR>/lib -T <CFGDIR>/ldscripts/link.ld ``` Reviewed By: sepavloff Differential Revision: https://reviews.llvm.org/D115604
-
Fangrui Song authored
On *NIX systems, this API calls madvise(MADV_DONTNEED) on read-only file mappings. It should not be used on a writable buffer. The API is used to implement ld.lld LTO memory saving trick (D116367). Note: on read-only file mappings, Linux's MADV_DONTNEED semantics match POSIX POSIX_MADV_DONTNEED and BSD systems' MADV_DONTNEED. On Windows, VirtualAllocEx MEM_COMMIT/MEM_RESET have similar semantics but are unfortunately not drop-in replacements. dontNeedIfMmap is currently a no-op. Reviewed By: aganea Differential Revision: https://reviews.llvm.org/D116366
-
Fangrui Song authored
To match the `--help` message and most other utilities. While here, change `option:: -output=output` to `option:: --output=<output>` and omit the value name for the short options (convention of other utilities). Reviewed By: snehasish Differential Revision: https://reviews.llvm.org/D116353
-
Krzysztof Parzyszek authored
-
Krzysztof Parzyszek authored
Co-authored-by:
Rahul Utkoor <quic_rutkoor@quicinc.com> Co-authored-by:
Anirudh Sundar Subramaniam <quic_sanirudh@quicinc.com>
-
Luís Ferreira authored
This reverts commit e60d6dfd. clang-ppc64le-rhel buildbot failed (https://lab.llvm.org/buildbot#builders/57/builds/13424): tools/lld/MachO/CMakeFiles/lldMachO.dir/Symbols.cpp.o: In function `lld::demangle(llvm::StringRef, bool)': Symbols.cpp:(.text._ZN3lld8demangleEN4llvm9StringRefEb[_ZN3lld8demangleEN4llvm9StringRefEb]+0x90): undefined reference to `llvm::demangle(std::string const&)'
-
Krzysztof Parzyszek authored
Co-authored-by:Sumanth Gundapaneni <sgundapa@quicinc.com>
-
Luís Ferreira authored
LLVM core library supports demangling other mangled symbols other than itanium, such as D and Rust. LLD should use those demanglers in order to output pretty demangled symbols on error messages. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D116279
-
Sanjay Patel authored
((X << C) + Y) >>u C --> (X + (Y >>u C)) & (-1 >>u C) https://alive2.llvm.org/ce/z/DY9DPg This replaces a shift with an 'and', and in the case where the add has a constant operand, it eliminates both shifts. As noted in the TODO comment, we already have this fold when the shifts are in the opposite order (and that code handles bitwise logic ops too). Fixes #52851
-
Sanjay Patel authored
This reverts commit 2e3e0a5c. Some unintended diffs snuck into this patch.
-
Sanjay Patel authored
((X << C) + Y) >>u C --> (X + (Y >>u C)) & (-1 >>u C) https://alive2.llvm.org/ce/z/DY9DPg This replaces a shift with an 'and', and in the case where the add has a constant operand, it eliminates both shifts. As noted in the TODO comment, we already have this fold when the shifts are in the opposite order (and that code handles bitwise logic ops too). Fixes #52851
-
Krzysztof Parzyszek authored
Co-authored-by:Anirudh Sundar Subramaniam <quic_sanirudh@quicinc.com>
-