- Feb 13, 2020
-
-
Fangrui Song authored
GNU ld has a counterintuitive lang_propagate_lma_regions rule. ``` // .foo's LMA region is propagated to .bar because their VMA region is the same, // and .bar does not have an explicit output section address (addr_tree). .foo : { *(.foo) } >RAM AT> FLASH .bar : { *(.bar) } >RAM // An explicit output section address disables propagation. .foo : { *(.foo) } >RAM AT> FLASH .bar . : { *(.bar) } >RAM ``` In both cases, lld thinks .foo's LMA region is propagated and places .bar in the same PT_LOAD, so lld diverges from GNU ld w.r.t. the second case (lma-align.test). This patch changes Writer<ELFT>::createPhdrs to disable propagation (start a new PT_LOAD). A user of the first case can make linker scripts portable by explicitly specifying `AT>`. By contrast, there was no workaround for the old behavior. This change uncovers another LMA related bug in assignOffsets() where `ctx->lmaOffset = 0;` was omitted. It caused a spurious "load address range overlaps" error for at2.test The new PT_LOAD rule is complex. For convenience, I listed the origins of some subexpressions: * rL323449: `sec->memRegion == load->firstSec->memRegion`; linkerscript/at3.test * D43284: `load->lastSec == Out::programHeaders` (don't start a new PT_LOAD after program headers); linkerscript/at4.test * D58892: `sec != relroEnd` (start a new PT_LOAD after PT_GNU_RELRO) Reviewed By: psmith Differential Revision: https://reviews.llvm.org/D74297 -
Fangrui Song authored
When lmaRegion is non-null, respect `sec->alignment` This rule is analogous to `switchTo(sec)` which advances sh_addr (VMA). This fixes the p_paddr misalignment issue as reported by https://android-review.googlesource.com/c/trusty/external/trusted-firmware-a/+/1230058 Note, `sec->alignment` is the maximum of ALIGN and input section alignments. We may overalign LMA than GNU ld. linkerscript/align-lma.s has a FIXME that demonstrates another bug: `.bss ... >RAM` should be placed in a different PT_LOAD (GNU ld behavior) because its lmaRegion (nullptr) is different from the previous section's lmaRegion (ROM). Reviewed By: psmith Differential Revision: https://reviews.llvm.org/D74286
-
Jordan Rupprecht authored
Summary: GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use. As an example of a problem this causes, see: https://github.com/ClangBuiltLinux/linux/issues/779 Reviewers: MaskRay, jhenderson, alexshap Reviewed By: MaskRay Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74433
-
Simon Pilgrim authored
This has a really interesting side effect in that it improves some UMAX/UMIN reduction code which had redundant XOR(SHUFFLE(XOR(X,SIGNMASK)),SIGNMASK) patterns - the getNegatibleCost recognises it as FNEG(SHUFFLE(FNEG(X))).... We have a lot of FNEG patterns bitcasted to the integer domain for XOR signbit twiddling which is similar to what we do to allow UMAX/UMIN to be lowered using SMAX/SMIN. Differential Revision: https://reviews.llvm.org/D74231
-
- Feb 12, 2020
-
-
Sven van Haastregt authored
-
Haojian Wu authored
Reviewers: gribozavr2 Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74468
-
Anh Tuyen Tran authored
Summary: A number of testcases in TSAN are designed to deal with intermittent problems not exist in all executions of the tested program. A script called deflake.bash runs the executable up to 10 times to deal with the intermittent nature of the tests. The purpose of this patch is to parameterize the hard-coded threshold above via --cmake_variables=-DTSAN_TEST_DEFLAKE_THRESHOLD=SomeIntegerValue When this cmake var is not set, the default value of 10 will be used. Reviewer: dvyukov (Dmitry Vyukov), eugenis (Evgenii Stepanov), rnk (Reid Kleckner), hubert.reinterpretcast (Hubert Tong), vitalybuka (Vitaly Buka) Reviewed By: vitalybuka (Vitaly Buka) Subscribers: mgorny (Michal Gorny), jfb (JF Bastien), steven.zhang (qshanz), llvm-commits (Mailing List llvm-commits), Sanitizers Tag: LLVM, Sanitizers Differential Revision: https://reviews.llvm.org/D73707
-
Louis Dionne authored
Summary: In D27429, we switched the Apple implementation of steady_clock::now() from clock_gettime(CLOCK_MONOTONIC) to clock_gettime(CLOCK_UPTIME_RAW). The purpose was to get nanosecond precision, and also to improve the performance of the implementation. However, it appears that CLOCK_UPTIME_RAW does not satisfy the requirements of the Standard, since it is not strictly speaking monotonic. Indeed, the clock does not increment while the system is asleep, which had been mentioned in D27429 but somehow not addressed. This patch switches to CLOCK_MONOTONIC_RAW, which is monotonic, increased during sleep, and also has nanosecond precision. https://llvm.org/PR44773 Reviewers: bruno, howard.hinnant, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists, EricWF Tags: #libc Differential Revision: https://reviews.llvm.org/D74341
-
Danilo Carvalho Grael authored
Summary: Add intrinsics for the following instructions: - adclb, adclt, sbclb, sbclt Reviewers: kmclaughlin, c-rhodes, sdesmalen, efriedma, rengolin Reviewed By: kmclaughlin Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74328
-
Melanie Blower authored
This reverts commit 99c5bcbc. Change clang option -ffp-model=precise to select ffp-contract=on Including some small touch-ups to the original commit Reviewers: rjmccall, Andy Kaylor Differential Revision: https://reviews.llvm.org/D74436
-
Victor Huang authored
An option is added for PowerPC to disable use of non-volatile CR register fields and avoid CR spilling in the prologue. Differential Revision: https://reviews.llvm.org/D69835
-
Louis Dionne authored
The calculation _Offset + _Count <= size() may overflow, so use _Count <= size() - _Offset instead. Note that this is safe due to the previous constraint that _Offset <= size(). Patch by Michael Schellenberger Costa. Differential Revision: https://reviews.llvm.org/D71998
-
Anil Mahmud authored
Add support for the intrinsic llvm.ppc.eieio to emit the instruction eieio. Differential Revision: https://reviews.llvm.org/D69066
-
Anil Mahmud authored
Added support for the intrinsic llvm.ppc.dcbfl and llvm.ppc.dcbflp. These will be used for emitting cache control instructions dcbfl and dcbflp which are actually mnemonics for using dcbf instruction with different immediate arguments. dcbfl ra, rb -> dcbf ra, rb, 1 dcbflp, ra, rb -> dcbf ra, rb, 3 Differential Revision: https://reviews.llvm.org/D68411
-
Matt Arsenault authored
These are only legal on CI+. The test would fail in a debug build, but not a release due to the partial selection since the pre-selection legality assert only happens in a debug build.
-
James Henderson authored
-
James Henderson authored
The DWARFv2-4 specification for the line table header states that the include directories and file name tables both end with a single null byte. Prior to this change, the parser did not detect if this byte was missing, because it also stopped reading the tables once it reached the prologue end, as claimed by the header_length field. This change adds a check that the terminator has been seen at the end of each table. Reviewed by: dblaikie, MaskRay Differential Revision: https://reviews.llvm.org/D74413
-
James Henderson authored
The number of standard opcodes is defined to be opcode_base - 1, so a value of 0 for the opcode_base caused a crash as an attempt was made to reserve many entries in a vector. This change fixes the crash, by issuing a warning and skipping reading of standard opcode lengths in the event of an opcode_base of 0. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D74309
-
James Henderson authored
Also remove some test duplication and add a test case that shows the maximum version is rejected (this also shows that the value in the error message is actually in decimal, and not just missing an 0x prefix). Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D74403
-
Matt Arsenault authored
Load extra bits if suitably aligned. This allows using widened 3-vector loads on SI, and fixes legalization for <9 x s32> (which LSV apparently forms frequently on lowered kernel argument lists). Fix incorrectly treating these as legal on SI. This should emit a 64-bit store and a 32-bit store. I think all of the load and store rules are just about complete, but due for a rewrite.
-
Saar Raz authored
If an error had occurred when annotating a scope spec during the tentative parse for a type-requirement, we would not revert nor commit the tentative parse, triggerring an assertion failure. Commit the TPA in this case and then do error recovery.
-
Florian Hahn authored
This includes a fix for the santizier failures. This reverts the revert commit 42f8b915.
-
Alex Zinenko authored
They are currently not supported and we should not attempt fusing them.
-
Pierre Oechsel authored
A memref_cast casting to a memref with a non identity map can't be lowered to llvm. Take the following case: ``` func @invalid_memref_cast(%arg0: memref<?x?xf64>) { %c1 = constant 1 : index %c0 = constant 0 : index %5 = memref_cast %arg0 : memref<?x?xf64> to memref<?x?xf64, #map1> %25 = std.subview %5[%c0, %c0][%c1, %c1][] : memref<?x?xf64, #map1> to memref<?x?xf64, #map1> return } ``` When lowering the subview mlir was assuming `%5` to have an llvm type (which is not the case as mlir failed to lower the memref_cast). Differential Revision: https://reviews.llvm.org/D74466 -
Hans Wennborg authored
-
Stephan Herhut authored
Summary: This was broken recently when moving from dialect registration via static initializers to explicit intialization. Differential Revision: https://reviews.llvm.org/D74480
-
Saar Raz authored
We previously checked the constraints of instantiated function templates even in cases where PartialOverloading was true and not all template arguments have been deduced, which caused crashes in clangd (bug 44714). We now check if all arguments have been deduced before checking constraints in partial overloading scenarios.
-
Ayman Musa authored
[AggressiveInstCombine] Add test with baseline CHECKs for aggressive inst combine for ICmp instruction.
-
Sergej Jaskiewicz authored
Summary: In `std::filesystem::proximate` tests we assume that the current working directory's name is `fs.op.proximate`. This is fine when we're running the tests locally. However, if we're running those tests on a remote machine via SSH, the directory layout may be different. For example, currently we copy each test executable individually into a temporary directory on the target board using SCP, so the assumption about the working directory name doesn't necessarily hold. This patch is the only thing that is necessary for all libc++ tests to pass when run remotely. Reviewers: ldionne, EricWF, mclow.lists Reviewed By: ldionne, EricWF Subscribers: christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D74348
-
Ayman Musa authored
Revert "[AggressiveInstCombine] Add support for ICmp instr that feeds a select intsr's condition operand." This reverts commit cf155150.
-
Ayman Musa authored
-
Lei Zhang authored
Thus far we have been using builtin func op to model SPIR-V functions. It was because builtin func op used to have special treatment in various parts of the core codebase (e.g., pass pipelines, etc.) and it's easy to bootstrap the development of the SPIR-V dialect. But nowadays with general op concepts and region support we don't have such limitations and it's time to tighten the SPIR-V dialect for completeness. This commits introduces a spv.func op to properly model SPIR-V functions. Compared to builtin func op, it can provide the following benefits: * We can control the full op so we can integrate SPIR-V information bits (e.g., function control) in a more integrated way and define our own assembly form and enforcing better verification. * We can have a better dialect and library boundary. At the current moment only functions are modelled with an external op. With this change, all ops modelling SPIR-V concpets will be spv.* ops and registered to the SPIR-V dialect. * We don't need to special-case func op anymore when creating ConversionTarget declaring SPIR-V dialect as legal. This is quite important given we'll see more and more conversions in the future. In the process, bumps a few FuncOp methods to the FunctionLike trait. Differential Revision: https://reviews.llvm.org/D74226
-
Mehdi Amini authored
Differential Revision: https://reviews.llvm.org/D74472
-
Ehud Katz authored
-
Ayman Musa authored
Differential Revision: https://reviews.llvm.org/D72837
-
Simon Pilgrim authored
The isNegatibleForFree/getNegatedExpression methods currently rely on a raw char value to indicate whether a negation is beneficial or not. This patch replaces the char return value with an NegatibleCost enum to more clearly demonstrate what is implied. It also renames isNegatibleForFree to getNegatibleCost to more accurately reflect whats going on. Differential Revision: https://reviews.llvm.org/D74221
-
Balázs Kéri authored
Reviewers: Szelethus Reviewed By: Szelethus Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73359
-
Pavel Labath authored
This is simpler, faster, and sufficient to uniquely idenify a DIE.
-